CVE-2025-30204
jwt-go allows excessive memory allocation during header parsing
Also known as GHSA-mh63-6h87-95cp, GO-2025-3553
Mitigation
- Upgrade github.com/golang-jwt/jwt/v5 to 5.2.2 or later.
- Upgrade github.com/golang-jwt/jwt/v4 to 4.5.2 or later.
Who should check
- Projects that depend on Go package github.com/golang-jwt/jwt/v5 (>= 5.0.0-rc.1, < 5.2.2)
- Projects that depend on Go package github.com/golang-jwt/jwt/v4 (< 4.5.2)
- Projects that depend on Go package github.com/golang-jwt/jwt (>= 3.2.0, <= 3.2.2)
- Anyone running golang-jwt jwt >= 3.2.0, < 4.5.2; >= 5.0.0-rc.1, < 5.2.2
Vulnerability facts
- Affected
- github.com/golang-jwt/jwt/v5 >= 5.0.0-rc.1, < 5.2.2; github.com/golang-jwt/jwt/v4 < 4.5.2; github.com/golang-jwt/jwt >= 3.2.0, <= 3.2.2
- Fixed in
- 5.2.2, 4.5.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 7.5 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: None
- Availability impact: High
- EPSS
- 1.09% chance of exploitation in 30 days (percentile 65, 2026-11-26)
- CWE
- CWE-405
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Go github.com/golang-jwt/jwt/v5 | >= 5.0.0-rc.1, < 5.2.2 | 5.2.2 | osv |
| Go github.com/golang-jwt/jwt/v4 | < 4.5.2 | 4.5.2 | osv |
| Go github.com/golang-jwt/jwt | >= 3.2.0, <= 3.2.2 | — | osv |
| golang-jwt jwt | >= 3.2.0, < 4.5.2; >= 5.0.0-rc.1, < 5.2.2 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2025-30204. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2025-30204.md Affected: github.com/golang-jwt/jwt/v5 >= 5.0.0-rc.1, < 5.2.2; github.com/golang-jwt/jwt/v4 < 4.5.2; github.com/golang-jwt/jwt >= 3.2.0, <= 3.2.2 Fixed in: 5.2.2, 4.5.2 Steps: 1. Search this machine and project for github.com/golang-jwt/jwt/v5 (Go), github.com/golang-jwt/jwt/v4 (Go), github.com/golang-jwt/jwt (Go), golang-jwt jwt: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
FAQ
Is CVE-2025-30204 being exploited?
There is no confirmed exploitation: CVE-2025-30204 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.09% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2025-30204?
High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2025-30204?
github.com/golang-jwt/jwt/v5 >= 5.0.0-rc.1, < 5.2.2; github.com/golang-jwt/jwt/v4 < 4.5.2; github.com/golang-jwt/jwt >= 3.2.0, <= 3.2.2.
Is there a fix for CVE-2025-30204?
Yes. Fixed in 5.2.2, 4.5.2. Upgrade github.com/golang-jwt/jwt/v5 to 5.2.2 or later. Upgrade github.com/golang-jwt/jwt/v4 to 4.5.2 or later.
How do I check if I'm affected by CVE-2025-30204?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.