Skip to content

Commit 4a0e8b8

Browse files
committed
GHSA SYNC: 3 brand new advisories
1 parent 3a44bb3 commit 4a0e8b8

File tree

3 files changed

+180
-0
lines changed

3 files changed

+180
-0
lines changed

gems/rack/CVE-2025-61770.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
gem: rack
3+
cve: 2025-61770
4+
ghsa: p543-xpfm-54cp
5+
url: https://github.com/rack/rack/security/advisories/GHSA-p543-xpfm-54cp
6+
title: Rack's unbounded multipart preamble buffering enables
7+
DoS (memory exhaustion)
8+
date: 2025-10-07
9+
description: |
10+
## Summary
11+
12+
`Rack::Multipart::Parser` buffers the entire multipart **preamble**
13+
(bytes before the first boundary) in memory without any size limit.
14+
A client can send a large preamble followed by a valid boundary,
15+
causing significant memory use and potential process termination
16+
due to out-of-memory (OOM) conditions.
17+
18+
## Details
19+
20+
While searching for the first boundary, the parser appends incoming
21+
data into a shared buffer (`@sbuf.concat(content)`) and scans for
22+
the boundary pattern:
23+
24+
```ruby
25+
@sbuf.scan_until(@body_regex)
26+
```
27+
28+
If the boundary is not yet found, the parser continues buffering
29+
data indefinitely. There is no trimming or size cap on the preamble,
30+
allowing attackers to send arbitrary amounts of data before the
31+
first boundary.
32+
33+
## Impact
34+
35+
Remote attackers can trigger large transient memory spikes by
36+
including a long preamble in multipart/form-data requests. The
37+
impact scales with allowed request sizes and concurrency, potentially
38+
causing worker crashes or severe slowdown due to garbage collection.
39+
40+
## Mitigation
41+
42+
* **Upgrade:** Use a patched version of Rack that enforces a preamble
43+
size limit (e.g., 16 KiB) or discards preamble data entirely per
44+
[RFC 2046 § 5.1.1](https://www.rfc-editor.org/rfc/rfc2046.html#section-5.1.1).
45+
46+
* **Workarounds:**
47+
* Limit total request body size at the proxy or web server level.
48+
* Monitor memory and set per-process limits to prevent OOM conditions.
49+
cvss_v3: 7.5
50+
patched_versions:
51+
- "~> 2.2.19"
52+
- "~> 3.1.17"
53+
- ">= 3.2.2"
54+
related:
55+
url:
56+
- https://nvd.nist.gov/vuln/detail/CVE-2025-61770
57+
- https://github.com/rack/rack/security/advisories/GHSA-p543-xpfm-54cp
58+
- https://github.com/rack/rack/commit/589127f4ac8b5cf11cf88fb0cd116ffed4d2181e
59+
- https://github.com/rack/rack/commit/d869fed663b113b95a74ad53e1b5cae6ab31f29e
60+
- https://github.com/rack/rack/commit/e08f78c656c9394d6737c022bde087e0f33336fd
61+
- https://github.com/advisories/GHSA-p543-xpfm-54cp

gems/rack/CVE-2025-61771.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
gem: rack
3+
cve: 2025-61771
4+
ghsa: w9pc-fmgc-vxvw
5+
url: https://github.com/rack/rack/security/advisories/GHSA-w9pc-fmgc-vxvw
6+
title: Multipart parser buffers large non‑file fields
7+
entirely in memory, enabling DoS (memory exhaustion)
8+
date: 2025-10-07
9+
description: |
10+
## Summary
11+
12+
`Rack::Multipart::Parser` stores non-file form fields (parts without
13+
a `filename`) entirely in memory as Ruby `String` objects. A single
14+
large text field in a multipart/form-data request (hundreds of
15+
megabytes or more) can consume equivalent process memory, potentially
16+
leading to out-of-memory (OOM) conditions and denial of service (DoS).
17+
18+
## Details
19+
20+
During multipart parsing, file parts are streamed to temporary files,
21+
but non-file parts are buffered into memory:
22+
23+
```ruby
24+
body = String.new # non-file → in-RAM buffer
25+
@mime_parts[mime_index].body << content
26+
```
27+
28+
There is no size limit on these in-memory buffers. As a result, any
29+
large text field—while technically valid—will be loaded fully into
30+
process memory before being added to `params`.
31+
32+
## Impact
33+
34+
Attackers can send large non-file fields to trigger excessive memory
35+
usage. Impact scales with request size and concurrency, potentially
36+
leading to worker crashes or severe garbage-collection overhead. All
37+
Rack applications processing multipart form submissions are affected.
38+
39+
## Mitigation
40+
41+
* **Upgrade:** Use a patched version of Rack that enforces a
42+
reasonable size cap for non-file fields (e.g., 2 MiB).
43+
44+
* **Workarounds:**
45+
* Restrict maximum request body size at the web-server or proxy
46+
layer (e.g., Nginx `client_max_body_size`).
47+
* Validate and reject unusually large form fields at the application level.
48+
cvss_v3: 7.5
49+
patched_versions:
50+
- "~> 2.2.19"
51+
- "~> 3.1.17"
52+
- ">= 3.2.2"
53+
related:
54+
url:
55+
- https://nvd.nist.gov/vuln/detail/CVE-2025-61771
56+
- https://github.com/rack/rack/security/advisories/GHSA-w9pc-fmgc-vxvw
57+
- https://github.com/rack/rack/commit/589127f4ac8b5cf11cf88fb0cd116ffed4d2181e
58+
- https://github.com/rack/rack/commit/d869fed663b113b95a74ad53e1b5cae6ab31f29e
59+
- https://github.com/rack/rack/commit/e08f78c656c9394d6737c022bde087e0f33336fd
60+
- https://github.com/advisories/GHSA-w9pc-fmgc-vxvw

gems/rack/CVE-2025-61772.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
gem: rack
3+
cve: 2025-61772
4+
ghsa: wpv5-97wm-hp9c
5+
url: https://github.com/rack/rack/security/advisories/GHSA-wpv5-97wm-hp9c
6+
title: Rack's multipart parser buffers unbounded per-part headers,
7+
enabling DoS (memory exhaustion)
8+
date: 2025-10-07
9+
description: |
10+
## Summary
11+
12+
`Rack::Multipart::Parser` can accumulate unbounded data when a
13+
multipart part’s header block never terminates with the required
14+
blank line (`CRLFCRLF`). The parser keeps appending incoming bytes
15+
to memory without a size cap, allowing a remote attacker to exhaust
16+
memory and cause a denial of service (DoS).
17+
18+
## Details
19+
20+
While reading multipart headers, the parser waits for `CRLFCRLF` using:
21+
22+
```ruby
23+
@sbuf.scan_until(/(.*?\r
24+
)\r
25+
/m)
26+
```
27+
28+
If the terminator never appears, it continues appending data
29+
(`@sbuf.concat(content)`) indefinitely. There is no limit on
30+
accumulated header bytes, so a single malformed part can consume
31+
memory proportional to the request body size.
32+
33+
## Impact
34+
35+
Attackers can send incomplete multipart headers to trigger high memory
36+
use, leading to process termination (OOM) or severe slowdown. The
37+
effect scales with request size limits and concurrency. All
38+
applications handling multipart uploads may be affected.
39+
40+
## Mitigation
41+
42+
* Upgrade to a patched Rack version that caps per-part header size
43+
(e.g., 64 KiB).
44+
45+
* Until then, restrict maximum request sizes at the proxy or web
46+
server layer (e.g., Nginx `client_max_body_size`).
47+
cvss_v3: 7.5
48+
patched_versions:
49+
- "~> 2.2.19"
50+
- "~> 3.1.17"
51+
- ">= 3.2.2"
52+
related:
53+
url:
54+
- https://nvd.nist.gov/vuln/detail/CVE-2025-61772
55+
- https://github.com/rack/rack/security/advisories/GHSA-wpv5-97wm-hp9c
56+
- https://github.com/rack/rack/commit/589127f4ac8b5cf11cf88fb0cd116ffed4d2181e
57+
- https://github.com/rack/rack/commit/d869fed663b113b95a74ad53e1b5cae6ab31f29e
58+
- https://github.com/rack/rack/commit/e08f78c656c9394d6737c022bde087e0f33336fd
59+
- https://github.com/advisories/GHSA-wpv5-97wm-hp9c

0 commit comments

Comments
 (0)