Auth bypass: @Secured expressions evaluated as another user during JWKS load
Description
An unauthenticated client with no key and no account can get the response of a controller method protected by a @Secured expression on user. This happens whenever the client's request is checked while another user's request is loading the remote JWK Set: the expression is evaluated as that other user. An authenticated user for whom the expression is false is let through the same way. It requires two documented opt-ins, JWT validation against a remote JWK Set (…signatures.jwks.*.url, or an OpenID client's jwks_uri) and an expression-based @Secured. The attached reproducer sends a junk bearer token (header {"alg":"RS256"}, payload {"sub":"nobody"}, 256 bytes of 0x01 as the signature). That...
Affected and patched versions
The following ranges cover stable releases.
| Release line | Affected versions | First patched release | Fix commit |
|---|---|---|---|
| 4.x | >= 4.11.0, < 4.18.2 | 4.18.2 | 454b008ca0 |
| 5.0.x–5.4.x | >= 5.0.0, < 5.4.3 | 5.4.3 | ef855edbbd |
| 5.5.x | >= 5.5.0, < 5.5.3 | 5.5.3 | 8e903396c8 |
The fix commits are included in the corresponding release tags and absent from the preceding stable releases (4.18.1, 5.4.2, 5.5.2).
The lower bound is the earliest stable release the finding traces the behavior to.
Suggested severity
Suggested CVSS v3.1 vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N. This is an initial estimate based on the finding report and should be reviewed against the final impact and deployment prerequisites.
Source finding: ANT-2026-MRC8GGCN.