Summary
CVE-2026-57818 is a time-of-check to time-of-use (TOCTOU) race condition in Apache CXF’s OAuth2 security module (cxf-rt-rs-security-oauth2). An unauthenticated attacker can redeem a single OAuth2 authorization code multiple times through concurrent requests, causing the authorization server to issue multiple distinct, valid access tokens. The issue is rated High severity with a CVSS v3.1 base score of 8.1.
Technical details
- Root cause: A synchronization flaw in
JCacheCodeDataProviderfails to atomically invalidate an authorization code when it is redeemed, so concurrent redemptions read the code as still valid before it is consumed. - Trigger conditions: An attacker submits multiple concurrent token requests using the same authorization code, defeating the intended single-use restriction.
- Attack vector: Network; no privileges or user interaction required. Attack complexity is High because the exploit depends on winning a timing race.
- Impact: Issuance of multiple valid access tokens from one authorization code, undermining the integrity and confidentiality guarantees of the OAuth2 flow and enabling unauthorized access.
Affected software
- Apache CXF
cxf-rt-rs-security-oauth24.2.0 through 4.2.2 - Apache CXF
cxf-rt-rs-security-oauth24.0.0 through 4.1.7 - Apache CXF
cxf-rt-rs-security-oauth2before 3.6.12 (0 through 3.6.11)
Severity
CVSS v3.1 base score: 8.1 (High)
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: Upgrade to a fixed release — Apache CXF 4.2.3, 4.1.8, or 3.6.12, depending on your branch.
- If no patch: Restrict and monitor access to the OAuth2 token endpoint, and where possible reduce the exposure of the authorization-code grant flow until the upgrade can be applied.

