Loading...
Skip to main content

CVE-2026-26961

MEDIUM

Rack's greedy multipart boundary parsing can cause parser differentials and WAF bypass.

Published April 2, 2026Updated May 13, 2026Source: osv

Summary

## 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.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update rack to 2.2.23 or later
gem install rack -v 2.2.23
Bundler
Update rack to 3.2.6 or later
gem install rack -v 3.2.6
Bundler
Update rack to 3.1.21 or later
gem install rack -v 3.1.21

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (3)

PackageEcosystemAffectedFixed In
rack
rubygems
0.1.0, 0.2.0, 0.3.0, 0.4.0 (+119 more)2.2.23
rack
rubygems
3.2.0, 3.2.1, 3.2.2, 3.2.3 (+2 more)3.2.6
rack
rubygems
3.0.0, 3.0.0.beta1, 3.0.0.rc1, 3.0.1 (+42 more)3.1.21

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 5.3 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Frequently Asked Questions

What is CVE-2026-26961?
Rack's greedy multipart boundary parsing can cause parser differentials and WAF bypass. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 5.3/10).
How do I check if my project is affected by CVE-2026-26961?
CVE-2026-26961 affects rack. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-26961 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
5.3

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

Also Known As

GHSA-vgpv-f759-9wx3

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies