CVE-2025-30204
Excessive memory allocation during header parsing in github.com/golang-jwt/jwt
Description
golang-jwt is a Go implementation of JSON Web Tokens. Starting in version 3.2.0 and prior to versions 5.2.2 and 4.5.2, the function parse.ParseUnverified 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. This issue is fixed in 5.2.2 and 4.5.2.
How to fix CVE-2025-30204
To remediate CVE-2025-30204, upgrade the affected package to a fixed version below.
- —no fix listed
- —upgrade to 5.2.2-1 or later
- —no fix listed
- —no fix listed
- —upgrade to 4.5.2 or later
- —upgrade to 4.5.2 or later
- —upgrade to 5.2.2 or later
- —upgrade to 5.2.2 or later
Is CVE-2025-30204 being exploited?
Low — EPSS is 0.1%, meaning exploitation activity has not been observed at scale.
Affected packages (8)
- from 0
- from 0, < 5.2.2-1
- >= 3.2.0, <= 3.2.2
- from 0
- from 0, < 4.5.2
- from 0, < 4.5.2
- >= 5.0.0-rc.1, < 5.2.2
- >= 5.0.0-rc.1, < 5.2.2
CVSS scores
| Source | Version | Severity | Vector |
|---|---|---|---|
| osv | CVSS 4.0 | — | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| osv | CVSS 3.1 | HIGH7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |