CVE-2023-22792

7.5 HIGH

📋 TL;DR

This CVE describes a ReDoS (Regular Expression Denial of Service) vulnerability in Ruby on Rails Action Dispatch. Attackers can cause excessive CPU and memory usage by sending specially crafted cookies and X-Forwarded-Host headers, potentially leading to service disruption. All Ruby on Rails applications using affected versions are vulnerable.

💻 Affected Systems

Products:
  • Ruby on Rails Action Dispatch
Versions: Action Dispatch <6.0.6.1, <6.1.7.1, and <7.0.4.1
Operating Systems: All operating systems running Ruby on Rails
Default Config Vulnerable: ⚠️ Yes
Notes: All Ruby on Rails applications using the default cookie parsing and header processing are affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service unavailability due to resource exhaustion, affecting all users of the application.

🟠

Likely Case

Degraded performance and intermittent service disruptions during attack periods.

🟢

If Mitigated

Minimal impact with proper rate limiting, WAF rules, and updated versions.

🌐 Internet-Facing: HIGH - Attack can be performed remotely without authentication.
🏢 Internal Only: MEDIUM - Requires internal network access but still exploitable.

🎯 Exploit Status

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

Exploitation requires sending specific cookie and header combinations but is straightforward once the pattern is known.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.0.6.1, 6.1.7.1, or 7.0.4.1

Vendor Advisory: https://discuss.rubyonrails.org/t/cve-2023-22792-possible-redos-based-dos-vulnerability-in-action-dispatch/82115

Restart Required: Yes

Instructions:

1. Update Gemfile to specify patched version. 2. Run 'bundle update actionpack'. 3. Restart the Rails application server.

🔧 Temporary Workarounds

Rate Limiting

all

Implement rate limiting on requests to mitigate DoS impact

WAF Rules

all

Configure WAF to block requests with suspicious X-Forwarded-Host headers

🧯 If You Can't Patch

  • Implement strict input validation for X-Forwarded-Host headers
  • Deploy application-level rate limiting and monitoring for abnormal CPU usage

🔍 How to Verify

Check if Vulnerable:

Check Gemfile.lock for actionpack version: grep -i actionpack Gemfile.lock

Check Version:

bundle show actionpack

Verify Fix Applied:

Verify actionpack version is 6.0.6.1, 6.1.7.1, or 7.0.4.1 or higher

📡 Detection & Monitoring

Log Indicators:

  • High CPU usage spikes
  • Requests with malformed X-Forwarded-Host headers
  • Slow response times

Network Indicators:

  • Multiple requests with similar cookie/header patterns
  • Abnormal request rates

SIEM Query:

source="rails.log" AND ("CPU" OR "slow" OR "timeout") AND "X-Forwarded-Host"

🔗 References

📤 Share & Export