CVE-2025-30204

7.5 HIGH

📋 TL;DR

This vulnerability in golang-jwt allows attackers to cause denial of service through resource exhaustion by sending malicious JWT tokens with many period characters. The parse.ParseUnverified function allocates excessive memory when processing these tokens, potentially crashing affected services. Any Go application using vulnerable versions of golang-jwt for JWT parsing is affected.

💻 Affected Systems

Products:
  • golang-jwt/jwt library
Versions: 3.2.0 to 5.2.1, and 4.0.0 to 4.5.1
Operating Systems: All operating systems running Go applications
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using parse.ParseUnverified function with untrusted input is vulnerable. The vulnerability is in the library itself, not dependent on specific configurations.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Service crashes due to memory exhaustion, leading to complete denial of service and potential service unavailability.

🟠

Likely Case

Degraded performance and increased memory usage, potentially causing intermittent service disruptions.

🟢

If Mitigated

Minimal impact with proper rate limiting and input validation in place.

🌐 Internet-Facing: HIGH - Internet-facing services accepting JWT tokens are directly exposed to malicious requests.
🏢 Internal Only: MEDIUM - Internal services could be targeted by authenticated users or compromised internal systems.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending specially crafted JWT tokens. No authentication needed if the service accepts external JWT tokens.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 5.2.2 or 4.5.2

Vendor Advisory: https://github.com/golang-jwt/jwt/security/advisories/GHSA-mh63-6h87-95cp

Restart Required: Yes

Instructions:

1. Update go.mod to require golang-jwt/jwt v5.2.2 or v4.5.2
2. Run 'go mod tidy'
3. Rebuild and redeploy your application
4. Restart affected services

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement input validation to reject JWT tokens with excessive periods before they reach parse.ParseUnverified

// Go code example: if strings.Count(token, ".") > 2 { return error }

Rate Limiting

all

Implement rate limiting on authentication endpoints to limit impact of repeated malicious requests

🧯 If You Can't Patch

  • Implement WAF rules to block requests with Authorization headers containing excessive period characters
  • Deploy reverse proxy with request size limits and input validation before requests reach vulnerable services

🔍 How to Verify

Check if Vulnerable:

Check go.mod or go.sum for golang-jwt/jwt version. Vulnerable if version >=3.2.0 and <5.2.2, or >=4.0.0 and <4.5.2

Check Version:

go list -m all | grep golang-jwt/jwt

Verify Fix Applied:

Verify go.mod requires golang-jwt/jwt v5.2.2+ or v4.5.2+. Run 'go list -m all | grep jwt' to confirm version

📡 Detection & Monitoring

Log Indicators:

  • High memory usage spikes
  • Application crashes or restarts
  • Multiple failed authentication attempts with similar patterns

Network Indicators:

  • HTTP requests with Authorization headers containing many period characters
  • Unusually large Authorization headers

SIEM Query:

source="application_logs" AND ("out of memory" OR "panic" OR "crash") AND process="your_app_name"

🔗 References

📤 Share & Export