{"id":"CVE-2026-26961","aliases":["CVE-2026-26961","GHSA-vgpv-f759-9wx3"],"related":[],"kind":"vulnerability","state":"published","title":"Rack: Multipart Boundary Parsing Ambiguity allowing WAF Bypass","summary":"Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, 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. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, 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. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.","source":"cvelist"},{"lang":"en","text":"## 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Rack es una interfaz modular de servidor web Ruby. Antes de las versiones 2.2.23, 3.1.21 y 3.2.6, Rack::Multipart::Parser extrae el parámetro boundary de multipart/form-data utilizando una expresión regular voraz. Cuando un encabezado Content-Type contiene múltiples parámetros boundary, Rack selecciona el último en lugar del primero. En implementaciones donde un proxy ascendente, WAF o intermediario interpreta el primer parámetro boundary, esta discrepancia puede permitir a un atacante contrabandear contenido multipart más allá de la inspección ascendente y hacer que Rack analice una estructura de cuerpo diferente de la que el intermediario validó. Este problema ha sido parcheado en las versiones 2.2.23, 3.1.21 y 3.2.6.","source":"nvd"}],"published":"2026-04-02T16:42:16.766Z","modified":"2026-09-10T03:51:03.337Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-436"],"affected":[{"ranges":[{"version":"< 2.2.23","status":"affected"},{"version":">= 3.0.0.beta1, < 3.1.21","status":"affected"},{"version":">= 3.2.0, < 3.2.6","status":"affected"}],"vendor":"rack","product":"rack","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.2.23"}],"ecosystem":"RubyGems","package":"rack","purl":"pkg:gem/rack","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0.beta1","status":"affected","fixed":"3.1.21"}],"ecosystem":"RubyGems","package":"rack","purl":"pkg:gem/rack","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.2.0","status":"affected","fixed":"3.2.6"}],"ecosystem":"RubyGems","package":"rack","purl":"pkg:gem/rack","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.2.23"},{"status":"affected","introduced":"3.0.0","fixed":"3.1.21"},{"status":"affected","introduced":"3.2.0","fixed":"3.2.6"}],"vendor":"rack","product":"rack","cpe":"cpe:2.3:a:rack:rack:*:*:*:*:*:ruby:*:*","source":"nvd"}],"references":[{"url":"https://github.com/rack/rack/security/advisories/GHSA-vgpv-f759-9wx3","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-26961","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rack/rack","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2026-26961.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-03T17:57:50.290Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-26961","url":"https://www.cve.org/CVERecord?id=CVE-2026-26961","licence":"CVE Terms of Use","modified":"2026-04-03T17:58:12.149Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vgpv-f759-9wx3","url":"https://github.com/advisories/GHSA-vgpv-f759-9wx3","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:03.337Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-26961","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-26961","licence":"Public domain","modified":"2026-07-24T21:10:00.143Z"}],"updatedAt":"2026-11-25T22:59:17.806Z","epss":{"score":0.00287,"percentile":0.22835,"date":"2026-12-01T12:00:22.000Z"}}