Advisory

GHSA-mh63-6h87-95cp

Also known as: CVE-2025-30204, GO-2025-3553

Summary

jwt-go allows excessive memory allocation during header parsing

Details

Summary

Function `parse.ParseUnverified` currently splits (via a call to strings.Split) its argument (which is untrusted data) on periods.

As a result, in the face of a malicious request whose _Authorization_ header consists of Bearer followed by many period characters, a call to that function incurs allocations to the tune of O(n) bytes (where n stands for the length of the function's argument), with a constant factor of about 16. Relevant weakness: CWE-405: Asymmetric Resource Consumption (Amplification)

Details

See `parse.ParseUnverified`

Impact

Excessive memory allocation

Severity

High Basis: The source's own band: HIGH

Dates

Published
2025-03-21 22:04 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

github.com/golang-jwt/jwt/v5

Go · All systems

Affected

  • introduced 5.0.0-rc.1, fixed 5.2.2 (semver)

Fixed versions

5.2.2

Fix

github.com/golang-jwt/jwt/v4

Go · All systems

Affected

  • introduced 0, fixed 4.5.2 (semver)

Fixed versions

4.5.2

Fix

github.com/golang-jwt/jwt

Go · All systems

Affected

  • introduced 3.2.0, last affected 3.2.2 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences