HIGH 7.4

CVE-2026-50631: Apache CXF OAuth Race Condition Allows Multiple Token Generation

Apache CXF contains a race condition in its OAuth token handling that allows attackers to generate multiple valid access tokens from a single refresh token when the 'recycleRefreshTokens' setting is disabled. If a refresh token is leaked or compromised, an attacker can send concurrent requests to the OAuth provider using that token, potentially obtaining numerous valid access tokens before the provider realizes the refresh token has been misused. This breaks the intended single-use semantics of refresh tokens and significantly expands the window of compromise.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.4 HIGH · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Weaknesses (CWE)
CWE-367
Affected products
1 configuration(s)
Published / Modified
2026-06-12 / 2026-06-17

NVD description (verbatim)

A race condition in AbstractOAuthDataProvider allows concurrent requests using the same Refresh Token to bypass single-use semantics and generate multiple valid Access Tokens, when 'recycleRefreshTokens' is set to false. A leaked refresh token can be replayed concurrently by multiple attackers or threads. Users are recommended to upgrade to versions 4.2.2 or 4.1.7, which fixes this issue.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-50631 is a race condition vulnerability (CWE-367) in Apache CXF's AbstractOAuthDataProvider class. When 'recycleRefreshTokens' is configured as false, the OAuth provider lacks sufficient synchronization or atomic operations when validating and consuming refresh tokens during concurrent token exchange requests. An attacker with a leaked refresh token can exploit this by issuing multiple simultaneous token exchange requests; due to the race condition, the provider may issue distinct valid access tokens for each request rather than rejecting subsequent uses. The vulnerability exists because the check-then-act sequence for refresh token validation is not atomic, allowing multiple threads or requests to pass validation before any single request completes the token consumption step.

Business impact

Compromise of a single refresh token could enable an attacker to obtain multiple valid access tokens, each potentially granting independent sessions or API access. This extends the attack surface beyond a single compromised token and can complicate token revocation efforts, as the attacker holds multiple valid credentials rather than one. Organizations relying on refresh token rotation as a security boundary may find that boundary significantly weakened, and incident response teams may struggle to identify and revoke all attacker-generated tokens if the initial compromise goes undetected. The impact is especially severe in environments where refresh tokens have long lifespans or are shared across multiple services.

Affected systems

Apache CXF versions prior to 4.2.2 and 4.1.7 are affected. The vulnerability specifically manifests when the 'recycleRefreshTokens' configuration option is set to false. Organizations running OAuth flows through CXF should verify their version and configuration. The issue does not affect deployments where 'recycleRefreshTokens' is set to true (the default behavior in recent versions), as true enables refresh token rotation and invalidation on each use.

Exploitability

Exploitation requires a leaked or stolen refresh token and the ability to send concurrent requests to the OAuth token endpoint. The CVSS score of 7.4 (HIGH, with AC:H indicating attack complexity is high) reflects that while the vulnerability is exploitable over the network without authentication, it requires specific conditions: knowledge of a valid refresh token and timing multiple requests concurrently. An attacker cannot generate refresh tokens from scratch; they must first obtain one through phishing, credential theft, application compromise, or log exposure. Once obtained, however, the attack is straightforward and does not require user interaction.

Remediation

Upgrade Apache CXF to version 4.2.2 or later, or to version 4.1.7 if you are on the 4.1.x branch. These versions fix the race condition by implementing proper synchronization when processing refresh token exchanges. Additionally, review your 'recycleRefreshTokens' configuration; if you are using false, consider changing to true (the recommended default) to ensure refresh tokens are invalidated after each use, providing an additional layer of defense. Until patching is complete, monitor token endpoint logs for suspicious patterns such as multiple rapid token requests using the same refresh token.

Patch guidance

Apply version 4.2.2 or 4.1.7 according to your current CXF branch. Verify the patch by confirming the version string in your CXF JAR file or Maven dependency output. Test the upgrade in a staging environment to ensure compatibility with your OAuth consumer applications before rolling out to production. If you are unable to patch immediately, enable the 'recycleRefreshTokens' setting (set to true) if it is not already active; this forces refresh token rotation and reduces the window for race condition exploitation, though it does not eliminate the underlying vulnerability in the token validation logic.

