RubyGems
CVE-2026-142594
Rack: `Rack::Multipart` extracts the boundary by substring match rather than parameter parsing, allowing parser differentials and WAF bypass
- Severity
- Low 3.7
- Published
- 3 Dec 2026
- Last changed
- 3 Dec 2026
- Added to UpHeron
- 3 Dec 2026
- Fixed in
- 2.2.26, 3.1.24, 3.2.9
- Weakness
- CWE-436
- Attack
- Over the network · Only under certain conditions · No login needed · No user action needed
- Attacker can
- Change some data
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N- Also known as
- GHSA-r243-pfwh-7rpx
- Sources
- OSV.dev and GitHub
Description
Rack::Multipart::Parser.parse_boundary locates the multipart boundary by matching boundary= anywhere in the Content-Type header with a regular expression, rather than parsing the header's parameters. The matched value is also cut at the first ", ;, or , even inside a quoted-string, and surrounding whitespace is kept. Rack therefore derives a boundary from headers in which a conforming parser (RFC 9110 Section 8.3.1, as implemented by Go's mime.ParseMediaType, Python's email package, and WAF engines built on them) finds a different boundary or none at all. An attacker can choose such a header and lay out a body that an inspecting intermediary and Rack read as different sets of parts.
The boundary is extracted with:
This has three consequences:
- boundary= inside another parameter's value is accepted as the boundary. multipart/form-data; name=" boundary=EVIL" and multipart/form-data; x=boundary=AaB03x both yield a boundary for Rack, while a conforming parser finds no boundary…
Workarounds
- Update to a patched version of Rack, in which the boundary is taken only from a parameter named boundary using an RFC 9110 parameter parser, quoted-strings are honoured, and a request with more than one boundary parameter is rejected.
- At the reverse proxy, reject multipart requests whose Content-Type does not contain exactly one well-formed boundary parameter, and reject boundary values containing , or ;.
Affected software
| Software | Affected versions |
|---|---|
rackRubyGems · osv:RubyGems:rack |
|
About rack
- Total downloads (RubyGems)
- 1,403,480,099RubyGems, 1 Dec 2026
Vulnerabilities in rack
- In our list
- 6
- Published in the last 12 months
- 6
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2026-142590Rack: `Rack::Multipart::Parser` preserves CRLF from multipart part headers in parsed parameter names (incomplete fix for CVE-2026-26962)Medium 4.8 2 Dec 2026
- CVE-2026-125111Rack: Multipart parsing allows DoS via unbounded scan buffer growthHigh 7.5 10 Nov 2026
- CVE-2026-125108Rack: Multipart boundary ambiguity guard in Rack::Multipart::Parser can be bypassed with a quoted boundary value, allowing WAF bypassLow 3.7 10 Nov 2026
- CVE-2026-125109Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header — incomplete fix of CVE-2026-34835Medium 4.8 10 Nov 2026
- CVE-2026-125110Rack: Rack::Static header_rules bypass via dot-segment normalization mismatchMedium 5.3 10 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-142594
- GitHub Advisory Database https://github.com/advisories/GHSA-r243-pfwh-7rpx