LowGHSA-r243-pfwh-7rpxCVE-2026-142594

Rack: `Rack::Multipart` extracts the boundary by substring match rather than parameter parsing, allowing parser differentials and WAF bypass

Published 3 Dec 2026 · Updated 3 Dec 2026

Affected packages

rackRubyGems
Affected
<2.2.26
Fixed in
2.2.26
Update to the fixed version for your release line, for example:bundle update --conservative rack # Gemfile: '>= 2.2.26'
rackRubyGems
Affected
>=3.0.0 <3.1.24
Fixed in
3.1.24
Update to the fixed version for your release line, for example:bundle update --conservative rack # Gemfile: '>= 3.1.24'
rackRubyGems
Affected
>=3.2.0 <3.2.9
Fixed in
3.2.9
Update to the fixed version for your release line, for example:bundle update --conservative rack # Gemfile: '>= 3.2.9'

We confirm your address first. See our privacy policy.

Which rack does your project really install?

Drop your Gemfile.lock hereWe find the exact rack version you install, even when another package pulls it in, and tell you if it’s affected and what to run. Free, no sign-up.

Works for private projects: the file is read in memory to run the scan and then dropped. Also reads Gemfile.

Public repo?

Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Details

Summary

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.

Details

The boundary is extracted with:

MULTIPART = /\Amultipart\/.*?#{NOT_AFTER_TOKEN_CHAR}boundary(\s*)="?([^";,]+)"?/ni

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 parameter. The duplicate-boundary guard added for CVE-2026-125108 counts one occurrence and does not fire, and the token-character lookbehind does not help because a space or = is not a token character.
  • A quoted boundary is truncated at , or ;. multipart/form-data; boundary="AaB03x,1" yields AaB03x for Rack and AaB03x,1 for a conforming parser. This header is fully valid: , is permitted in a boundary by RFC 2046 Section 5.1.1 and inside a quoted-string by RFC 9110, so an intermediary has no reason to reject it.
  • Whitespace after = or before ; becomes part of the boundary, and quoted-pair escapes such as \" are not unescaped.

Rack::MediaType.params(content_type)["boundary"] returns nil for the in-value shapes while parse_boundary returns a value, so Rack's own API is inconsistent with itself.

All supported versions, including 2.2, are affected.

Impact

Applications that accept multipart/form-data behind a web application firewall, reverse proxy, or other component that inspects multipart bodies with a conforming parser. The intermediary sees no multipart body, or a different set of parts, so form fields and file uploads reach the application without inspection. This was confirmed end to end against OWASP Coraza with the OWASP Core Rule Set: a rule that blocks an ordinary PHP file upload does not fire on the smuggled form, while the Rack application receives the file. No authentication, malformed HTTP, or large payload is required. Rack itself grants no capability beyond that of a well-formed request with the same body.

Mitigation

  • 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 ;.

Is GHSA-r243-pfwh-7rpx in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected rack, and gives you the command that fixes it.

More advisories for rack

  • MediumCVE-2026-142590Rack: `Rack::Multipart::Parser` preserves CRLF from multipart part headers in parsed parameter names (incomplete fix for CVE-2026-26962) · 2 Dec 2026
  • HighCVE-2026-125111Rack: Multipart parsing allows DoS via unbounded scan buffer growth · 10 Nov 2026
  • LowCVE-2026-125108Rack: Multipart boundary ambiguity guard in Rack::Multipart::Parser can be bypassed with a quoted boundary value, allowing WAF bypass · 10 Nov 2026
  • MediumCVE-2026-125109Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header — incomplete fix of CVE-2026-34835 · 10 Nov 2026
  • MediumCVE-2026-125110Rack: Rack::Static header_rules bypass via dot-segment normalization mismatch · 10 Nov 2026
  • MediumCVE-2026-34835Rack::Request accepts invalid Host characters, enabling host allowlist bypass · 2 Apr 2026
All 56 advisories for rack

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.