Time-of-check Time-of-use (TOCTOU) Race Condition Affecting org.apache.cxf:cxf-rt-rs-security-oauth2 package, versions [,4.1.7)[4.2.0,4.2.2)


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Social Trends
EPSS
0.29% (21st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Time-of-check Time-of-use (TOCTOU) Race Condition vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JAVA-ORGAPACHECXF-17339183
  • published15 Jun 2026
  • disclosed12 Jun 2026
  • creditGuanping Zhang

Introduced: 12 Jun 2026

CVE-2026-50631  (opens in a new tab)
CWE-367  (opens in a new tab)

How to fix?

Upgrade org.apache.cxf:cxf-rt-rs-security-oauth2 to version 4.1.7, 4.2.2 or higher.

Overview

org.apache.cxf:cxf-rt-rs-security-oauth2 is a services framework.

Affected versions of this package are vulnerable to Time-of-check Time-of-use (TOCTOU) Race Condition due to a race condition in the AbstractOAuthDataProvider method when handling refresh tokens if the recycleRefreshTokens setting is set to false. An attacker can obtain multiple valid access tokens by concurrently replaying a leaked refresh token.

CVSS Base Scores

version 4.0
version 3.1