7.5high
Rack's unbounded multipart preamble buffering enables DoS (memory exhaustion)
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.98% (higher than 63% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-p543-xpfm-54cp
Description
Rack is a modular Ruby web server interface. In versions prior to 2.2.19, 3.1.17, and 3.2.2, `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. 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. Versions 2.2.19, 3.1.17, and 3.2.2 enforce a preamble size limit (e.g., 16 KiB) or discard preamble data entirely. Workarounds include limiting total request body size at the proxy or web server level and monitoring memory and set per-process limits to prevent OOM conditions.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| rack rack | < 2.2.19, >= 3.1, < 3.1.17, >= 3.2, < 3.2.2, before 2.2.19, from 3.1.0 before 3.1.17, from 3.2.0 before 3.2.2 | CVE List, NVD |
| rack (RubyGems) | before 2.2.19, from 3.1 before 3.1.17, from 3.2 before 3.2.2 | GitHub Advisory Database |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
Rack is a modular Ruby web server interface. In versions prior to 2.2.19, 3.1.17, and 3.2.2, `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. 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. Versions 2.2.19, 3.1.17, and 3.2.2 enforce a preamble size limit (e.g., 16 KiB) or discard preamble data entirely. Workarounds include limiting total request body size at the proxy or web server level and monitoring memory and set per-process limits to prevent OOM conditions.
GitHub Advisory Database
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:
@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.
- Workarounds:
- Limit total request body size at the proxy or web server level.
- Monitor memory and set per-process limits to prevent OOM conditions.
NVD (es)
Rack es una interfaz modular de servidor web Ruby. En versiones anteriores a 2.2.19, 3.1.17 y 3.2.2, 'Rack::Multipart::Parser' almacena en búfer el preámbulo multipart completo (bytes antes del primer límite) en memoria sin ningún límite de tamaño. Un cliente puede enviar un preámbulo grande seguido de un límite válido, causando un uso significativo de memoria y una posible terminación del proceso debido a condiciones de falta de memoria (OOM). Atacantes remotos pueden desencadenar grandes picos transitorios de memoria al incluir un preámbulo largo en solicitudes multipart/form-data. El impacto escala con los tamaños de solicitud permitidos y la concurrencia, causando potencialmente caídas de workers o una desaceleración severa debido a la recolección de basura. Las versiones 2.2.19, 3.1.17 y 3.2.2 imponen un límite de tamaño de preámbulo (p. ej., 16 KiB) o descartan los datos del preámbulo por completo. Las soluciones incluyen limitar el tamaño total del cuerpo de la solicitud a nivel de proxy o servidor web y monitorear la memoria y establecer límites por proceso para prevenir condiciones OOM.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-61770 changed 2025-10-07 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-p543-xpfm-54cp changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2025-61770 changed 2026-10-19 | Public domain |