Detection guidance

Examine OAuth token endpoint logs for patterns indicating potential exploitation: multiple distinct access tokens issued within a short time window in response to token exchange requests using the same refresh token; or multiple token requests from the same IP or client originating within milliseconds of each other. Implement alerting for refresh token reuse anomalies. If your environment supports it, correlate token issuance logs with session initiation logs to detect if multiple access tokens from the same refresh token are being actively used in parallel. Review leaked credential databases and your own logs for any signs of refresh token exposure.

Why prioritize this

Although the vulnerability has not yet been added to the CISA KEV catalog and requires specific conditions (concurrent requests + leaked token), the HIGH CVSS score and the fundamental nature of OAuth token handling warrants prompt patching. Refresh tokens are long-lived credentials; a single leaked token could potentially yield multiple valid access tokens, turning a single credential exposure into a multi-token compromise. Organizations should prioritize this within their regular patch cycle, especially if they use CXF for critical authentication or API access flows.

Risk score, explained

The CVSS 3.1 score of 7.4 reflects a high-severity vulnerability with network-based exploitability, no authentication requirement, and confidentiality and integrity impact (an attacker gains unauthorized API access and can perform authenticated actions). The 'high' attack complexity (AC:H) reduces the score from critical, accounting for the need to obtain a valid refresh token and execute precise concurrent timing. The lack of availability impact (A:N) further moderates the score, as the attack does not disrupt the OAuth service itself. The overall rating underscores that this is a serious credential compromise issue, though not a complete system outage threat.

Frequently asked questions

What is the 'recycleRefreshTokens' setting, and how does it relate to this vulnerability?

The 'recycleRefreshTokens' configuration controls whether a refresh token is invalidated (rotated) after a successful token exchange. When set to true (recommended), each use of a refresh token invalidates it and issues a new one, limiting the window for race condition exploitation. When set to false, the same refresh token can be reused multiple times, and the race condition allows an attacker to bypass the single-use check. Verify your configuration and consider enabling true if it is not already active.

Do I need a refresh token to exploit this vulnerability, or can an attacker generate one?

An attacker must first obtain a valid refresh token through credential theft, phishing, or application compromise; they cannot generate refresh tokens from scratch. However, once a refresh token is leaked, the race condition allows it to yield multiple valid access tokens, dramatically expanding the scope of a single credential compromise. This is why monitoring for leaked tokens and implementing rapid rotation is critical.

Why is this not on the CISA Known Exploited Vulnerabilities (KEV) list yet?

The KEV catalog tracks vulnerabilities that are actively exploited in the wild. As of the publication date, this vulnerability had not yet been added to that list, but that does not mean it is low-risk. Organizations should not use KEV status as the sole basis for patching decisions; a HIGH CVSS score and clear attack path warrant urgent remediation regardless of active exploitation reports.

What should I check in my logs to detect if this vulnerability was exploited?

Look for multiple access tokens issued in response to token exchange requests using the same refresh token within a short time window (seconds or less). Monitor for multiple token requests originating from the same source IP or client ID in rapid succession. If your application logs access tokens or session IDs, check whether multiple distinct sessions were created in parallel using the same refresh token. Anomalies in token issuance rates or concurrent session counts can signal exploitation attempts.

This analysis is provided for informational and educational purposes. The vulnerability details, affected versions, and remediation guidance are derived from published CVE data and vendor advisories. Organizations should verify all version numbers, configuration settings, and patch availability directly with Apache CXF documentation and security bulletins before implementing changes. This explainer does not constitute legal or professional security advice; consult with your security team and vendor support for decisions specific to your environment. Exploit code or detailed attack reproduction steps are intentionally omitted to reduce the risk of weaponization before patching is widely deployed. Source: NVD (public-domain), retrieved 2026-07-20. Analysis generated by SEC.co (claude-haiku-4-5).