CVE-2026-142594: Rack: `Rack::Multipart` extracts the boundary by substring match rather than parameter parsing, allowing parser differentials and WAF bypass
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.
References
- github.com/advisories/GHSA-r243-pfwh-7rpx
- github.com/rack/rack/commit/6cce362d027f437362eb1d2ae330e7e880e6a01d
- github.com/rack/rack/commit/c74dbad94cbe91c7fa6e68f89fad22578a6135e0
- github.com/rack/rack/commit/e5045fef634b491f0ea25b0e8bbfb946f7cbadd4
- github.com/rack/rack/releases/tag/v2.2.26
- github.com/rack/rack/releases/tag/v3.1.24
- github.com/rack/rack/releases/tag/v3.2.9
- github.com/rack/rack/security/advisories/GHSA-r243-pfwh-7rpx
- nvd.nist.gov/vuln/detail/CVE-2026-142594
Code Behaviors & Features
Detect and mitigate CVE-2026-142594 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →