Spring Security TOCTOU Race Condition Vulnerability in JdbcOneTimeTokenService

Vulnerability

A Time-of-check Time-of-use (TOCTOU) race condition vulnerability has been identified in Spring Security versions 6.4.0 through 6.4.15, 6.5.0 through 6.5.9, and 7.0.0 through 7.0.4. This vulnerability affects applications that configure One-Time Token login using JdbcOneTimeTokenService. The issue allows an attacker with a valid one-time token to send concurrent requests to the authentication endpoint, enabling the token to be used multiple times and create several authenticated sessions. In contrast, the default InMemoryOneTimeTokenService is thread-safe and not vulnerable to this issue.

Impact

Exploitation of this vulnerability allows a one-time token to authenticate multiple sessions, bypassing the intended single-use restriction and potentially leading to unauthorized access.

Remediation

Users of Spring Security versions 6.4.x should upgrade to 6.4.16, users of 6.5.x should upgrade to 6.5.10, and users of 7.0.x should upgrade to 7.0.5.

Added: Apr 21, 2026, 8:14 PM
Updated: Apr 21, 2026, 8:14 PM

Vulnerability Rating

Custom Algorithm
spread
6.6
impact
0.6
exploitability
3.7
remediation
7.7
relevance
6.4
threat
0.0
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.