CVE-2026-26962: Rack's improper unfolding of folded multipart headers preserves CRLF in parsed parameter values
Summary Rack::Multipart::Parser unfolds folded multipart part headers incorrectly. When a multipart header contains an obs-fold sequence, Rack preserves the embedded CRLF in parsed parameter values such as filename or name instead of removing the folded line break during unfolding.
Published Apr 2, 2026 · Updated May 13, 2026
Affected packages
rack
- Ecosystem
- RubyGems
- Affected
- >= 3.2.0, < 3.2.6
- Fixed in
- 3.2.6
- Check
bundle info rack
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Rack::Multipart::Parser unfolds folded multipart part headers incorrectly. When a multipart header contains an obs-fold sequence, Rack preserves the embedded CRLF in parsed parameter values such as filename or name instead of removing the folded line break during unfolding.
As a result, applications that later reuse those parsed values in HTTP response headers may be vulnerable to downstream header injection or response splitting.
Details
Rack::Multipart::Parser accepts folded multipart header values and unfolds them during parsing. However, the unfolding behavior does not fully remove the embedded line break sequence from the parsed value.
This means a multipart part header such as:
Content-Disposition: form-data; name="file"; filename="test\r\n foo.txt"can result in a parsed parameter value that still contains CRLF characters.
The issue is not that Rack creates a second multipart header field. Rather, the problem is that CRLF remains embedded in the parsed metadata value after unfolding. If an application later uses that value in a security-sensitive context, such as constructing an HTTP response header, the preserved CRLF may alter downstream header parsing.
Affected values may include multipart parameters such as filename, name, or similar parsed header attributes.
Impact
Applications that accept multipart form uploads may be affected if they later reuse parsed multipart metadata in HTTP headers or other header-sensitive contexts.
In affected deployments, an attacker may be able to supply a multipart parameter value containing folded line breaks and cause downstream header injection, response splitting, cache poisoning, or related response parsing issues.
The practical impact depends on application behavior. If parsed multipart metadata is not reused in HTTP headers, the issue may be limited to incorrect parsing behavior rather than a direct exploit path.
Mitigation
- Update to a patched version of Rack that removes CRLF correctly when unfolding folded multipart header values.
- Avoid copying upload metadata such as
filenamedirectly into HTTP response headers without sanitization. - Sanitize or reject carriage return and line feed characters in multipart-derived values before reusing them in response headers, logs, or downstream protocol contexts.
- Where feasible, normalize uploaded filenames before storing or reflecting them.
Credited to wtn, jeremyevans, ioquatix.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More RubyGems vulnerabilities
All RubyGems entriesCVE-2026-125108
Rack: Multipart boundary ambiguity guard in Rack::Multipart::Parser can be bypassed with a quoted boundary value, allowing WAF bypass
low3.7Nov 10, 2026CVE-2026-125109
Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header — incomplete fix of CVE-2026-34835
medium4.8Nov 10, 2026CVE-2026-125110
Rack: Rack::Static header_rules bypass via dot-segment normalization mismatch
medium5.3Nov 10, 2026CVE-2026-125111
Rack: Multipart parsing allows DoS via unbounded scan buffer growth
high7.5Nov 10, 2026CVE-2026-26961
Rack's greedy multipart boundary parsing can cause parser differentials and WAF bypass.
medium5.3Apr 2, 2026CVE-2026-32762
Rack: Forwarded Header semicolon injection enables Host and Scheme spoofing
medium4.8Apr 2, 2026
