Skip to main content
Menu
Advisories

Memory leak in NimbusJsonWebTokenSignatureValidator via unverified alg

GHSA-8Q27-VGX7-M7RXPublished Updated GitHub

Description

An unbounded cache in security-jwt's NimbusJsonWebTokenSignatureValidator lets anyone who can submit a JWT to an application make the JVM permanently retain memory, up to about 19 KB per rejected token, without holding a valid token or any key. Crafted alg names can also slow validation of genuine tokens. Only applications that pass tokens from outsiders to the imperative JsonWebTokenValidator or JsonWebTokenSignatureValidator beans in their own code are exposed. The built-in bearer, cookie and OpenID flows go through the reactive validator, which has no such cache.

Affected and patched versions

The following ranges cover stable releases.

Release lineAffected versionsFirst patched releaseFix commit
4.x>= 4.8.0, < 4.18.24.18.22a449b26fc
5.0.x–5.4.x>= 5.0.0, < 5.4.25.4.256e62d3616
5.5.x>= 5.5.0, < 5.5.25.5.243a9855342

The fix commits are included in the corresponding release tags and absent from the preceding stable releases (4.18.1, 5.4.1, 5.5.1).

Earliest verified affected stable source: 4.8.0. The class introduces sortedSignaturesMap.computeIfAbsent keyed by the unverified algorithm; the class is absent in v4.7.0.

Suggested severity

Suggested CVSS v3.1 vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L. 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-9WUPS9YC.

Affected versions

References

GitHub · micronaut-projects/micronaut-security