Skip to content

Commit 57d27b1

Browse files
committed
GHSA/SYNC: 10 brand new (rack) advisories
1 parent b1e3c15 commit 57d27b1

File tree

10 files changed

+899
-0
lines changed

10 files changed

+899
-0
lines changed

gems/rack/CVE-2026-26961.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
gem: rack
3+
cve: 2026-26961
4+
ghsa: vgpv-f759-9wx3
5+
url: https://github.com/rack/rack/security/advisories/GHSA-vgpv-f759-9wx3
6+
title: Rack's greedy multipart boundary parsing can cause parser
7+
differentials and WAF bypass.
8+
date: 2026-04-02
9+
description: |
10+
## Summary
11+
12+
`Rack::Multipart::Parser` extracts the `boundary` parameter from
13+
`multipart/form-data` using a greedy regular expression. When a
14+
`Content-Type` header contains multiple `boundary` parameters,
15+
Rack selects the last one rather than the first.
16+
17+
In deployments where an upstream proxy, WAF, or intermediary
18+
interprets the first `boundary` parameter, this mismatch can
19+
allow an attacker to smuggle multipart content past upstream
20+
inspection and have Rack parse a different body structure than
21+
the intermediary validated.
22+
23+
## Details
24+
25+
Rack identifies the multipart boundary using logic equivalent to:
26+
27+
```ruby
28+
MULTIPART = %r|\Amultipart/.*boundary=\"?([^\";,]+)\"?|ni
29+
```
30+
31+
Because the expression is greedy, it matches the last `boundary=`
32+
parameter in a header such as:
33+
34+
```http
35+
Content-Type: multipart/form-data; boundary=safe; boundary=malicious
36+
```
37+
38+
As a result, Rack parses the request body using `malicious`, while
39+
another component may interpret the same header using `safe`.
40+
41+
This creates an interpretation conflict. If an upstream WAF or proxy
42+
inspects multipart parts using the first boundary and Rack later
43+
parses the body using the last boundary, a client may be able to
44+
place malicious form fields or uploaded content in parts that Rack
45+
accepts but the upstream component did not inspect as intended.
46+
47+
This issue is most relevant in layered deployments where security
48+
decisions are made before the request reaches Rack.
49+
50+
## Impact
51+
52+
Applications that accept `multipart/form-data` uploads behind an
53+
inspecting proxy or WAF may be affected.
54+
55+
In such deployments, an attacker may be able to bypass upstream
56+
filtering of uploaded files or form fields by sending a request
57+
with multiple `boundary` parameters and relying on the intermediary
58+
and Rack to parse the request differently.
59+
60+
The practical impact depends on deployment architecture. If no
61+
upstream component relies on a different multipart interpretation,
62+
this behavior may not provide meaningful additional attacker capability.
63+
64+
## Mitigation
65+
66+
* Update to a patched version of Rack that rejects ambiguous multipart
67+
`Content-Type` headers or parses duplicate `boundary` parameters
68+
consistently.
69+
* Reject requests containing multiple `boundary` parameters.
70+
* Normalize or regenerate multipart metadata at the trusted edge
71+
before forwarding requests to Rack.
72+
* Avoid relying on upstream inspection of malformed multipart
73+
requests unless duplicate parameter handling is explicitly
74+
consistent across components.
75+
cvss_v3: 3.7
76+
patched_versions:
77+
- "~> 2.2.23"
78+
- "~> 3.1.21"
79+
- ">= 3.2.6"
80+
related:
81+
url:
82+
- https://nvd.nist.gov/vuln/detail/CVE-2026-26961
83+
- https://github.com/rack/rack/security/advisories/GHSA-vgpv-f759-9wx3
84+
- https://github.com/advisories/GHSA-vgpv-f759-9wx3

