Skip to content

GHSA-mh63-6h87-95cp CVE-2025-30204 GO-2025-3553

jwt-go allows excessive memory allocation during header parsing

High Go
Severity
0.0 / 10
High · CVSS 4.0
Exploit chance (EPSS)
0.81%
Chance of exploitation in the next 30 days. Higher than 56.96% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-405 Asymmetric Resource Consumption (Amplification)
Fix
Available
2 packages have a fixed version

Description

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

Affected versions

Go

PackageVulnerableFixed in
github.com/golang-jwt/jwt
>= 3.2.0, <= 3.2.2
No fix yet
github.com/golang-jwt/jwt
all versions
No fix yet
github.com/golang-jwt/jwt/v4
< 4.5.2
4.5.2
github.com/golang-jwt/jwt/v5
>= 5.0.0-rc.1, < 5.2.2
5.2.2

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

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

go
go get github.com/golang-jwt/jwt/v4@v4.5.2 && go mod tidy

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

go
go get github.com/golang-jwt/jwt/v5@v5.2.2 && go mod tidy

Severity breakdown

CVSS 4.0 0.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

Attack vector
Network
Attack complexity
Low
Attack requirements
None
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
None
Integrity (vulnerable system)
None
Availability (vulnerable system)
High
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

CVSS 3.1 7.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Weakness

CWE-405: Asymmetric Resource Consumption (Amplification)

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."

How to prevent it
  • Architecture and Design: An application must make resources available to a client commensurate with the client's access level.
  • Architecture and Design: An application must, at all times, keep track of allocated resources and meter their usage appropriately.
  • System Configuration: Consider disabling resource-intensive algorithms on the server side, such as Diffie-Hellman key exchange.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-29wx-vh33-7x7r
Bad documentation of error handling in ParseWithClaims can lead to potentially dangerous situations
Low Also affects github.com/golang-jwt/jwt/v4
GHSA-4vqv-7265-gm2w
pypdf has possible large memory usage for exceptions in strict mode
High Same weakness, CWE-405
GHSA-g3hv-75wg-m249
minimatch has potential denial of service via globparts amplification
Medium Same weakness, CWE-405
GHSA-9fm3-97px-rjf6
undici WebSocket client vulnerable to Denial of Service via unbounded automatic PONG buffering
High Same weakness, CWE-405
GHSA-7hqp-7c5m-4vq6
Microsoft Security Advisory CVE-2026-96960 - .NET and Visual Studio Denial of Service Vulnerability
High Same weakness, CWE-405
GO-2026-6607
Reject malformed ECH outer extension references in crypto/tls
High Same weakness, CWE-405
GO-2026-6611
Excessive CPU consumption from repeated initial window changes in net/http
High Same weakness, CWE-405
GO-2026-6603
HTTP/2 server memory exhaustion due to Trailer headers in net/http
High Same weakness, CWE-405
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor