GHSA-mh63-6h87-95cp

Suggest an improvement
Source
https://github.com/advisories/GHSA-mh63-6h87-95cp
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/03/GHSA-mh63-6h87-95cp/GHSA-mh63-6h87-95cp.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-mh63-6h87-95cp
Aliases
Published
2025-03-21T22:04:00Z
Modified
2025-03-24T14:31:07Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
  • 8.7 (High) CVSS_V4 - 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 CVSS Calculator
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

Database specific
{
    "nvd_published_at": "2025-03-21T22:15:26Z",
    "cwe_ids": [
        "CWE-405"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2025-03-21T22:04:00Z"
}
References

Affected packages

Go / github.com/golang-jwt/jwt/v5

Package

Name
github.com/golang-jwt/jwt/v5
View open source insights on deps.dev
Purl
pkg:golang/github.com/golang-jwt/jwt/v5

Affected ranges

Type
SEMVER
Events
Introduced
5.0.0-rc.1
Fixed
5.2.2

Go / github.com/golang-jwt/jwt/v4

Package

Name
github.com/golang-jwt/jwt/v4
View open source insights on deps.dev
Purl
pkg:golang/github.com/golang-jwt/jwt/v4

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
4.5.2