CVE-2026-142590: Rack `Rack::Multipart::Parser` Preserves CRLF From Multipart Vulnerability

MODERATE
Advisory Identifier: GHSA-frgv-948x-h96g
CVSS 4.8
CWE-93
Published
Advisory Summary

CVE-2026-142590 is a MODERATE (CVSS 4.8) `rack::multipart::parser` preserves crlf from multipart vulnerability (CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')) affecting Rack libraries in the RubyGems ecosystem. The issue involves `rack::multipart::parser` preserves crlf from multipart part headers in parsed parameter names (incomplete fix for cve-2026-26962). Remediation is available by upgrading affected packages to version 2.2.26, 3.1.24, 3.2.9.

CVE-2026-142590 at a Glance

CVE Identifier CVE-2026-142590
GHSA Identifier GHSA-frgv-948x-h96g
Severity MODERATE
CVSS v3.1 Base Score 4.8
CWE Classification CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')
Affected Product Rack
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 4.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-142590

To remediate this vulnerability, upgrade all affected Rack dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rack fixed: 2.2.26
Upgrade rack to 2.2.26
rack fixed: 3.1.24
Upgrade rack to 3.1.24
rack fixed: 3.2.9
Upgrade rack to 3.2.9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for rack

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-142590, inspect your project dependencies for Rack:

inspect dependencies for rack

Analyze the terminal output to locate any version of Rack in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.26), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection'), where the product uses crlf (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes crlf sequences from inputs. In Rack, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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: ```ruby 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 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 `CONTENT_DISPOSITION_MAX_BYTES` (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}/ MULTIPART_CONTENT_TYPE = /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#content_type` 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.

CVE-2026-142590 Affected Rack Versions

3 component(s)
Fixed Versions:
2.2.263.1.243.2.9
Product / Package Ecosystem Affected Versions Fixed Version
rack
RubyGems
< 2.2.26
2.2.26
rack
RubyGems
≥ 3.1.16
< 3.1.24
3.1.24
rack
RubyGems
≥ 3.2.0
< 3.2.9
3.2.9

References

Frequently Asked Questions

What is CVE-2026-142590?
CVE-2026-142590 is a security vulnerability in Rack involving `Rack::Multipart::Parser` preserves CRLF from multipart part headers in parsed parameter names (incomplete fix for CVE-2026-26962) under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection').
Which Rack versions are affected?
Affected versions include releases prior to 2.2.26, 3.1.24, 3.2.9 across affected packages: rack.
What version fixes CVE-2026-142590?
Upgrading to 2.2.26, 3.1.24, 3.2.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rack affected?
Yes, rack is affected in releases prior to 2.2.26, 3.1.24, 3.2.9. Upgrade your dependency to 2.2.26, 3.1.24, 3.2.9 or later.
What is the CVSS score of CVE-2026-142590?
CVE-2026-142590 has a CVSS v3.1 base score of 4.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-142590?
CVE-2026-142590 is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection') (The product uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.).
How can I check RubyGems dependencies for CVE-2026-142590?
Run the dependency tree command: 'inspect dependencies for rack'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-frgv-948x-h96g",
  "modified" : "2026-12-02T23:38:48Z",
  "published" : "2026-12-02T23:38:48Z",
  "aliases" : [ "CVE-2026-142590" ],
  "summary" : "Rack: `Rack::Multipart::Parser` preserves CRLF from multipart part headers in parsed parameter names (incomplete fix for CVE-2026-26962)",
  "details" : "## Summary\n\nThe 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:\n\n* 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.\n* 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.\n\nIn both cases this is the same weakness as CVE-2026-26962, reached through a header or pattern the earlier fix did not cover.\n\n## Details\n\n### Rack 3.1.16 and later, Rack 3.2\n\nThe 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:\n\n```ruby\ncontent_type = head[MULTIPART_CONTENT_TYPE, 1]\ncontent_type.gsub!(OBS_UNFOLD, '\\1') if content_type\n\nif (disposition = head[MULTIPART_CONTENT_DISPOSITION, 1]) && disposition.bytesize <= CONTENT_DISPOSITION_MAX_BYTES\n  disposition.gsub!(OBS_UNFOLD, '\\1')\n  # ...\nelse\n  name = head[MULTIPART_CONTENT_ID, 1]   # not unfolded\nend\n```\n\nA 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 `CONTENT_DISPOSITION_MAX_BYTES` (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.)\n\nRack 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.\n\n### Rack 2.2\n\nRack 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:\n\n```ruby\nVALUE = /\"(?:\\\\\"|[^\"])*\"|#{TOKEN}/\nMULTIPART_CONTENT_TYPE = /Content-Type: (.*)#{EOL}/ni\n```\n\nA 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#content_type` 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.\n\nAll 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.)\n\n## Impact\n\nApplications 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.\n\n## Mitigation\n\n* 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.\n* 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.26"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.1.16"
      }, {
        "fixed" : "3.1.24"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2.0"
      }, {
        "fixed" : "3.2.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/security/advisories/GHSA-frgv-948x-h96g"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/770241c043cb9f2d4bb9ef5f55091c0e019264d1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/95cf65878060577f49574190db92a807053fc08b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/a08cec232d5ba547ad4d646bba139c96a57706b8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rack/rack"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/releases/tag/v2.2.26"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/releases/tag/v3.1.24"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/releases/tag/v3.2.9"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-93" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-02T23:38:48Z",
    "nvd_published_at" : null
  }
}