CVE-2025-49007: ReDoS Vulnerability in Rack :Multipart Handle_mime_head Vulnerability

MODERATE
Advisory Identifier: GHSA-47m2-26rw-j2jw
CWE-770
Published
Advisory Summary

CVE-2025-49007 is a MODERATE :multipart handle_mime_head vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting ReDoS Vulnerability in Rack libraries in the RubyGems ecosystem. The issue involves :multipart handle_mime_head. Remediation is available by upgrading affected packages to version 3.1.16.

CVE-2025-49007 at a Glance

CVE Identifier CVE-2025-49007
GHSA Identifier GHSA-47m2-26rw-j2jw
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product ReDoS Vulnerability in Rack
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2025-49007

To remediate this vulnerability, upgrade all affected ReDoS Vulnerability in 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.

rack fixed: 3.1.16
Upgrade rack to 3.1.16
Verify Direct and Transitive Dependencies

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-2025-49007, inspect your project dependencies for ReDoS Vulnerability in Rack:

inspect dependencies for rack

Analyze the terminal output to locate any version of ReDoS Vulnerability in 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.16), 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In ReDoS Vulnerability 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

### Summary There is a denial of service vulnerability in the Content-Disposition parsing component of Rack. This is very similar to the previous security issue CVE-2022-44571. ### Details Carefully crafted input can cause Content-Disposition header parsing in Rack to take an unexpected amount of time, possibly resulting in a denial of service attack vector. This header is used typically used in multipart parsing. Any applications that parse multipart posts using Rack (virtually all Rails applications) are impacted. ### Credits Thanks to [scyoon](https://hackerone.com/scyoon) for reporting this to the Rails security team

CVE-2025-49007 Affected ReDoS Vulnerability in Rack Versions

1 component(s)
Fixed Versions:
3.1.16
Product / Package Ecosystem Affected Versions Fixed Version
rack
RubyGems
≥ 3.1.0
< 3.1.16
3.1.16

References

Frequently Asked Questions

What is CVE-2025-49007?
CVE-2025-49007 is a security vulnerability in ReDoS Vulnerability in Rack involving :Multipart handle_mime_head under CWE-770: Allocation of Resources Without Limits or Throttling.
Which ReDoS Vulnerability in Rack versions are affected?
Affected versions include releases prior to 3.1.16 across affected packages: rack.
What version fixes CVE-2025-49007?
Upgrading to 3.1.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rack affected?
Yes, rack is affected in releases prior to 3.1.16. Upgrade your dependency to 3.1.16 or later.
What CWE is associated with CVE-2025-49007?
CVE-2025-49007 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check RubyGems dependencies for CVE-2025-49007?
Run the dependency tree command: 'inspect dependencies for rack'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-47m2-26rw-j2jw",
  "modified" : "2025-06-05T20:15:06Z",
  "published" : "2025-06-05T05:21:34Z",
  "aliases" : [ "CVE-2025-49007" ],
  "summary" : "ReDoS Vulnerability in Rack::Multipart handle_mime_head",
  "details" : "### Summary\nThere is a denial of service vulnerability in the Content-Disposition parsing component of Rack. This is very similar to the previous security issue CVE-2022-44571.\n\n### Details\n\nCarefully crafted input can cause Content-Disposition header parsing in Rack to take an unexpected amount of time, possibly resulting in a denial of service attack vector. This header is used typically used in multipart parsing. Any applications that parse multipart posts using Rack (virtually all Rails applications) are impacted.\n\n### Credits\n\nThanks to [scyoon](https://hackerone.com/scyoon) for reporting this to the Rails security team",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.1.0"
      }, {
        "fixed" : "3.1.16"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/security/advisories/GHSA-47m2-26rw-j2jw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-49007"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/4795831a0a310c2d31102749e551b38faab6401f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/aed514df37e33907df3c971ed3ca9a0a20ac2901"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rack/rack"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2025-49007.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-05T05:21:34Z",
    "nvd_published_at" : "2025-06-04T23:15:21Z"
  }
}