Skip to content
Medium 4.8

Rack: `Rack::Multipart::Parser` preserves CRLF from multipart part headers in parsed parameter names (incomplete fix for CVE-2026-26962)

CVE-2026-142590 First seen on SecPulse

Affected packages

PackageAffected → Fixed
rackrack —
rubygemsrack
≥ 3.2.0, < 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-Type and Content-Disposition values but not Content-ID. When a part has no usable Content-Disposition header, the part's name is taken from Content-ID, so a folded Content-ID value 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 name or filename containing CRLF is accepted as is, and a bare CR is accepted in a Content-Type value.

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

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details