CVE-2024-39316

6.5 MEDIUM

📋 TL;DR

This CVE describes a Regular Expression Denial of Service (ReDoS) vulnerability in Rack's HTTP Accept header parsing. Attackers can send specially crafted Accept-Encoding or Accept-Language headers to cause excessive server processing time, leading to denial of service. Users of Rack versions 3.1.0 through 3.1.4 are affected.

💻 Affected Systems

Products:
  • Rack
Versions: 3.1.0 through 3.1.4
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects Rack 3.1.x series; Rack 3.0.x was previously fixed in CVE-2024-26146.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service unavailability due to CPU exhaustion from malicious requests, potentially affecting all users of the vulnerable application.

🟠

Likely Case

Degraded performance and intermittent service disruptions for legitimate users when attackers send crafted headers.

🟢

If Mitigated

Minimal impact with proper rate limiting, request filtering, and monitoring in place to detect and block malicious patterns.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires sending HTTP requests with malicious Accept headers; no authentication needed.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.1.5

Vendor Advisory: https://github.com/rack/rack/security/advisories/GHSA-54rr-7fvw-6x8f

Restart Required: Yes

Instructions:

1. Update Gemfile to specify 'rack', '~> 3.1.5' 2. Run 'bundle update rack' 3. Restart the application server

🔧 Temporary Workarounds

Request Header Filtering

all

Filter or reject requests with suspicious Accept-Encoding or Accept-Language headers at the web server or application firewall level.

Rate Limiting

all

Implement rate limiting on HTTP requests to mitigate DoS impact.

🧯 If You Can't Patch

  • Implement WAF rules to block requests with malformed Accept headers
  • Deploy additional monitoring for CPU spikes and unusual request patterns

🔍 How to Verify

Check if Vulnerable:

Check Rack version in Gemfile.lock or via 'bundle show rack' command.

Check Version:

bundle show rack | grep rack

Verify Fix Applied:

Confirm Rack version is 3.1.5 or higher after update.

📡 Detection & Monitoring

Log Indicators:

  • Requests with unusually long Accept-Encoding or Accept-Language headers
  • Increased CPU usage on web servers

Network Indicators:

  • HTTP requests containing crafted Accept headers with repetitive patterns

SIEM Query:

source="web_server_logs" AND (header="Accept-Encoding" OR header="Accept-Language") AND length(value) > 500

🔗 References

📤 Share & Export