CVE-2026-50631
Apache CXF vulnerability analysis and mitigation

Overview

CVE-2026-50631 is a Time-of-Check Time-of-Use (TOCTOU) race condition vulnerability in Apache CXF's OAuth2 implementation, specifically in the AbstractOAuthDataProvider class. It allows concurrent requests using the same Refresh Token to bypass single-use semantics and generate multiple valid Access Tokens when the recycleRefreshTokens configuration option is set to false. Affected versions include Apache CXF (org.apache.cxf:cxf-rt-rs-security-oauth2) before 4.1.7 and 4.2.0 before 4.2.2. The vulnerability was disclosed on June 11, 2026, and carries a CVSS v3.1 base score of 7.4 (High) (Apache Advisory, GitHub Advisory).

Technical details

The root cause is a TOCTOU race condition (CWE-367) in the AbstractOAuthDataProvider class within Apache CXF's OAuth2 module (cxf-rt-rs-security-oauth2). When recycleRefreshTokens is set to false, the provider checks the validity of a refresh token and then uses it to issue a new access token, but the state of the token is not atomically updated between the check and the use. This window allows multiple concurrent HTTP requests bearing the same leaked refresh token to all pass the validity check before any single one of them invalidates the token, resulting in multiple valid access tokens being issued. The vulnerability was reported by Guanping Zhang and requires an attacker to have obtained a valid refresh token through other means (e.g., token leakage) before exploitation (oss-security, GitHub Advisory).

Impact

Successful exploitation allows an unauthenticated attacker (who possesses a leaked refresh token) to bypass single-use token semantics and generate multiple valid access tokens simultaneously, gaining unauthorized access to protected resources. The confidentiality and integrity impacts are rated High, as an attacker could read sensitive data and perform unauthorized actions on behalf of the token's legitimate owner. Availability is not directly impacted. If the compromised account has broad permissions, this could facilitate lateral movement within the protected application ecosystem (GitHub Advisory, oss-security).

Exploitation steps

  1. Obtain a Refresh Token: Acquire a valid OAuth2 refresh token from a target Apache CXF deployment through token leakage, interception (e.g., man-in-the-middle on an insecure channel), or credential theft. This is a prerequisite for exploitation.
  2. Verify Target Configuration: Confirm that the target CXF instance has recycleRefreshTokens set to false (the non-default or explicitly configured state that enables the race condition).
  3. Craft Concurrent Token Refresh Requests: Prepare multiple simultaneous HTTP POST requests to the OAuth2 token endpoint (e.g., /oauth2/token) with grant_type=refresh_token and the stolen refresh_token value.
  4. Race the Token Endpoint: Send all crafted requests concurrently (e.g., using multi-threaded scripts or tools like curl with parallel execution, or asyncio-based HTTP clients) to exploit the TOCTOU window before the server can invalidate the token.
  5. Collect Multiple Access Tokens: If the race condition is won, multiple valid access tokens are returned — each usable independently to access protected resources on behalf of the legitimate token owner (oss-security, GitHub Advisory).

Indicators of compromise

  • Network: Multiple simultaneous or near-simultaneous HTTP POST requests to the OAuth2 token endpoint (/oauth2/token or equivalent) from the same or different source IPs, all carrying the same refresh_token value within a very short time window.
  • Logs: OAuth2 token endpoint access logs showing the same refresh token used successfully more than once in rapid succession; multiple access token issuance events tied to a single refresh token within milliseconds.
  • Application Behavior: Unexpected concurrent active sessions for the same user account; access tokens appearing in use from multiple distinct IP addresses or user agents simultaneously, suggesting token sharing or replay.

Mitigation and workarounds

Users should upgrade to Apache CXF version 4.2.2 (for the 4.2.x branch) or 4.1.7 (for the 4.1.x branch), which contain the fix for this race condition (Apache Advisory, oss-security). As a temporary workaround, set recycleRefreshTokens to true to enforce single-use refresh token semantics, which eliminates the exploitable race condition window. Additionally, implement monitoring for concurrent refresh token usage and revoke any tokens exhibiting signs of replay activity.

Community reactions

The vulnerability was disclosed via the Apache security mailing list and oss-security on June 11, 2026, by Colm O hEigeartaigh on behalf of the Apache CXF team, crediting Guanping Zhang as the finder (oss-security). The Apache project rated the severity as "low" in their own advisory, while NVD assigned a CVSS score of 7.4 (High), reflecting a discrepancy in severity assessment. A brief mention appeared on Bluesky via the infosec.skyfleet.blue account shortly after disclosure, and the vulnerability was indexed by standard security aggregators (VulDB, Vulners, cvefeed.io) without significant broader community discussion.

Additional resources


SourceThis report was generated using AI

Related Apache CXF vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-50633HIGH8.1
  • Apache CXF logoApache CXF
  • cpe:2.3:a:apache:cxf
NoYesJun 12, 2026
CVE-2026-50632HIGH8.1
  • Apache CXF logoApache CXF
  • cpe:2.3:a:apache:cxf
NoYesJun 12, 2026
CVE-2026-50645HIGH7.5
  • Apache CXF logoApache CXF
  • cpe:2.3:a:apache:cxf
NoYesJun 12, 2026
CVE-2026-50631HIGH7.4
  • Apache CXF logoApache CXF
  • cpe:2.3:a:apache:cxf
NoYesJun 12, 2026
CVE-2026-50634MEDIUM6.5
  • Apache CXF logoApache CXF
  • cpe:2.3:a:apache:cxf
NoYesJun 12, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management