CVE-2026-142594: Rack `Rack::Multipart` Extracts The Boundary By Vulnerability

LOW
Advisory Identifier: GHSA-r243-pfwh-7rpx
CVSS 3.7
CWE-436
Published
Advisory Summary

CVE-2026-142594 is a LOW (CVSS 3.7) `rack::multipart` extracts the boundary by vulnerability (CWE-436: Interpretation Conflict) affecting Rack libraries in the RubyGems ecosystem. The issue involves `rack::multipart` extracts the boundary by substring match rather than parameter parsing, allowing parser differentials and waf bypass. Remediation is available by upgrading affected packages to version 2.2.26, 3.1.24, 3.2.9.

CVE-2026-142594 at a Glance

CVE Identifier CVE-2026-142594
GHSA Identifier GHSA-r243-pfwh-7rpx
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-436: Interpretation Conflict
Affected Product Rack
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 3.7

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:N/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 None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-142594

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-142594, 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-436: Interpretation Conflict, where product a handles inputs or steps differently than product b, which causes a to perform incorrect actions based on its perception of b's state. 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 `Rack::Multipart::Parser.parse_boundary` locates the multipart boundary by matching `boundary=` anywhere in the `Content-Type` header with a regular expression, rather than parsing the header's parameters. The matched value is also cut at the first `"`, `;`, or `,` even inside a quoted-string, and surrounding whitespace is kept. Rack therefore derives a boundary from headers in which a conforming parser (RFC 9110 Section 8.3.1, as implemented by Go's `mime.ParseMediaType`, Python's `email` package, and WAF engines built on them) finds a different boundary or none at all. An attacker can choose such a header and lay out a body that an inspecting intermediary and Rack read as different sets of parts. ## Details The boundary is extracted with: ```ruby MULTIPART = /\Amultipart\/.*?#{NOT_AFTER_TOKEN_CHAR}boundary(\s*)="?([^";,]+)"?/ni ``` This has three consequences: * `boundary=` inside another parameter's value is accepted as the boundary. `multipart/form-data; name=" boundary=EVIL"` and `multipart/form-data; x=boundary=AaB03x` both yield a boundary for Rack, while a conforming parser finds no `boundary` parameter. The duplicate-boundary guard added for CVE-2026-125108 counts one occurrence and does not fire, and the token-character lookbehind does not help because a space or `=` is not a token character. * A quoted boundary is truncated at `,` or `;`. `multipart/form-data; boundary="AaB03x,1"` yields `AaB03x` for Rack and `AaB03x,1` for a conforming parser. This header is fully valid: `,` is permitted in a boundary by RFC 2046 Section 5.1.1 and inside a quoted-string by RFC 9110, so an intermediary has no reason to reject it. * Whitespace after `=` or before `;` becomes part of the boundary, and quoted-pair escapes such as `\"` are not unescaped. `Rack::MediaType.params(content_type)["boundary"]` returns `nil` for the in-value shapes while `parse_boundary` returns a value, so Rack's own API is inconsistent with itself. All supported versions, including 2.2, are affected. ## Impact Applications that accept `multipart/form-data` behind a web application firewall, reverse proxy, or other component that inspects multipart bodies with a conforming parser. The intermediary sees no multipart body, or a different set of parts, so form fields and file uploads reach the application without inspection. This was confirmed end to end against OWASP Coraza with the OWASP Core Rule Set: a rule that blocks an ordinary PHP file upload does not fire on the smuggled form, while the Rack application receives the file. No authentication, malformed HTTP, or large payload is required. Rack itself grants no capability beyond that of a well-formed request with the same body. ## Mitigation * Update to a patched version of Rack, in which the boundary is taken only from a parameter named `boundary` using an RFC 9110 parameter parser, quoted-strings are honoured, and a request with more than one boundary parameter is rejected. * At the reverse proxy, reject multipart requests whose `Content-Type` does not contain exactly one well-formed `boundary` parameter, and reject boundary values containing `,` or `;`.

