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

Published Dec 2, 2026
·
Updated

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 OBSUNFOLD 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:

ruby contenttype = head[MULTIPARTCONTENTTYPE, 1] contenttype.gsub!(OBSUNFOLD, '\1') if contenttype

if (disposition = head[MULTIPARTCONTENTDISPOSITION, 1]) && disposition.bytesize <= CONTENTDISPOSITIONMAXBYTES disposition.gsub!(OBSUNFOLD, '\1') # ... else name = head[MULTIPARTCONTENTID, 1] # not unfolded end

A part containing Content-ID: injected-id\r\n value and no Content-Disposition produces the parameter name "injected-id\r\n value". The branch is also reached when a Content-Disposition header is present but longer than CONTENTDISPOSITIONMAXBYTES (1536 bytes), so a part can carry a Content-Disposition and still have its name taken from a folded Content-ID. Any multipart/ content type, including multipart/form-data, reaches this code. Content-Disposition parameter names and values and Content-Type are correctly unfolded on these versions; the Content-ID-derived name is the only value that still carries a raw CRLF from the header. (A filename parameter is percent-decoded by design, so %0D%0A in a filename decodes to CRLF on all versions; that is documented behaviour and not part of this advisory.)

Rack 3.1.16 and later and 3.2.0 and later are affected by this variant, since those versions introduced the Content-ID pattern that accepts folded values. Rack 3.0 is not affected by it: its Content-ID pattern does not match across a line break.

Rack 2.2

Rack 2.2's fix for CVE-2026-26962 unfolds the whole part header before any value is extracted, so folded Content-ID values are handled. However, the pattern used to extract quoted parameter values and the Content-Type pattern do not exclude line breaks:

ruby VALUE = /"(?:\\"|[^"])"|#{TOKEN}/ MULTIPARTCONTENTTYPE = /Content-Type: (.)#{EOL}/ni

A quoted value such as name="a\r\nb" is accepted whole, so the CRLF reaches the parameter name, and a Content-Type value containing a bare CR, such as text/plain\rX-Injected: 1, is preserved in UploadedFile#contenttype and, for a part without Content-Disposition, in the parameter name. Rack 3.x rejects these inputs because its header value patterns only permit CRLF when followed by whitespace.

All Rack 2.2 releases up to and including 2.2.25 are affected by this variant. (Rack 3.0, which is no longer supported, shares it.)

Impact

Applications that accept multipart requests and later reuse parameter names, or uploaded file content types, in HTTP response headers, log lines, or other CRLF-delimited contexts. An unauthenticated attacker can place CRLF into a parameter name deterministically with a single request; whether that leads to header injection, response splitting, or log forgery depends on how the application consumes those values. Rack itself does not write parameter names to response headers or logs. Applications that never reuse parameter names in such contexts see incorrect parsing rather than a direct exploit.

Mitigation

Update to a patched version of Rack. On 3.1 and 3.2 the Content-ID value is unfolded in the same way as Content-Type and Content-Disposition before being used as a part name. On 2.2 the quoted-value and Content-Type patterns no longer match across a line break, matching the behaviour of Rack 3.x. Sanitize or reject carriage return and line feed characters in parameter names and content types before reusing them in response headers, logs, or other protocol contexts.

Other sources

Rack is a modular Ruby web server interface. Prior to 2.2.26, 3.1.24, and 3.2.9, Rack::Multipart::Parser incompletely prevents carriage return and line feed characters from multipart part headers from reaching parsed values. In Rack 3.1.16 and later and Rack 3.2, folded Content-ID values can become parameter names when Content-Disposition is missing or exceeds CONTENTDISPOSITIONMAXBYTES because Content-ID is not unfolded. In Rack 2.2, quoted name or filename values and Content-Type values can match across line breaks. Applications that reuse these parameter names or uploaded-file content types in response headers, log lines, or other CRLF-delimited contexts may permit header injection, response splitting, or log forgery, while Rack itself does not write these values to those sinks. Rack 3.0 is affected. This issue is fixed in versions 2.2.26, 3.1.24, and 3.2.9.

— MITRE

Affected Software

4 affected componentsFixes available
rubygems/rack<2.2.26, >=3.0.0<3.1.0, >=3.1.0<3.1.24, >=3.2.0<3.2.9
rubygems/rack>=3.2.0<3.2.9
3.2.9
rubygems/rack>=3.1.16<3.1.24
3.1.24
rubygems/rack<2.2.26
2.2.26

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/rack to a version that resolves this vulnerability.

    Fixed in 3.2.9
  2. Upgrade

    Upgrade rubygems/rack to a version that resolves this vulnerability.

    Fixed in 3.1.24
  3. Upgrade

    Upgrade rubygems/rack to a version that resolves this vulnerability.

    Fixed in 2.2.26
  4. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.2.26
  5. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.1.24
  6. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.2.9
  7. Compensating control

    Sanitize or reject carriage return and line feed characters in parameter names and content types before reusing them in response headers, logs, or other CRLF-delimited contexts.

Event History

Dec 2, 2026
CVE Published
via MITRE·09:29 PM
Data Sourced
via MITRE·09:29 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:18 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·11:38 PM
Data Sourced
via GitHub·11:38 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·11:38 PM
Affected Software

Frequently Asked Questions

1

Which Rack versions are affected and which releases contain the fix?

Rack versions before 2.2.26, 3.1.24, and 3.2.9 are affected. Rack 3.0 is also affected; upgrade to 2.2.26, 3.1.24, or 3.2.9 as applicable.

2

What must an application do for this issue to become exploitable?

An application must reuse attacker-influenced parsed parameter names or uploaded-file content types in a CRLF-delimited sink, such as response headers or log lines. Rack itself does not write these values to those sinks.

3

What multipart parsing cases are specifically involved?

In Rack 3.1.16 and later and Rack 3.2, folded Content-ID values can become parameter names if Content-Disposition is missing or exceeds CONTENT_DISPOSITION_MAX_BYTES. In Rack 2.2, quoted name or filename values and Content-Type values can match across line breaks.

4

What can be done before upgrading?

Avoid placing multipart parameter names or uploaded-file Content-Type values into response headers, log lines, or other CRLF-delimited contexts. Treat these parsed values as attacker-controlled and prevent carriage return and line feed characters from reaching those sinks.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203