Rack: `Rack::Multipart::Parser` preserves CRLF from multipart part headers in parsed parameter names (incomplete fix for CVE-2026-26962)
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| rackrack | — | Not listed |
| rubygemsrack |
≥ 3.2.0, < 3.2.9→ 3.2.9 |
3.2.9 |
Original description The description as published by the source.
Summary
The fix for CVE-2026-26962 was incomplete. Rack::Multipart::Parser can still place a raw carriage return or line feed from a multipart part header into a parameter name in the application's params hash:
- In Rack 3.1.16+ and 3.2, the parser unfolds folded (obs-fold)
Content-TypeandContent-Dispositionvalues but notContent-ID. When a part has no usableContent-Dispositionheader, the part's name is taken fromContent-ID, so a foldedContent-IDvalue yields a parameter name containing CRLF. - In Rack 2.2, the quoted-string pattern used to extract header parameter values matches across line breaks, so a quoted
nameorfilenamecontaining CRLF is accepted as is, and a bare CR is accepted in aContent-Typevalue.
In both cases this is the same weakness as CVE-2026-26962, reached through a header or pattern the earlier fix did not cover.
Details
Rack 3.1.16 and later, Rack 3.2
The fix for CVE-2026-26962 added an OBS_UNFOLD substitution and applied it to the Content-Type and Content-Disposition values. The fallback branch that derives the part name from Content-ID was left unchanged:
content_type = head[MULTIPART_CONTENT_TYPE, 1]
content_type.gsub!(OBS_UNFOLD, '\1') if content_type
if (disposition = head[MULTIPART_CONTENT_DISPOSITION, 1]) && disposition.bytesize <= CONTENT_DISPOSITION_MAX_BYTES
disposition.gsub!(OBS_UNFOLD, '\1')
# ...
else
name = head[MULTIPART_CONTENT_ID, 1] # not unfolded
end
A part con…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com