CVE-2026-26961: Rack Rack's Greedy Multipart Boundary Parsing Vulnerability

MODERATE
Advisory Identifier: GHSA-vgpv-f759-9wx3
CVSS 5.3
CWE-436
Published
Advisory Summary

CVE-2026-26961 is a MODERATE (CVSS 5.3) rack's greedy multipart boundary parsing vulnerability (CWE-436: Interpretation Conflict) affecting Rack libraries in the RubyGems ecosystem. The issue involves rack's greedy multipart boundary parsing can cause parser differentials and waf bypass.. Remediation is available by upgrading affected packages to version 2.2.23, 3.1.21, 3.2.6.

CVE-2026-26961 at a Glance

CVE Identifier CVE-2026-26961
GHSA Identifier GHSA-vgpv-f759-9wx3
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-436: Interpretation Conflict
Affected Product Rack
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
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-26961

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.23
Upgrade rack to 2.2.23
rack fixed: 3.1.21
Upgrade rack to 3.1.21
rack fixed: 3.2.6
Upgrade rack to 3.2.6
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-26961, 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.23), 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` extracts the `boundary` parameter from `multipart/form-data` using a greedy regular expression. When a `Content-Type` header contains multiple `boundary` parameters, Rack selects the last one rather than the first. In deployments where an upstream proxy, WAF, or intermediary interprets the first `boundary` parameter, this mismatch can allow an attacker to smuggle multipart content past upstream inspection and have Rack parse a different body structure than the intermediary validated. ## Details Rack identifies the multipart boundary using logic equivalent to: ```ruby MULTIPART = %r|\Amultipart/.*boundary=\"?([^\";,]+)\"?|ni ``` Because the expression is greedy, it matches the last `boundary=` parameter in a header such as: ```http Content-Type: multipart/form-data; boundary=safe; boundary=malicious ``` As a result, Rack parses the request body using `malicious`, while another component may interpret the same header using `safe`. This creates an interpretation conflict. If an upstream WAF or proxy inspects multipart parts using the first boundary and Rack later parses the body using the last boundary, a client may be able to place malicious form fields or uploaded content in parts that Rack accepts but the upstream component did not inspect as intended. This issue is most relevant in layered deployments where security decisions are made before the request reaches Rack. ## Impact Applications that accept `multipart/form-data` uploads behind an inspecting proxy or WAF may be affected. In such deployments, an attacker may be able to bypass upstream filtering of uploaded files or form fields by sending a request with multiple `boundary` parameters and relying on the intermediary and Rack to parse the request differently. The practical impact depends on deployment architecture. If no upstream component relies on a different multipart interpretation, this behavior may not provide meaningful additional attacker capability. ## Mitigation * Update to a patched version of Rack that rejects ambiguous multipart `Content-Type` headers or parses duplicate `boundary` parameters consistently. * Reject requests containing multiple `boundary` parameters. * Normalize or regenerate multipart metadata at the trusted edge before forwarding requests to Rack. * Avoid relying on upstream inspection of malformed multipart requests unless duplicate parameter handling is explicitly consistent across components.

CVE-2026-26961 Affected Rack Versions

3 component(s)
Fixed Versions:
2.2.233.1.213.2.6
Product / Package Ecosystem Affected Versions Fixed Version
rack
RubyGems
< 2.2.23
2.2.23
rack
RubyGems
≥ 3.0.0.beta1
< 3.1.21
3.1.21
rack
RubyGems
≥ 3.2.0
< 3.2.6
3.2.6

References

Frequently Asked Questions

What is CVE-2026-26961?
CVE-2026-26961 is a security vulnerability in Rack involving Rack's greedy multipart boundary parsing can cause parser differentials and WAF bypass. under CWE-436: Interpretation Conflict.
Which Rack versions are affected?
Affected versions include releases prior to 2.2.23, 3.1.21, 3.2.6 across affected packages: rack.
What version fixes CVE-2026-26961?
Upgrading to 2.2.23, 3.1.21, 3.2.6 (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.23, 3.1.21, 3.2.6. Upgrade your dependency to 2.2.23, 3.1.21, 3.2.6 or later.
What is the CVSS score of CVE-2026-26961?
CVE-2026-26961 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2026-26961?
CVE-2026-26961 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-26961?
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-vgpv-f759-9wx3",
  "modified" : "2026-05-13T16:17:17Z",
  "published" : "2026-04-02T20:30:40Z",
  "aliases" : [ "CVE-2026-26961" ],
  "summary" : "Rack's greedy multipart boundary parsing can cause parser differentials and WAF bypass.",
  "details" : "## Summary\n\n`Rack::Multipart::Parser` extracts the `boundary` parameter from `multipart/form-data` using a greedy regular expression. When a `Content-Type` header contains multiple `boundary` parameters, Rack selects the last one rather than the first.\n\nIn deployments where an upstream proxy, WAF, or intermediary interprets the first `boundary` parameter, this mismatch can allow an attacker to smuggle multipart content past upstream inspection and have Rack parse a different body structure than the intermediary validated.\n\n## Details\n\nRack identifies the multipart boundary using logic equivalent to:\n\n```ruby\nMULTIPART = %r|\\Amultipart/.*boundary=\\\"?([^\\\";,]+)\\\"?|ni\n```\n\nBecause the expression is greedy, it matches the last `boundary=` parameter in a header such as:\n\n```http\nContent-Type: multipart/form-data; boundary=safe; boundary=malicious\n```\n\nAs a result, Rack parses the request body using `malicious`, while another component may interpret the same header using `safe`.\n\nThis creates an interpretation conflict. If an upstream WAF or proxy inspects multipart parts using the first boundary and Rack later parses the body using the last boundary, a client may be able to place malicious form fields or uploaded content in parts that Rack accepts but the upstream component did not inspect as intended.\n\nThis issue is most relevant in layered deployments where security decisions are made before the request reaches Rack.\n\n## Impact\n\nApplications that accept `multipart/form-data` uploads behind an inspecting proxy or WAF may be affected.\n\nIn such deployments, an attacker may be able to bypass upstream filtering of uploaded files or form fields by sending a request with multiple `boundary` parameters and relying on the intermediary and Rack to parse the request differently.\n\nThe practical impact depends on deployment architecture. If no upstream component relies on a different multipart interpretation, this behavior may not provide meaningful additional attacker capability.\n\n## Mitigation\n\n* Update to a patched version of Rack that rejects ambiguous multipart `Content-Type` headers or parses duplicate `boundary` parameters consistently.\n* Reject requests containing multiple `boundary` parameters.\n* Normalize or regenerate multipart metadata at the trusted edge before forwarding requests to Rack.\n* Avoid relying on upstream inspection of malformed multipart requests unless duplicate parameter handling is explicitly consistent across components.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/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.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0.beta1"
      }, {
        "fixed" : "3.1.21"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2.0"
      }, {
        "fixed" : "3.2.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rack/rack/security/advisories/GHSA-vgpv-f759-9wx3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-26961"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rack/rack"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2026-26961.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-436" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-02T20:30:40Z",
    "nvd_published_at" : "2026-04-02T17:16:21Z"
  }
}