gems/rack/CVE-2026-26962.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
gem: rack
3+
cve: 2026-26962
4+
ghsa: rx22-g9mx-qrhv
5+
url: https://github.com/rack/rack/security/advisories/GHSA-rx22-g9mx-qrhv
6+
title: Rack's improper unfolding of folded multipart headers
7+
preserves CRLF in parsed parameter values
8+
date: 2026-04-02
9+
description: |
10+
## Summary
11+
12+
`Rack::Multipart::Parser` unfolds folded multipart part headers
13+
incorrectly. When a multipart header contains an obs-fold sequence,
14+
Rack preserves the embedded CRLF in parsed parameter values such
15+
as `filename` or `name` instead of removing the folded line break
16+
during unfolding.
17+
18+
As a result, applications that later reuse those parsed values in
19+
HTTP response headers may be vulnerable to downstream header
20+
injection or response splitting.
21+
22+
## Details
23+
24+
`Rack::Multipart::Parser` accepts folded multipart header values and
25+
unfolds them during parsing. However, the unfolding behavior does
26+
not fully remove the embedded line break sequence from the parsed value.
27+
28+
This means a multipart part header such as:
29+
30+
```http
31+
Content-Disposition: form-data; name="file"; filename="test\r
32+
foo.txt"
33+
```
34+
35+
can result in a parsed parameter value that still contains CRLF characters.
36+
37+
The issue is not that Rack creates a second multipart header field.
38+
Rather, the problem is that CRLF remains embedded in the parsed
39+
metadata value after unfolding. If an application later uses that
40+
value in a security-sensitive context, such as constructing an HTTP
41+
response header, the preserved CRLF may alter downstream header parsing.
42+
43+
Affected values may include multipart parameters such as
44+
`filename`, `name`, or similar parsed header attributes.
45+
46+
## Impact
47+
48+
Applications that accept multipart form uploads may be affected if
49+
they later reuse parsed multipart metadata in HTTP headers or other
50+
header-sensitive contexts.
51+
52+
In affected deployments, an attacker may be able to supply a multipart
53+
parameter value containing folded line breaks and cause downstream
54+
header injection, response splitting, cache poisoning, or related
55+
response parsing issues.
56+
57+
The practical impact depends on application behavior. If parsed
58+
multipart metadata is not reused in HTTP headers, the issue may
59+
be limited to incorrect parsing behavior rather than a direct
60+
exploit path.
61+
62+
## Mitigation
63+
64+
* Update to a patched version of Rack that removes CRLF correctly
65+
when unfolding folded multipart header values.
66+
* Avoid copying upload metadata such as `filename` directly into
67+
HTTP response headers without sanitization.
68+
* Sanitize or reject carriage return and line feed characters in
69+
multipart-derived values before reusing them in response headers,
70+
logs, or downstream protocol contexts.
71+
* Where feasible, normalize uploaded filenames before storing or
72+
reflecting them.
73+
cvss_v3: 4.8
74+
unaffected_versions:
75+
- "< 3.2.0"
76+
patched_versions:
77+
- ">= 3.2.6"
78+
related:
79+
url:
80+
- https://nvd.nist.gov/vuln/detail/CVE-2026-26962
81+
- https://github.com/rack/rack/security/advisories/GHSA-rx22-g9mx-qrhv
82+
- https://github.com/advisories/GHSA-rx22-g9mx-qrhv

