CVE-2025-30204: jwt-go allows excessive memory allocation during header parsing

Published Mar 21, 2025
·
Updated

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

Other sources

golang-jwt is a Go implementation of JSON Web Tokens. Prior to 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.

Red Hat

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.

NVD

Affected Software

6 affected componentsFixes available
golang-jwt golang-jwt<5.2.2
jwt-go jwt-go<4.5.2
go/github.com/golang-jwt/jwt>=3.2.0<=3.2.2
go/github.com/golang-jwt/jwt/v4<4.5.2
4.5.2
go/github.com/golang-jwt/jwt/v5>=5.0.0-rc.1<5.2.2
5.2.2
IBM Concert Software<=1.0.0-1.1.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/golang-jwt/jwt/v4 to a version that resolves this vulnerability.

    Fixed in 4.5.2
  2. Upgrade

    Upgrade go/github.com/golang-jwt/jwt/v5 to a version that resolves this vulnerability.

    Fixed in 5.2.2
  3. Upgrade

    Upgrade golang-jwt/jwt (parse.ParseUnverified) to a version that resolves this vulnerability.

    Fixed in 5.2.2
  4. Upgrade

    Upgrade golang-jwt/jwt (parse.ParseUnverified) to a version that resolves this vulnerability.

    Fixed in 4.5.2

Event History

Mar 21, 2025
CVE Published
via MITRE·09:42 PM
Data Sourced
via MITRE·09:42 PM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·10:01 PM
DescriptionSeverityAffected Software
Advisory Published
via GitHub·10:04 PM
Data Sourced
via NVD·10:15 PM
DescriptionSeverityWeakness
Sep 8, 2025
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-30204?

The severity of CVE-2025-30204 is considered high due to the potential for parsing attacks with untrusted data.

2

How do I fix CVE-2025-30204?

To fix CVE-2025-30204, upgrade to golang-jwt version 5.2.2 or jwt-go version 4.5.2 or later.

3

What systems are affected by CVE-2025-30204?

CVE-2025-30204 affects golang-jwt versions up to 5.2.2 and jwt-go versions up to 4.5.2.

4

What type of vulnerability is CVE-2025-30204?

CVE-2025-30204 is a parsing vulnerability related to the improper handling of untrusted data in JSON Web Tokens.

5

How can I determine if my application is vulnerable to CVE-2025-30204?

Check your application dependencies to see if you are using golang-jwt versions prior to 5.2.2 or jwt-go versions prior to 4.5.2.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203