Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-22258 Overview
CVE-2024-22258 affects Spring Authorization Server, allowing a Proof Key for Code Exchange (PKCE) Downgrade Attack against Confidential Clients. The flaw impacts applications where a Confidential Client uses PKCE for the Authorization Code Grant. Public Clients using PKCE are not affected. An attacker can leverage the weakness to bypass the integrity protection that PKCE provides for the Authorization Code flow, enabling authorization code interception scenarios the mechanism was designed to prevent. The issue is tracked under [CWE-470] (Use of Externally-Controlled Input to Select Classes or Code) in the Spring Authorization Server project.
Critical Impact
Attackers can downgrade PKCE enforcement for Confidential Clients, enabling authorization code theft and account takeover under specific conditions.
Affected Products
- Spring Authorization Server 1.0.0 through 1.0.5
- Spring Authorization Server 1.1.0 through 1.1.5
- Spring Authorization Server 1.2.0 through 1.2.2
Discovery Timeline
- 2024-03-20 - CVE-2024-22258 published to the National Vulnerability Database
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-22258
Vulnerability Analysis
Spring Authorization Server implements the OAuth 2.1 Authorization Code Grant with optional PKCE support. PKCE binds an authorization request to the client that initiated it by requiring a cryptographic code_verifier paired with a code_challenge. For Confidential Clients, affected versions of Spring Authorization Server fail to enforce PKCE consistently when a client registration opts into it. An attacker who intercepts an authorization code can exchange it at the token endpoint without presenting a matching code_verifier, defeating the downgrade protection PKCE is intended to provide. The result is user impersonation within the client application boundary. See the Spring Security Advisory CVE-2024-22258 for vendor confirmation.
Root Cause
The authorization server does not require the code_verifier on token exchange when a Confidential Client previously issued a code_challenge. The server treats PKCE as advisory rather than mandatory for authenticated clients, allowing a token request without the paired verifier to succeed as long as the client credentials validate.
Attack Vector
Exploitation requires user interaction and network access to the OAuth flow. An attacker intercepts or steals an authorization code through a redirect manipulation, log leakage, or compromised intermediate component. The attacker then submits the code to the token endpoint using the Confidential Client credentials but omits the matching code_verifier. The server returns tokens for the victim user, completing the downgrade attack.
// No verified proof-of-concept code available.
// Refer to the Spring Security Advisory for technical details:
// https://spring.io/security/cve-2024-22258
Detect Identity Attacks the Moment Authentication Fails
Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.
Stop Identity AttacksDetection Methods for CVE-2024-22258
Indicators of Compromise
- Token endpoint requests from Confidential Clients that include an authorization code but omit the code_verifier parameter when the authorization request contained a code_challenge.
- Unexpected successful token exchanges originating from client IP addresses that differ from the originating authorization request.
- Elevated rates of OAuth authorization code redemption failures followed by successful retries without PKCE parameters.
Detection Strategies
- Instrument the /oauth2/token endpoint to log the presence or absence of code_verifier alongside the client registration PKCE policy.
- Correlate authorization and token request pairs by code_challenge and alert when the subsequent token exchange lacks the verifier.
- Review Spring Authorization Server audit logs for Confidential Client flows that complete without PKCE validation.
Monitoring Recommendations
- Forward Spring Authorization Server access and audit logs to a centralized analytics platform for OAuth flow correlation.
- Baseline normal token exchange patterns per client and alert on deviations in parameter composition.
- Monitor identity provider sessions for anomalous geolocation or device fingerprint changes immediately after token issuance.
How to Mitigate CVE-2024-22258
Immediate Actions Required
- Upgrade Spring Authorization Server to a fixed release line: 1.0.6, 1.1.6, or 1.2.3 or later.
- Audit all Confidential Client registrations that enable PKCE and review recent token issuance logs for anomalies.
- Rotate client secrets for any Confidential Client suspected of exposure during the vulnerable window.
Patch Information
VMware addressed the issue in Spring Authorization Server versions 1.0.6, 1.1.6, and 1.2.3. Older unsupported versions remain vulnerable and require upgrade to a supported branch. Review the Spring Security Advisory CVE-2024-22258 for the complete remediation guidance and release notes.
Workarounds
- Disable PKCE for Confidential Clients until the upgrade is applied, relying on client authentication alone for integrity of the Authorization Code Grant.
- Enforce short authorization code lifetimes and strict redirect_uri matching to reduce the window for code interception.
- Restrict token endpoint access through network controls where feasible to limit exposure to untrusted callers.
# Example Maven dependency update to a patched version
# <dependency>
# <groupId>org.springframework.security</groupId>
# <artifactId>spring-security-oauth2-authorization-server</artifactId>
# <version>1.2.3</version>
# </dependency>
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

