# CVE-2026-50631: Apache CXF race condition in AbstractOAuthDataProvider

Source: https://junglewise.ai/threats/cve-2026-50631-apache-cxf-race-condition-in-abstractoauthdataprovider  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-12. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-50631 · Severity: high · CVSS 7.4 · Published 2026-06-12

Apache CXF is a widely-used framework for building web services and OAuth2-protected APIs. A timing flaw in its token handling allows attackers who obtain a single refresh token to generate multiple valid access tokens by making concurrent requests. This could enable account takeover or unauthorized data access if a refresh token is leaked or compromised. The issue only occurs when token recycling is disabled in the configuration.

Technologies: [Apache Software Foundation CXF](https://junglewise.ai/threats/technologies/cxf), [org.apache.cxf:cxf-rt-rs-security-oauth2 (Maven)](https://junglewise.ai/threats/technologies/org-apache-cxf-cxf-rt-rs-security-oauth2). Vendors: [Apache Software Foundation](https://junglewise.ai/threats/vendors/apache-software-foundation), [Maven](https://junglewise.ai/threats/vendors/maven).

## Quick answers

**Is CVE-2026-50631 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-50631 being exploited in the wild.

**How severe is CVE-2026-50631?** High severity, with a CVSS score of 7.4, published 12 June 2026.

**Which products and versions are affected?** Apache Software Foundation CXF 4.2.0 to 4.2.1, all versions before 4.1.7; org.apache.cxf:cxf-rt-rs-security-oauth2 (Maven) ECOSYSTEM:introduced=4.2.0,fixed=4.2.2.

**Is there a fix for CVE-2026-50631?** Yes. org.apache.cxf:cxf-rt-rs-security-oauth2 (Maven): upgrade to 4.2.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-50631 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-50631?** Check whether you run Apache Software Foundation CXF or org.apache.cxf:cxf-rt-rs-security-oauth2 (Maven) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- org.apache.cxf:cxf-rt-rs-security-oauth2 (Maven): upgrade to 4.2.2 or later

  ```sh
  # set org.apache.cxf:cxf-rt-rs-security-oauth2 to 4.2.2 in your pom.xml or build.gradle
  ```


## Technical details

The vulnerability is a time-of-check-time-of-use (TOCTOU) race condition in AbstractOAuthDataProvider's refresh token validation logic. When recycleRefreshTokens is set to false, the component checks token validity before consuming it, but concurrent requests can bypass this check and each generates a new access token from the same refresh token. An attacker with network access (no authentication required) can exploit this by issuing multiple simultaneous HTTP requests with an intercepted refresh token, bypassing the intended single-use semantics. This allows generation of multiple valid access tokens for the same identity, leading to unauthorized API access and potential data exposure. The fix in versions 4.2.2 and 4.1.7 implements proper locking to serialize token consumption.

## Affected products

- Apache CXF 4.2.0 before 4.2.2, and before 4.1.7

## Identifiers

- CVE-2026-50631
- GHSA-83r6-96m8-r52p

## Timeline

- 2026-06-12: disclosed: Published to GitHub Advisory Database and NVD
- 2026-06-12: patched: Patches released: CXF 4.2.2 and 4.1.7

## References

- [https://lists.apache.org/thread/s83t3x4r626o9h8rt0ryr1w7w53l1vv8](https://lists.apache.org/thread/s83t3x4r626o9h8rt0ryr1w7w53l1vv8)
- [http://www.openwall.com/lists/oss-security/2026/06/11/8](http://www.openwall.com/lists/oss-security/2026/06/11/8)

## Related threats

- [Apache CXF denial of service via attachment headers](https://junglewise.ai/threats/cve-2026-50645-apache-cxf-denial-of-service-via-attachment-headers)
- [Apache CXF signature verification bypass in JwsJsonContainerRequestFilter](https://junglewise.ai/threats/cve-2026-50634-apache-cxf-signature-verification-bypass-in)
- [Apache CXF CRLF injection in OAuth2 AuthorizationUtils](https://junglewise.ai/threats/cve-2026-50630-apache-cxf-crlf-injection-in-oauth2-authorizationutils)
- [Apache CXF log injection in OAuth2 clientId parameter](https://junglewise.ai/threats/cve-2026-50629-apache-cxf-log-injection-in-oauth2-clientid-parameter)
- [Apache CXF inverted IP binding check in OAuthRequestFilter](https://junglewise.ai/threats/cve-2026-50628-apache-cxf-inverted-ip-binding-check-in-oauthrequestfilter)
