Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreSeveral components in Spring Security compare security-sensitive values using standard string equality (String.equals()) rather than a constant-time comparison. Because String.equals() returns as soon as it finds a differing character, the time taken to reject an incorrect value is proportional to the number of leading characters that match the expected value. An attacker capable of submitting a very large number of guesses and precisely measuring response latency could, in principle, use these timing differences to recover the expected value one character at a time.
The affected comparisons are:
DigestAuthenticationFilter, when validating the client-supplied Digest authentication response and nonce signature.KeyBasedPersistenceTokenService, when verifying a token's key.BalloonHashingPassword4jPasswordEncoder and Pbkdf2Password4jPasswordEncoder, when verifying a raw password against its stored hash.InMemoryOAuth2AuthorizationService, when locating an authorization by its state, authorization code, access token, refresh token, ID token, device code, or user code.An application is potentially affected when it:
DigestAuthenticationFilter for HTTP Digest authentication (a legacy authentication mechanism).KeyBasedPersistenceTokenService, a class that is not wired by any Spring Security component by default.BalloonHashingPassword4jPasswordEncoder or Pbkdf2Password4jPasswordEncoder to verify passwords.InMemoryOAuth2AuthorizationService in an OAuth2 authorization server and permits an attacker to repeatedly probe token-related endpoints.Successfully exploiting any of these timing differences to recover a secret value would require an attacker to submit an extremely large number of requests with low network jitter and precise timing measurement, which is difficult to achieve reliably over a typical network. Where exploitable, a successful attack could allow an attacker to recover a password hash, authentication digest, verification key, or OAuth2 token value without otherwise knowing it, potentially resulting in impersonation or unauthorized access.
Spring Security:
| Fix version | Availability |
|---|---|
| 7.1.1 | OSS |
| 7.1.0.1 | Enterprise Support Only |
| 7.0.7 | OSS |
| 7.0.6.1 | Enterprise Support Only |
| 6.5.12 | Enterprise Support Only |
| 6.4.19 | Enterprise Support Only |
| 5.8.28 | Enterprise Support Only |
| 5.7.26 | Enterprise Support Only |
No further mitigation steps are necessary.
This vulnerability was reported responsibly by Andrey Litvitski.
To report a security vulnerability for a project within the Spring portfolio, see the Security Policy