CVE-2026-142594 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.0.0
< 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-142594?
CVE-2026-142594 is a security vulnerability in Rack involving `Rack::Multipart` extracts the boundary by substring match rather than parameter parsing, allowing parser differentials and WAF bypass under CWE-436: Interpretation Conflict.
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-142594?
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-142594?
CVE-2026-142594 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2026-142594?
CVE-2026-142594 is classified under CWE-436: Interpretation Conflict (Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.).
How can I check RubyGems dependencies for CVE-2026-142594?
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-r243-pfwh-7rpx",
  "modified" : "2026-12-03T00:08:43Z",
  "published" : "2026-12-03T00:08:43Z",
  "aliases" : [ "CVE-2026-142594" ],
  "summary" : "Rack: `Rack::Multipart` extracts the boundary by substring match rather than parameter parsing, allowing parser differentials and WAF bypass",
  "details" : "## Summary\n\n`Rack::Multipart::Parser.parse_boundary` locates the multipart boundary by matching `boundary=` anywhere in the `Content-Type` header with a regular expression, rather than parsing the header's parameters. The matched value is also cut at the first `\"`, `;`, or `,` even inside a quoted-string, and surrounding whitespace is kept. Rack therefore derives a boundary from headers in which a conforming parser (RFC 9110 Section 8.3.1, as implemented by Go's `mime.ParseMediaType`, Python's `email` package, and WAF engines built on them) finds a different boundary or none at all. An attacker can choose such a header and lay out a body that an inspecting intermediary and Rack read as different sets of parts.\n\n## Details\n\nThe boundary is extracted with:\n\n```ruby\nMULTIPART = /\\Amultipart\\/.*?#{NOT_AFTER_TOKEN_CHAR}boundary(\\s*)=\"?([^\";,]+)\"?/ni\n```\n\nThis has three consequences:\n\n* `boundary=` inside another parameter's value is accepted as the boundary. `multipart/form-data; name=\" boundary=EVIL\"` and `multipart/form-data; x=boundary=AaB03x` both yield a boundary for Rack, while a conforming parser finds no `boundary` parameter. The duplicate-boundary guard added for CVE-2026-125108 counts one occurrence and does not fire, and the token-character lookbehind does not help because a space or `=` is not a token character.\n* A quoted boundary is truncated at `,` or `;`. `multipart/form-data; boundary=\"AaB03x,1\"` yields `AaB03x` for Rack and `AaB03x,1` for a conforming parser. This header is fully valid: `,` is permitted in a boundary by RFC 2046 Section 5.1.1 and inside a quoted-string by RFC 9110, so an intermediary has no reason to reject it.\n* Whitespace after `=` or before `;` becomes part of the boundary, and quoted-pair escapes such as `\\\"` are not unescaped.\n\n`Rack::MediaType.params(content_type)[\"boundary\"]` returns `nil` for the in-value shapes while `parse_boundary` returns a value, so Rack's own API is inconsistent with itself.\n\nAll supported versions, including 2.2, are affected.\n\n## Impact\n\nApplications that accept `multipart/form-data` behind a web application firewall, reverse proxy, or other component that inspects multipart bodies with a conforming parser. The intermediary sees no multipart body, or a different set of parts, so form fields and file uploads reach the application without inspection. This was confirmed end to end against OWASP Coraza with the OWASP Core Rule Set: a rule that blocks an ordinary PHP file upload does not fire on the smuggled form, while the Rack application receives the file. No authentication, malformed HTTP, or large payload is required. Rack itself grants no capability beyond that of a well-formed request with the same body.\n\n## Mitigation\n\n* Update to a patched version of Rack, in which the boundary is taken only from a parameter named `boundary` using an RFC 9110 parameter parser, quoted-strings are honoured, and a request with more than one boundary parameter is rejected.\n* At the reverse proxy, reject multipart requests whose `Content-Type` does not contain exactly one well-formed `boundary` parameter, and reject boundary values containing `,` or `;`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/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.0.0"
      }, {
        "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-r243-pfwh-7rpx"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/6cce362d027f437362eb1d2ae330e7e880e6a01d"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/c74dbad94cbe91c7fa6e68f89fad22578a6135e0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/commit/e5045fef634b491f0ea25b0e8bbfb946f7cbadd4"
  }, {
    "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-436" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-03T00:08:43Z",
    "nvd_published_at" : null
  }
}