Vulnerabilities in pkg:golang/github.com/golang-jwt/jwt/v5
PACKAGECVE-2025-30204 is a HIGH (CVSS 7.5) jwt-go allows excessive memory allocation vulnerability (CWE-405: Asymmetric Resource Consumption (Amplification)) affecting Github.com/golang jwt/jwt/v5 libraries in the Go ecosystem. The issue involves jwt-go allows excessive memory allocation during header parsing. Remediation is available by upgrading affected packages to version 5.2.2, 4.5.2.
pkg:golang/github.com/golang-jwt/jwt/v5
Vulnerability advisories affecting package pkg:golang/github.com/golang-jwt/jwt/v5. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-mh63-6h87-95cp | CVE-2025-30204 | HIGH | jwt-go allows excessive memory allocation during header parsing |
CVE-2025-30204 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2025-30204
To remediate this vulnerability, upgrade all affected Github.com/golang jwt/jwt/v5 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/golang-jwt/jwt/v5 to 5.2.2
Upgrade github.com/golang-jwt/jwt/v4 to 4.5.2
Upgrade github.com/golang-jwt/jwt to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/golang-jwt/jwt/v5
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-30204, inspect your project dependencies for Github.com/golang jwt/jwt/v5:
inspect dependencies for github.com/golang-jwt/jwt/v5
Analyze the terminal output to locate any version of Github.com/golang jwt/jwt/v5 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.2.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-405: Asymmetric Resource Consumption (Amplification), where the product does not properly control situations in which an adversary can cause the product to consume or produce excessive resources without requiring the adversary to invest equivalent work or otherwise prove authorization, i.e., the adversary's influence is "asymmetric.". In Github.com/golang jwt/jwt/v5, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-30204 Affected Github.com/golang jwt/jwt/v5 Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/golang-jwt/jwt/v5
|
Go |
≥ 5.0.0-rc.1
< 5.2.2
|
5.2.2
|
|
github.com/golang-jwt/jwt/v4
|
Go |
< 4.5.2
|
4.5.2
|
|
github.com/golang-jwt/jwt
|
Go |
≥ 3.2.0
≤ 3.2.2
|
|
References
Frequently Asked Questions
What is CVE-2025-30204?
Which Github.com/golang jwt/jwt/v5 versions are affected?
What version fixes CVE-2025-30204?
Is github.com/golang-jwt/jwt/v5 affected?
Is github.com/golang-jwt/jwt/v4 affected?
What is the CVSS score of CVE-2025-30204?
What CWE is associated with CVE-2025-30204?
How can I check Go dependencies for CVE-2025-30204?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mh63-6h87-95cp",
"modified" : "2025-04-10T13:02:34Z",
"published" : "2025-03-21T22:04:00Z",
"aliases" : [ "CVE-2025-30204" ],
"summary" : "jwt-go allows excessive memory allocation during header parsing",
"details" : "### Summary\n\nFunction [`parse.ParseUnverified`](https://github.com/golang-jwt/jwt/blob/c035977d9e11c351f4c05dfeae193923cbab49ee/parser.go#L138-L139) currently splits (via a call to [strings.Split](https://pkg.go.dev/strings#Split)) its argument (which is untrusted data) on periods.\n\nAs 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)](https://cwe.mitre.org/data/definitions/405.html)\n\n### Details\n\nSee [`parse.ParseUnverified`](https://github.com/golang-jwt/jwt/blob/c035977d9e11c351f4c05dfeae193923cbab49ee/parser.go#L138-L139) \n\n### Impact\n\nExcessive memory allocation",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/golang-jwt/jwt/v5"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.0.0-rc.1"
}, {
"fixed" : "5.2.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/golang-jwt/jwt/v4"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.5.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/golang-jwt/jwt"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.2.0"
}, {
"last_affected" : "3.2.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/golang-jwt/jwt/security/advisories/GHSA-mh63-6h87-95cp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-30204"
}, {
"type" : "WEB",
"url" : "https://github.com/golang-jwt/jwt/commit/0951d184286dece21f73c85673fd308786ffe9c3"
}, {
"type" : "WEB",
"url" : "https://github.com/golang-jwt/jwt/commit/bf316c48137a1212f8d0af9288cc9ce8e59f1afb"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/golang-jwt/jwt"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20250404-0002"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-405" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-03-21T22:04:00Z",
"nvd_published_at" : "2025-03-21T22:15:26Z"
}
}