gems/rack/CVE-2026-32762.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
gem: rack
3+
cve: 2026-32762
4+
ghsa: qfgr-crr9-7r49
5+
url: https://github.com/rack/rack/security/advisories/GHSA-qfgr-crr9-7r49
6+
title: Rack - Forwarded Header semicolon injection enables
7+
Host and Scheme spoofing
8+
date: 2026-04-02
9+
description: |
10+
## Summary
11+
12+
`Rack::Utils.forwarded_values` parses the RFC 7239 `Forwarded` header
13+
by splitting on semicolons before handling quoted-string values.
14+
Because quoted values may legally contain semicolons, a header such as:
15+
16+
```http
17+
Forwarded: for="127.0.0.1;host=evil.com;proto=https"
18+
```
19+
20+
can be interpreted by Rack as multiple `Forwarded` directives rather
21+
than as a single quoted `for` value.
22+
23+
In deployments where an upstream proxy, WAF, or intermediary validates
24+
or preserves quoted `Forwarded` values differently, this discrepancy
25+
can allow an attacker to smuggle `host`, `proto`, `for`, or `by`
26+
parameters through a single header value.
27+
28+
## Details
29+
30+
`Rack::Utils.forwarded_values` processes the header using logic
31+
equivalent to:
32+
33+
```ruby
34+
forwarded_header.split(';').each_with_object({}) do |field, values|
35+
field.split(',').each do |pair|
36+
pair = pair.split('=').map(&:strip).join('=')
37+
return nil unless pair =~ /\A(by|for|host|proto)="?([^"]+)"?\Z/i
38+
(values[$1.downcase.to_sym] ||= []) << $2
39+
end
40+
end
41+
```
42+
43+
The method splits on `;` before it parses individual `name=value`
44+
pairs. This is inconsistent with RFC 7239, which permits quoted-string
45+
values, and quoted strings may contain semicolons as literal content.
46+
47+
As a result, a header value such as:
48+
49+
```http
50+
Forwarded: for="127.0.0.1;host=evil.com;proto=https"
51+
```
52+
53+
is not treated as a single `for` value. Instead, Rack may interpret
54+
it as if the client had supplied separate `for`, `host`, and `proto`
55+
directives.
56+
57+
This creates an interpretation conflict when another component in
58+
front of Rack treats the quoted value as valid literal content,
59+
while Rack reparses it as multiple forwarding parameters.
60+
61+
## Impact
62+
63+
Applications that rely on `Forwarded` to derive request metadata
64+
may observe attacker-controlled values for `host`, `proto`, `for`,
65+
or related URL components.
66+
67+
In affected deployments, this can lead to host or scheme spoofing
68+
in derived values such as `req.host`, `req.scheme`, `req.base_url`,
69+
or `req.url`. Applications that use those values for password reset
70+
links, redirects, absolute URL generation, logging, IP-based
71+
decisions, or backend requests may be vulnerable to downstream
72+
security impact.
73+
74+
The practical security impact depends on deployment architecture.
75+
If clients can already supply arbitrary trusted `Forwarded`
76+
parameters directly, this bug may not add meaningful attacker
77+
capability. The issue is most relevant where an upstream component
78+
and Rack interpret the same `Forwarded` header differently.
79+
80+
## Mitigation
81+
82+
* Update to a patched version of Rack that parses `Forwarded`
83+
quoted-string values before splitting on parameter delimiters.
84+
* Avoid trusting client-supplied `Forwarded` headers unless they
85+
are normalized or regenerated by a trusted reverse proxy.
86+
* Prefer stripping inbound `Forwarded` headers at the edge and
87+
reconstructing them from trusted proxy metadata.
88+
* Avoid using `req.host`, `req.scheme`, `req.base_url`, or
89+
`req.url` for security-sensitive operations unless the forwarding
90+
chain is explicitly trusted and validated.
91+
cvss_v3: 4.8
92+
unaffected_versions:
93+
- "< 3.0.0.beta1"
94+
patched_versions:
95+
- "~> 3.1.21"
96+
- ">= 3.2.6"
97+
related:
98+
url:
99+
- https://nvd.nist.gov/vuln/detail/CVE-2026-32762
100+
- https://github.com/rack/rack/security/advisories/GHSA-qfgr-crr9-7r49
101+
- https://github.com/advisories/GHSA-qfgr-crr9-7r49

