Loading...
Skip to main content

CVE-2025-61770

HIGH

Rack's unbounded multipart preamble buffering enables DoS (memory exhaustion)

Published October 7, 2025Updated February 4, 2026Source: osv

Summary

## Summary `Rack::Multipart::Parser` buffers the entire multipart **preamble** (bytes before the first boundary) in memory without any size limit. A client can send a large preamble followed by a valid boundary, causing significant memory use and potential process termination due to out-of-memory (OOM) conditions. ## Details While searching for the first boundary, the parser appends incoming data into a shared buffer (`@sbuf.concat(content)`) and scans for the boundary pattern: ```ruby @sbuf.scan_until(@body_regex) ``` If the boundary is not yet found, the parser continues buffering data indefinitely. There is no trimming or size cap on the preamble, allowing attackers to send arbitrary amounts of data before the first boundary. ## Impact Remote attackers can trigger large transient memory spikes by including a long preamble in multipart/form-data requests. The impact scales with allowed request sizes and concurrency, potentially causing worker crashes or severe slowdown due to garbage collection. ## Mitigation * **Upgrade:** Use a patched version of Rack that enforces a preamble size limit (e.g., 16 KiB) or discards preamble data entirely per [RFC 2046 § 5.1.1](https://www.rfc-editor.org/rfc/rfc2046.html#section-5.1.1). * **Workarounds:** * Limit total request body size at the proxy or web server level. * Monitor memory and set per-process limits to prevent OOM conditions.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update rack to 2.2.19 or later
gem install rack -v 2.2.19
Bundler
Update rack to 3.1.17 or later
gem install rack -v 3.1.17
Bundler
Update rack to 3.2.2 or later
gem install rack -v 3.2.2

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (3)

PackageEcosystemAffectedFixed In
rack
rubygems
0.1.0, 0.2.0, 0.3.0, 0.4.0 (+115 more)2.2.19
rack
rubygems
3.1.0, 3.1.1, 3.1.10, 3.1.11 (+13 more)3.1.17
rack
rubygems
3.2.0, 3.2.13.2.2

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-400
    Uncontrolled Resource ConsumptionMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Frequently Asked Questions

What is CVE-2025-61770?
Rack's unbounded multipart preamble buffering enables DoS (memory exhaustion) This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2025-61770?
CVE-2025-61770 affects rack. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-61770 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-p543-xpfm-54cp

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies