CVE-2025-65637

7.5 HIGH

📋 TL;DR

A denial-of-service vulnerability in the logrus logging library allows attackers to crash applications by logging single-line payloads larger than 64KB without newline characters. This affects applications using Entry.Writer() in vulnerable versions, causing the writer pipe to close and making logging unavailable. The vulnerability impacts all applications using affected logrus versions in their Go projects.

💻 Affected Systems

Products:
  • github.com/sirupsen/logrus
Versions: Versions < 1.8.3, 1.9.0, and 1.9.2
Operating Systems: All operating systems running Go applications
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using Entry.Writer() method with large single-line payloads. Standard logging methods are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Application becomes completely unavailable due to logging subsystem failure, requiring restart to recover functionality.

🟠

Likely Case

Application logging stops working, potentially causing cascading failures in dependent systems or making debugging impossible.

🟢

If Mitigated

Application continues to function with degraded logging capability, but core functionality remains operational.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: LOW

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires ability to control log input content. Public proof-of-concept demonstrates reliable DoS.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.8.3, 1.9.1, or 1.9.3+

Vendor Advisory: https://github.com/sirupsen/logrus/releases/tag/v1.8.3

Restart Required: Yes

Instructions:

1. Update go.mod to require logrus >= 1.8.3, 1.9.1, or >= 1.9.3. 2. Run 'go mod tidy'. 3. Rebuild and redeploy application. 4. Restart all affected services.

🔧 Temporary Workarounds

Input validation and truncation

all

Add middleware or wrapper to validate and truncate log entries before passing to Entry.Writer()

// Go code example: if len(logEntry) > 65535 { logEntry = logEntry[:65535] }

Avoid Entry.Writer() for untrusted input

all

Use alternative logging methods that don't use Entry.Writer() for user-controlled content

// Use logrus.StandardLogger() or direct logging methods instead

🧯 If You Can't Patch

  • Implement strict input validation to reject log entries larger than 64KB
  • Deploy application behind WAF with payload size limits and anomaly detection

🔍 How to Verify

Check if Vulnerable:

Check go.mod or vendor directory for logrus version. Run: grep -r 'sirupsen/logrus' go.mod

Check Version:

go list -m github.com/sirupsen/logrus

Verify Fix Applied:

Verify updated version in go.mod and test logging with large single-line payloads

📡 Detection & Monitoring

Log Indicators:

  • 'token too long' errors in application logs
  • Sudden cessation of logging output
  • Application crashes or restarts

Network Indicators:

  • Unusual large payloads to logging endpoints
  • Increased error rates in monitoring

SIEM Query:

source="application.logs" AND ("token too long" OR "bufio.Scanner: token too long")

🔗 References

📤 Share & Export