gems/rack/CVE-2026-34230.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
gem: rack
3+
cve: 2026-34230
4+
ghsa: v569-hp3g-36wr
5+
url: https://github.com/rack/rack/security/advisories/GHSA-v569-hp3g-36wr
6+
title: Rack has quadratic complexity in Rack::Utils.select_best_encoding
7+
via wildcard Accept-Encoding header
8+
date: 2026-04-02
9+
description: |
10+
## Summary
11+
12+
`Rack::Utils.select_best_encoding` processes `Accept-Encoding` values
13+
with quadratic time complexity when the header contains many
14+
wildcard (`*`) entries. Because this method is used by `Rack::Deflater`
15+
to choose a response encoding, an unauthenticated attacker can send
16+
a single request with a crafted `Accept-Encoding` header and cause
17+
disproportionate CPU consumption on the compression middleware path.
18+
19+
This results in a denial of service condition for applications
20+
using `Rack::Deflater`.
21+
22+
## Details
23+
24+
`Rack::Utils.select_best_encoding` expands parsed `Accept-Encoding`
25+
values into a list of candidate encodings. When an entry is `*`,
26+
the method computes the set of concrete encodings by subtracting
27+
the encodings already present in the request:
28+
29+
```ruby
30+
if m == "*"
31+
(available_encodings - accept_encoding.map(&:first)).each do |m2|
32+
expanded_accept_encoding << [m2, q, preference]
33+
end
34+
else
35+
expanded_accept_encoding << [m, q, preference]
36+
end
37+
```
38+
39+
Because `accept_encoding.map(&:first)` is evaluated inside the loop,
40+
it is recomputed for each wildcard entry. If the request contains
41+
`N` wildcard entries, this produces repeated scans over the full
42+
parsed header and causes quadratic behavior.
43+
44+
After expansion, the method also performs additional work over
45+
`expanded_accept_encoding`, including per-entry deletion, which
46+
further increases the cost for large inputs.
47+
48+
`Rack::Deflater` invokes this method for each request when the
49+
middleware is enabled:
50+
51+
```ruby
52+
Utils.select_best_encoding(ENCODINGS, Utils.parse_encodings(accept_encoding))
53+
```
54+
55+
As a result, a client can trigger this expensive code path simply
56+
by sending a large `Accept-Encoding` header containing many
57+
repeated wildcard values.
58+
59+
For example, a request with an approximately 8 KB `Accept-Encoding`
60+
header containing about 1,000 `*;q=0.5` entries can cause roughly
61+
170 ms of CPU time in a single request on the `Rack::Deflater`
62+
path, compared to a negligible baseline for a normal header.
63+
64+
This issue is distinct from CVE-2024-26146. That issue concerned
65+
regular expression denial of service during `Accept` header parsing,
66+
whereas this issue arises later during encoding selection after
67+
the header has already been parsed.
68+
69+
## Impact
70+
71+
Any Rack application using `Rack::Deflater` may be affected.
72+
73+
An unauthenticated attacker can send requests with crafted
74+
`Accept-Encoding` headers to trigger excessive CPU usage in the
75+
encoding selection logic. Repeated requests can consume worker
76+
time disproportionately and reduce application availability.
77+
78+
The attack does not require invalid HTTP syntax or large payload
79+
bodies. A single header-sized request is sufficient to reach the
80+
vulnerable code path.
81+
82+
## Mitigation
83+
84+
* Update to a patched version of Rack in which encoding selection
85+
does not repeatedly rescan the parsed header for wildcard entries.
86+
* Avoid enabling `Rack::Deflater` on untrusted traffic.
87+
* Apply request filtering or header size / format restrictions
88+
at the reverse proxy or application boundary to limit abusive
89+
`Accept-Encoding` values.
90+
cvss_v3: 5.3
91+
patched_versions:
92+
- "~> 2.2.23"
93+
- "~> 3.1.21"
94+
- ">= 3.2.6"
95+
related:
96+
url:
97+
- https://nvd.nist.gov/vuln/detail/CVE-2026-34230
98+
- https://github.com/rack/rack/security/advisories/GHSA-v569-hp3g-36wr
99+
- https://github.com/advisories/GHSA-v569-hp3g-36wr

0 commit comments

Comments
 (0)