Skip to content

Commit 2c38ff8

Browse files
jasnowRubySec CI
authored andcommitted
Updated advisory posts against rubysec/ruby-advisory-db@e80dfb0
1 parent 42c5eb9 commit 2c38ff8

File tree

3 files changed

+203
-0
lines changed

3 files changed

+203
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
layout: advisory
3+
title: 'CVE-2025-61770 (rack): Rack''s unbounded multipart preamble buffering enables
4+
DoS (memory exhaustion)'
5+
comments: false
6+
categories:
7+
- rack
8+
advisory:
9+
gem: rack
10+
cve: 2025-61770
11+
ghsa: p543-xpfm-54cp
12+
url: https://github.com/rack/rack/security/advisories/GHSA-p543-xpfm-54cp
13+
title: Rack's unbounded multipart preamble buffering enables DoS (memory exhaustion)
14+
date: 2025-10-07
15+
description: |
16+
## Summary
17+
18+
`Rack::Multipart::Parser` buffers the entire multipart **preamble**
19+
(bytes before the first boundary) in memory without any size limit.
20+
A client can send a large preamble followed by a valid boundary,
21+
causing significant memory use and potential process termination
22+
due to out-of-memory (OOM) conditions.
23+
24+
## Details
25+
26+
While searching for the first boundary, the parser appends incoming
27+
data into a shared buffer (`@sbuf.concat(content)`) and scans for
28+
the boundary pattern:
29+
30+
```ruby
31+
@sbuf.scan_until(@body_regex)
32+
```
33+
34+
If the boundary is not yet found, the parser continues buffering
35+
data indefinitely. There is no trimming or size cap on the preamble,
36+
allowing attackers to send arbitrary amounts of data before the
37+
first boundary.
38+
39+
## Impact
40+
41+
Remote attackers can trigger large transient memory spikes by
42+
including a long preamble in multipart/form-data requests. The
43+
impact scales with allowed request sizes and concurrency, potentially
44+
causing worker crashes or severe slowdown due to garbage collection.
45+
46+
## Mitigation
47+
48+
* **Upgrade:** Use a patched version of Rack that enforces a preamble
49+
size limit (e.g., 16 KiB) or discards preamble data entirely per
50+
[RFC 2046 § 5.1.1](https://www.rfc-editor.org/rfc/rfc2046.html#section-5.1.1).
51+
52+
* **Workarounds:**
53+
* Limit total request body size at the proxy or web server level.
54+
* Monitor memory and set per-process limits to prevent OOM conditions.
55+
cvss_v3: 7.5
56+
patched_versions:
57+
- "~> 2.2.19"
58+
- "~> 3.1.17"
59+
- ">= 3.2.2"
60+
related:
61+
url:
62+
- https://nvd.nist.gov/vuln/detail/CVE-2025-61770
63+
- https://github.com/rack/rack/security/advisories/GHSA-p543-xpfm-54cp
64+
- https://github.com/rack/rack/commit/589127f4ac8b5cf11cf88fb0cd116ffed4d2181e
65+
- https://github.com/rack/rack/commit/d869fed663b113b95a74ad53e1b5cae6ab31f29e
66+
- https://github.com/rack/rack/commit/e08f78c656c9394d6737c022bde087e0f33336fd
67+
- https://github.com/advisories/GHSA-p543-xpfm-54cp
68+
---
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
layout: advisory
3+
title: 'CVE-2025-61771 (rack): Multipart parser buffers large non‑file fields entirely
4+
in memory, enabling DoS (memory exhaustion)'
5+
comments: false
6+
categories:
7+
- rack
8+
advisory:
9+
gem: rack
10+
cve: 2025-61771
11+
ghsa: w9pc-fmgc-vxvw
12+
url: https://github.com/rack/rack/security/advisories/GHSA-w9pc-fmgc-vxvw
13+
title: Multipart parser buffers large non‑file fields entirely in memory, enabling
14+
DoS (memory exhaustion)
15+
date: 2025-10-07
16+
description: |
17+
## Summary
18+
19+
`Rack::Multipart::Parser` stores non-file form fields (parts without
20+
a `filename`) entirely in memory as Ruby `String` objects. A single
21+
large text field in a multipart/form-data request (hundreds of
22+
megabytes or more) can consume equivalent process memory, potentially
23+
leading to out-of-memory (OOM) conditions and denial of service (DoS).
24+
25+
## Details
26+
27+
During multipart parsing, file parts are streamed to temporary files,
28+
but non-file parts are buffered into memory:
29+
30+
```ruby
31+
body = String.new # non-file → in-RAM buffer
32+
@mime_parts[mime_index].body << content
33+
```
34+
35+
There is no size limit on these in-memory buffers. As a result, any
36+
large text field—while technically valid—will be loaded fully into
37+
process memory before being added to `params`.
38+
39+
## Impact
40+
41+
Attackers can send large non-file fields to trigger excessive memory
42+
usage. Impact scales with request size and concurrency, potentially
43+
leading to worker crashes or severe garbage-collection overhead. All
44+
Rack applications processing multipart form submissions are affected.
45+
46+
## Mitigation
47+
48+
* **Upgrade:** Use a patched version of Rack that enforces a
49+
reasonable size cap for non-file fields (e.g., 2 MiB).
50+
51+
* **Workarounds:**
52+
* Restrict maximum request body size at the web-server or proxy
53+
layer (e.g., Nginx `client_max_body_size`).
54+
* Validate and reject unusually large form fields at the application level.
55+
cvss_v3: 7.5
56+
patched_versions:
57+
- "~> 2.2.19"
58+
- "~> 3.1.17"
59+
- ">= 3.2.2"
60+
related:
61+
url:
62+
- https://nvd.nist.gov/vuln/detail/CVE-2025-61771
63+
- https://github.com/rack/rack/security/advisories/GHSA-w9pc-fmgc-vxvw
64+
- https://github.com/rack/rack/commit/589127f4ac8b5cf11cf88fb0cd116ffed4d2181e
65+
- https://github.com/rack/rack/commit/d869fed663b113b95a74ad53e1b5cae6ab31f29e
66+
- https://github.com/rack/rack/commit/e08f78c656c9394d6737c022bde087e0f33336fd
67+
- https://github.com/advisories/GHSA-w9pc-fmgc-vxvw
68+
---
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
layout: advisory
3+
title: 'CVE-2025-61772 (rack): Rack''s multipart parser buffers unbounded per-part
4+
headers, enabling DoS (memory exhaustion)'
5+
comments: false
6+
categories:
7+
- rack
8+
advisory:
9+
gem: rack
10+
cve: 2025-61772
11+
ghsa: wpv5-97wm-hp9c
12+
url: https://github.com/rack/rack/security/advisories/GHSA-wpv5-97wm-hp9c
13+
title: Rack's multipart parser buffers unbounded per-part headers, enabling DoS
14+
(memory exhaustion)
15+
date: 2025-10-07
16+
description: |
17+
## Summary
18+
19+
`Rack::Multipart::Parser` can accumulate unbounded data when a
20+
multipart part’s header block never terminates with the required
21+
blank line (`CRLFCRLF`). The parser keeps appending incoming bytes
22+
to memory without a size cap, allowing a remote attacker to exhaust
23+
memory and cause a denial of service (DoS).
24+
25+
## Details
26+
27+
While reading multipart headers, the parser waits for `CRLFCRLF` using:
28+
29+
```ruby
30+
@sbuf.scan_until(/(.*?\r
31+
)\r
32+
/m)
33+
```
34+
35+
If the terminator never appears, it continues appending data
36+
(`@sbuf.concat(content)`) indefinitely. There is no limit on
37+
accumulated header bytes, so a single malformed part can consume
38+
memory proportional to the request body size.
39+
40+
## Impact
41+
42+
Attackers can send incomplete multipart headers to trigger high memory
43+
use, leading to process termination (OOM) or severe slowdown. The
44+
effect scales with request size limits and concurrency. All
45+
applications handling multipart uploads may be affected.
46+
47+
## Mitigation
48+
49+
* Upgrade to a patched Rack version that caps per-part header size
50+
(e.g., 64 KiB).
51+
52+
* Until then, restrict maximum request sizes at the proxy or web
53+
server layer (e.g., Nginx `client_max_body_size`).
54+
cvss_v3: 7.5
55+
patched_versions:
56+
- "~> 2.2.19"
57+
- "~> 3.1.17"
58+
- ">= 3.2.2"
59+
related:
60+
url:
61+
- https://nvd.nist.gov/vuln/detail/CVE-2025-61772
62+
- https://github.com/rack/rack/security/advisories/GHSA-wpv5-97wm-hp9c
63+
- https://github.com/rack/rack/commit/589127f4ac8b5cf11cf88fb0cd116ffed4d2181e
64+
- https://github.com/rack/rack/commit/d869fed663b113b95a74ad53e1b5cae6ab31f29e
65+
- https://github.com/rack/rack/commit/e08f78c656c9394d6737c022bde087e0f33336fd
66+
- https://github.com/advisories/GHSA-wpv5-97wm-hp9c
67+
---

0 commit comments

Comments
 (0)