CVE-2024-39316: Rack Denial of Service Vulnerability
MODERATECVE-2024-39316 is a MODERATE (CVSS 6.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Rack libraries in the RubyGems ecosystem. The issue involves rack redos vulnerability in http accept headers parsing. Remediation is available by upgrading affected packages to version 3.1.5.
CVE-2024-39316 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2024-39316
To remediate this vulnerability, upgrade all affected Rack dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade rack to 3.1.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for rack
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-39316, inspect your project dependencies for Rack:
inspect dependencies for rack
Analyze the terminal output to locate any version of Rack in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.5), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Rack, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-39316 Affected Rack Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
rack
|
RubyGems |
≥ 3.1.0
< 3.1.5
|
3.1.5
|
References
Frequently Asked Questions
What is CVE-2024-39316?
Which Rack versions are affected?
What version fixes CVE-2024-39316?
Is rack affected?
What is the CVSS score of CVE-2024-39316?
What CWE is associated with CVE-2024-39316?
How can I check RubyGems dependencies for CVE-2024-39316?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cj83-2ww7-mvq7",
"modified" : "2024-11-05T18:12:49Z",
"published" : "2024-07-03T17:03:45Z",
"aliases" : [ "CVE-2024-39316" ],
"summary" : "Rack ReDoS Vulnerability in HTTP Accept Headers Parsing",
"details" : "### Summary\n\nA 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).\n\n### Details\n\nThe fix for https://github.com/rack/rack/security/advisories/GHSA-54rr-7fvw-6x8f 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "rack"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.1.0"
}, {
"fixed" : "3.1.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/rack/rack/security/advisories/GHSA-54rr-7fvw-6x8f"
}, {
"type" : "WEB",
"url" : "https://github.com/rack/rack/security/advisories/GHSA-cj83-2ww7-mvq7"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-39316"
}, {
"type" : "WEB",
"url" : "https://github.com/rack/rack/commit/412c980450ca729ee37f90a2661f166a9665e058"
}, {
"type" : "WEB",
"url" : "https://advisory.dw1.io/61"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/rack/rack"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2024-39316.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-07-03T17:03:45Z",
"nvd_published_at" : "2024-07-02T16:15:04Z"
}
}