{"id":"CVE-2026-34831","aliases":["DEBIAN-CVE-2026-34831","EUVD-2026-18392","GHSA-q2ww-5357-x388","MGASA-2026-0226","SUSE-SU-2026:1745-1","SUSE-SU-2026:1964-1","SUSE-SU-2026:23321-1","SUSE-SU-2026:2487-1","UBUNTU-CVE-2026-34831","USN-8989-1","openSUSE-SU-2026:10508-1","openSUSE-SU-2026:21640-1"],"status":"published","title":"Rack: Content-Length mismatch in Rack::Files error responses","description":"Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, Rack::Files#fail sets the Content-Length response header using String#size instead of String#bytesize. When the response body contains multibyte UTF-8 characters, the declared Content-Length is smaller than the number of bytes actually sent on the wire. Because Rack::Files reflects the requested path in 404 responses, an attacker can trigger this mismatch by requesting a non-existent path containing percent-encoded UTF-8 characters. This results in incorrect HTTP response framing and may cause response desynchronization in deployments that rely on the incorrect Content-Length value. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.","severity":{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00152,"percentile":0.04422,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-130","CWE-135"],"published":"2026-04-02T16:43:08Z","modified":"2026-11-04T03:43:07Z","fixes":[{"ecosystem":"RubyGems","package":"rack","fixed_in":["2.2.23","3.1.21","3.2.6"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:12","package":"ruby-rack","fixed_in":["2.2.22-0+deb12u2"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"ruby-rack","fixed_in":["3.1.20-0+deb13u2"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"ruby-rack","fixed_in":["3.2.6-2"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:22.04:LTS","package":"ruby-rack","fixed_in":["2.1.4-5ubuntu1.2+esm3"],"sources":["osv"]},{"ecosystem":"Ubuntu:24.04:LTS","package":"ruby-rack","fixed_in":["2.2.7-1ubuntu0.7"],"sources":["osv"]},{"ecosystem":"Ubuntu:25.10","package":"ruby-rack","fixed_in":["3.1.16-0.1ubuntu0.3"],"sources":["osv"]},{"ecosystem":"Ubuntu:26.04:LTS","package":"ruby-rack","fixed_in":["3.2.4-1ubuntu1.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.2.23"}]}]},{"source":"ghsa","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0.beta1"},{"fixed":"3.1.21"}]}]},{"source":"ghsa","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.2.0"},{"fixed":"3.2.6"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"ruby-rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.2.22-0+deb12u2"}]}],"versions":["2.2.13-1~deb12u1","2.2.20-0+deb12u1","2.2.22-0+deb12u1","2.2.6.4-1","2.2.6.4-1+deb12u1","2.2.7-1","2.2.7-1.1"]},{"source":"osv","ecosystem":"Debian:13","package":"ruby-rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.20-0+deb13u2"}]}],"versions":["3.1.16-0.1","3.1.18-1","3.1.18-1~deb13u1","3.1.20-0+deb13u1"]},{"source":"osv","ecosystem":"Debian:14","package":"ruby-rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.2.6-2"}]}],"versions":["3.1.16-0.1","3.1.18-1","3.1.18-1~deb13u1","3.2.4-1","3.2.5-1","3.2.5-2","3.2.6-1"]},{"source":"osv","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.2.23"}]}],"versions":["0.1.0","0.2.0","0.3.0","0.4.0","0.9.0","0.9.1","1.0.0","1.0.1","1.1.0","1.1.1","1.1.1.pre","1.1.2","1.1.3","1.1.4","1.1.5","1.1.6","1.2.0","1.2.1","1.2.2","1.2.3","1.2.4","1.2.5","1.2.6","1.2.7","1.2.8","1.3.0","1.3.0.beta","1.3.0.beta2","1.3.1","1.3.10","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.8","1.3.9","1.4.0","1.4.1","1.4.2","1.4.3","1.4.4","1.4.5","1.4.6","1.4.7","1.5.0","1.5.0.beta.1","1.5.0.beta.2","1.5.1","1.5.2","1.5.3","1.5.4","1.5.5","1.6.0","1.6.0.beta","1.6.0.beta2","1.6.1","1.6.10","1.6.11","1.6.12","1.6.13","1.6.2","1.6.3","1.6.4","1.6.5","1.6.6","1.6.7","1.6.8","1.6.9","2.0.0.alpha","2.0.0.rc1","2.0.1","2.0.2","2.0.3","2.0.4","2.0.5","2.0.6","2.0.7","2.0.8","2.0.9","2.0.9.1","2.0.9.2","2.0.9.3","2.0.9.4","2.1.0","2.1.1","2.1.2","2.1.3","2.1.4","2.1.4.1","2.1.4.2","2.1.4.3","2.1.4.4","2.2.0","2.2.1","2.2.10","2.2.11","2.2.12","2.2.13","2.2.14","2.2.15","2.2.16","2.2.17","2.2.18","2.2.19","2.2.2","2.2.20","2.2.21","2.2.22","2.2.3","2.2.3.1","2.2.4","2.2.5","2.2.6","2.2.6.1","2.2.6.2","2.2.6.3","2.2.6.4","2.2.7","2.2.8","2.2.8.1","2.2.9"]},{"source":"osv","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0.beta1"},{"fixed":"3.1.21"}]}],"versions":["3.0.0","3.0.0.beta1","3.0.0.rc1","3.0.1","3.0.10","3.0.11","3.0.12","3.0.13","3.0.14","3.0.15","3.0.16","3.0.17","3.0.18","3.0.2","3.0.3","3.0.4","3.0.4.1","3.0.4.2","3.0.5","3.0.6","3.0.6.1","3.0.7","3.0.8","3.0.9","3.0.9.1","3.1.0","3.1.1","3.1.10","3.1.11","3.1.12","3.1.13","3.1.14","3.1.15","3.1.16","3.1.17","3.1.18","3.1.19","3.1.2","3.1.20","3.1.3","3.1.4","3.1.5","3.1.6","3.1.7","3.1.8","3.1.9"]},{"source":"osv","ecosystem":"RubyGems","package":"rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.2.0"},{"fixed":"3.2.6"}]}],"versions":["3.2.0","3.2.1","3.2.2","3.2.3","3.2.4","3.2.5"]},{"source":"osv","ecosystem":"Mageia:9","package":"ruby-rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.2.23-1.mga9"}]}],"bundled":12},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 16.0","package":"rmt-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.0-160000.1.1"}]}],"bundled":10},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP applications 16.0","package":"rmt-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.0-160000.1.1"}]}],"bundled":10},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Public Cloud 15 SP5","package":"rmt-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.27-150500.3.47.1"}]}],"bundled":10},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Public Cloud 15 SP6","package":"rmt-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.27-150500.3.47.1"}]}],"bundled":10},{"source":"osv","ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS","package":"rmt-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.27-150500.3.47.1"}]}],"bundled":10},{"source":"osv","ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS","package":"rmt-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.27-150500.3.47.1"}]}],"bundled":10},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 15 SP5-LTSS","package":"rmt-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.27-150500.3.47.1"}]}],"bundled":10},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 15 SP6-LTSS","package":"rmt-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.27-150500.3.47.1"}]}],"bundled":10},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 15 SP5","package":"rmt-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.27-150500.3.47.1"}]}],"bundled":10},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 15 SP6","package":"rmt-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.27-150500.3.47.1"}]}],"bundled":10},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"ruby-rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.1.4-5ubuntu1.2+esm3"}]}],"versions":["2.1.4-3","2.1.4-4","2.1.4-5","2.1.4-5ubuntu1","2.1.4-5ubuntu1+esm2","2.1.4-5ubuntu1+esm3","2.1.4-5ubuntu1+esm4","2.1.4-5ubuntu1+esm5","2.1.4-5ubuntu1.1","2.1.4-5ubuntu1.1+esm1","2.1.4-5ubuntu1.1+esm2","2.1.4-5ubuntu1.2","2.1.4-5ubuntu1.2+esm1","2.1.4-5ubuntu1.2+esm2"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"ruby-rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.2.7-1ubuntu0.7"}]}],"versions":["2.2.4-3","2.2.7-1","2.2.7-1ubuntu0.1","2.2.7-1ubuntu0.2","2.2.7-1ubuntu0.3","2.2.7-1ubuntu0.4","2.2.7-1ubuntu0.5","2.2.7-1ubuntu0.6"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"ruby-rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.16-0.1ubuntu0.3"}]}],"versions":["2.2.7-1.1","3.1.16-0.1","3.1.16-0.1ubuntu0.1","3.1.16-0.1ubuntu0.2"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"ruby-rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.2.4-1ubuntu1.1"}]}],"versions":["3.1.16-0.1","3.1.18-1","3.1.18-1build1","3.2.4-1ubuntu1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"ruby-rack","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.2.4-1ubuntu1.1"}]}],"versions":["3.1.16-0.1","3.1.18-1","3.1.18-1build1","3.2.4-1ubuntu1"],"bundled":13},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"rubygem-rack-2.2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.2.23-1.1"}]}],"bundled":9},{"source":"osv","ecosystem":"openSUSE:Leap 16.0","package":"rmt-server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.0-160000.1.1"}]}],"bundled":10}],"products":[{"vendor":"rack","product":"rack"}],"references":[{"url":"https://github.com/rack/rack/security/advisories/GHSA-q2ww-5357-x388","tags":["x_refsource_CONFIRM","Vendor Advisory","advisory","web","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-34831","tags":["advisory"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2026-34831.yml","tags":["web"]},{"url":"https://github.com/advisories/GHSA-q2ww-5357-x388"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/34xxx/CVE-2026-34831.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-34831","tags":["advisory"]},{"url":"https://github.com/rack/rack","tags":["package"]},{"url":"https://advisories.mageia.org/MGASA-2026-0226.html","tags":["advisory"]},{"url":"https://bugs.mageia.org/show_bug.cgi?id=35446","tags":["report"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-vgpv-f759-9wx3","tags":["advisory"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-qfgr-crr9-7r49","tags":["advisory"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-v569-hp3g-36wr","tags":["advisory"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-7mqq-6cf9-v2qp","tags":["advisory"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-h2jq-g4cq-5ppq","tags":["advisory"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-q4qf-9j86-f5mh","tags":["advisory"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-x8cg-fq8g-mxfx","tags":["advisory"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-v6x5-cg8r-vv6x","tags":["advisory"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-8vqr-qjwx-82mw","tags":["advisory"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-qv7j-4883-hwh7","tags":["advisory"]},{"url":"https://github.com/rack/rack/security/advisories/GHSA-g2pf-xv49-m2h5","tags":["advisory"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-20261745-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1261388","tags":["report"]},{"url":"https://bugzilla.suse.com/1261398","tags":["report"]},{"url":"https://bugzilla.suse.com/1261406","tags":["report"]},{"url":"https://bugzilla.suse.com/1261417","tags":["report"]},{"url":"https://bugzilla.suse.com/1261426","tags":["report"]},{"url":"https://bugzilla.suse.com/1261436","tags":["report"]},{"url":"https://bugzilla.suse.com/1261447","tags":["report"]},{"url":"https://bugzilla.suse.com/1261458","tags":["report"]},{"url":"https://bugzilla.suse.com/1261466","tags":["report"]},{"url":"https://bugzilla.suse.com/1261471","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2026-26961","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-26962","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-34230","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-34763","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-34785","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-34786","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-34826","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-34829","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-34830","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-34831","tags":["web"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-20261964-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1246976","tags":["report"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-202623321-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1262706","tags":["report"]},{"url":"https://bugzilla.suse.com/1268149","tags":["report"]},{"url":"https://bugzilla.suse.com/1268301","tags":["report"]},{"url":"https://bugzilla.suse.com/1268303","tags":["report"]},{"url":"https://bugzilla.suse.com/1268305","tags":["report"]},{"url":"https://bugzilla.suse.com/1274715","tags":["report"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-20262487-1/","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-34831","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-34831","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-8182-1","tags":["advisory"]},{"url":"https://ubuntu.com/security/notices/USN-8989-1","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-26961","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-26962","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-32762","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-34230","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-34763","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-34785","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-34786","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-34826","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-34827","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-34829","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-34830","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2026-34835","tags":["report"]},{"url":"","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2026-34831","title":"Rack: Content-Length mismatch in Rack::Files error responses","description":"Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, Rack::Files#fail sets the Content-Length response header using String#size instead of String#bytesize. When the response body contains multibyte UTF-8 characters, the declared Content-Length is smaller than the number of bytes actually sent on the wire. Because Rack::Files reflects the requested path in 404 responses, an attacker can trigger this mismatch by requesting a non-existent path containing percent-encoded UTF-8 characters. This results in incorrect HTTP response framing and may cause response desynchronization in deployments that rely on the incorrect Content-Length value. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.","status":"published","published":"2026-04-02T16:43:08.762Z","modified":"2026-04-03T17:48:11.33Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-130","CWE-135"],"updated_at":"2026-11-02T14:20:14.302133Z"}],"euvd":[{"id":"EUVD-2026-18392","description":"Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, Rack::Files#fail sets the Content-Length response header using String#size instead of String#bytesize. When the response body contains multibyte UTF-8 characters, the declared Content-Length is smaller than the number of bytes actually sent on the wire. Because Rack::Files reflects the requested path in 404 responses, an attacker can trigger this mismatch by requesting a non-existent path containing percent-encoded UTF-8 characters. This results in incorrect HTTP response framing and may cause response desynchronization in deployments that rely on the incorrect Content-Length value. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.","status":"published","published":"2026-04-02T16:43:08Z","modified":"2026-04-03T17:48:11Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T19:25:16.550278Z"}],"ghsa":[{"id":"GHSA-q2ww-5357-x388","title":"Rack has Content-Length mismatch in Rack::Files error responses","description":"## Summary\n\n`Rack::Files#fail` sets the `Content-Length` response header using `String#size` instead of `String#bytesize`. When the response body contains multibyte UTF-8 characters, the declared `Content-Length` is smaller than the number of bytes actually sent on the wire.\n\nBecause `Rack::Files` reflects the requested path in 404 responses, an attacker can trigger this mismatch by requesting a non-existent path containing percent-encoded UTF-8 characters.\n\nThis results in incorrect HTTP response framing and may cause response desynchronization in deployments that rely on the incorrect `Content-Length` value.\n\n## Details\n\n`Rack::Files#fail` constructs error responses using logic equivalent to:\n\n```ruby\ndef fail(status, body, headers = {})\n  body += \"\\n\"\n  [\n    status,\n    {\n      \"content-type\" =\u003e \"text/plain\",\n      \"content-length\" =\u003e body.size.to_s,\n      \"x-cascade\" =\u003e \"pass\"\n    }.merge!(headers),\n    [body]\n  ]\nend\n```\n\nHere, `body.size` returns the number of characters, not the number of bytes. For multibyte UTF-8 strings, this produces an incorrect `Content-Length` value.\n\n`Rack::Files` includes the decoded request path in 404 responses. A request containing percent-encoded UTF-8 path components therefore causes the response body to contain multibyte characters, while the `Content-Length` header still reflects character count rather than byte count.\n\nAs a result, the server can send more bytes than declared in the response headers.\n\nThis violates HTTP message framing requirements, which define `Content-Length` as the number of octets in the message body.\n\n## Impact\n\nApplications using `Rack::Files` may emit incorrectly framed error responses when handling requests for non-existent paths containing multibyte characters.\n\nIn some deployment topologies, particularly with keep-alive connections and intermediaries that rely on `Content-Length`, this mismatch may lead to response parsing inconsistencies or response desynchronization. The practical exploitability depends on the behavior of downstream proxies, clients, and connection reuse.\n\nEven where no secondary exploitation is possible, the response is malformed and may trigger protocol errors in strict components.\n\n## Mitigation\n\n* Update to a patched version of Rack that computes `Content-Length` using `String#bytesize`.\n* Avoid exposing `Rack::Files` directly to untrusted traffic until a fix is available, if operationally feasible.\n* Where possible, place Rack behind a proxy or server that normalizes or rejects malformed backend responses.\n* Prefer closing backend connections on error paths if response framing anomalies are a concern.","status":"published","published":"2026-04-02T20:36:10Z","modified":"2026-05-13T16:19:13Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-130","CWE-135"],"updated_at":"2026-11-02T14:40:08.003212Z"}],"nvd":[{"id":"CVE-2026-34831","description":"Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, Rack::Files#fail sets the Content-Length response header using String#size instead of String#bytesize. When the response body contains multibyte UTF-8 characters, the declared Content-Length is smaller than the number of bytes actually sent on the wire. Because Rack::Files reflects the requested path in 404 responses, an attacker can trigger this mismatch by requesting a non-existent path containing percent-encoded UTF-8 characters. This results in incorrect HTTP response framing and may cause response desynchronization in deployments that rely on the incorrect Content-Length value. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.","status":"published","published":"2026-04-02T17:16:26.42Z","modified":"2026-07-24T21:10:00.143Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-130","CWE-135"],"updated_at":"2026-11-02T14:12:12.73929Z"}],"osv":[{"id":"CVE-2026-34831","title":"Rack: Content-Length mismatch in Rack::Files error responses","description":"Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, Rack::Files#fail sets the Content-Length response header using String#size instead of String#bytesize. When the response body contains multibyte UTF-8 characters, the declared Content-Length is smaller than the number of bytes actually sent on the wire. Because Rack::Files reflects the requested path in 404 responses, an attacker can trigger this mismatch by requesting a non-existent path containing percent-encoded UTF-8 characters. This results in incorrect HTTP response framing and may cause response desynchronization in deployments that rely on the incorrect Content-Length value. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.","status":"published","published":"2026-04-02T16:43:08.762Z","modified":"2026-10-28T02:30:26.934149352Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-130","CWE-135"],"updated_at":"2026-11-02T15:45:02.673625Z"},{"id":"DEBIAN-CVE-2026-34831","description":"Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, Rack::Files#fail sets the Content-Length response header using String#size instead of String#bytesize. When the response body contains multibyte UTF-8 characters, the declared Content-Length is smaller than the number of bytes actually sent on the wire. Because Rack::Files reflects the requested path in 404 responses, an attacker can trigger this mismatch by requesting a non-existent path containing percent-encoded UTF-8 characters. This results in incorrect HTTP response framing and may cause response desynchronization in deployments that rely on the incorrect Content-Length value. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.","status":"published","published":"2026-04-02T17:16:26.42Z","modified":"2026-10-01T03:03:22.246683286Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:45:54.587575Z"},{"id":"GHSA-q2ww-5357-x388","title":"Rack has Content-Length mismatch in Rack::Files error responses","description":"## Summary\n\n`Rack::Files#fail` sets the `Content-Length` response header using `String#size` instead of `String#bytesize`. When the response body contains multibyte UTF-8 characters, the declared `Content-Length` is smaller than the number of bytes actually sent on the wire.\n\nBecause `Rack::Files` reflects the requested path in 404 responses, an attacker can trigger this mismatch by requesting a non-existent path containing percent-encoded UTF-8 characters.\n\nThis results in incorrect HTTP response framing and may cause response desynchronization in deployments that rely on the incorrect `Content-Length` value.\n\n## Details\n\n`Rack::Files#fail` constructs error responses using logic equivalent to:\n\n```ruby\ndef fail(status, body, headers = {})\n  body += \"\\n\"\n  [\n    status,\n    {\n      \"content-type\" =\u003e \"text/plain\",\n      \"content-length\" =\u003e body.size.to_s,\n      \"x-cascade\" =\u003e \"pass\"\n    }.merge!(headers),\n    [body]\n  ]\nend\n```\n\nHere, `body.size` returns the number of characters, not the number of bytes. For multibyte UTF-8 strings, this produces an incorrect `Content-Length` value.\n\n`Rack::Files` includes the decoded request path in 404 responses. A request containing percent-encoded UTF-8 path components therefore causes the response body to contain multibyte characters, while the `Content-Length` header still reflects character count rather than byte count.\n\nAs a result, the server can send more bytes than declared in the response headers.\n\nThis violates HTTP message framing requirements, which define `Content-Length` as the number of octets in the message body.\n\n## Impact\n\nApplications using `Rack::Files` may emit incorrectly framed error responses when handling requests for non-existent paths containing multibyte characters.\n\nIn some deployment topologies, particularly with keep-alive connections and intermediaries that rely on `Content-Length`, this mismatch may lead to response parsing inconsistencies or response desynchronization. The practical exploitability depends on the behavior of downstream proxies, clients, and connection reuse.\n\nEven where no secondary exploitation is possible, the response is malformed and may trigger protocol errors in strict components.\n\n## Mitigation\n\n* Update to a patched version of Rack that computes `Content-Length` using `String#bytesize`.\n* Avoid exposing `Rack::Files` directly to untrusted traffic until a fix is available, if operationally feasible.\n* Where possible, place Rack behind a proxy or server that normalizes or rejects malformed backend responses.\n* Prefer closing backend connections on error paths if response framing anomalies are a concern.","status":"published","published":"2026-04-02T20:36:10Z","modified":"2026-09-10T03:51:02.719242615Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-130","CWE-135"],"updated_at":"2026-11-02T15:46:54.055966Z"},{"id":"UBUNTU-CVE-2026-34831","description":"Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, Rack::Files#fail sets the Content-Length response header using String#size instead of String#bytesize. When the response body contains multibyte UTF-8 characters, the declared Content-Length is smaller than the number of bytes actually sent on the wire. Because Rack::Files reflects the requested path in 404 responses, an attacker can trigger this mismatch by requesting a non-existent path containing percent-encoded UTF-8 characters. This results in incorrect HTTP response framing and may cause response desynchronization in deployments that rely on the incorrect Content-Length value. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.","status":"published","published":"2026-04-02T17:16:00Z","modified":"2026-11-04T03:42:04.44700958Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-04T03:56:18.279609Z"},{"id":"MGASA-2026-0226","title":"Updated ruby-rack packages fix security vulnerabilities","description":"CVE-2026-26961 Greedy multipart boundary parsing can cause parser\ndifferentials and WAF bypass. `Forwarded` header semicolon injection\nenables `Host` and `Scheme` spoofing.\nCVE-2026-34230 Quadratic complexity in\n`Rack::Utils.select_best_encoding` via wildcard `Accept-Encoding`\nheader.\nCVE-2026-34763 Root directory disclosure via unescaped regex\ninterpolation in `Rack::Directory`.\nCVE-2026-34785 `Rack::Static` prefix matching can expose unintended\nfiles under the static root.\nCVE-2026-34786 `Rack::Static` `header_rules` bypass via URL-encoded path\nmismatch.\nCVE-2026-34826 Multipart byte range processing allows denial of service\nvia excessive overlapping ranges.\nCVE-2026-34827 Multipart header parsing allows denial of service via\nescape-heavy quoted parameters.\nCVE-2026-34829 Multipart parsing without `Content-Length` header allows\nunbounded chunked file uploads.\nCVE-2026-34830 `Rack::Sendfile` header-based `X-Accel-Mapping` regex\ninjection enables unauthorized `X-Accel-Redirect`.\nCVE-2026-34831 `Content-Length` mismatch in `Rack::Files` error\nresponses.\nCVE-2026-34835 `Rack::Request` accepts invalid Host characters, enabling\nhost allowlist bypass.\n","status":"published","published":"2026-06-18T21:28:22Z","modified":"2026-06-18T21:30:04.563755676Z","updated_at":"2026-11-02T15:49:43.795591Z"},{"id":"openSUSE-SU-2026:10508-1","title":"ruby4.0-rubygem-rack-2.2-2.2.23-1.1 on GA media","description":"These are all security issues fixed in the ruby4.0-rubygem-rack-2.2-2.2.23-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2026-04-08T00:00:00Z","modified":"2026-04-09T08:01:09.703554Z","updated_at":"2026-11-02T16:58:38.415593Z"},{"id":"openSUSE-SU-2026:21640-1","title":"Security update for rmt-server","description":"This update for rmt-server fixes the following issues:\n\nUpdate to version 3.1 (bsc#1274715).\n\nSecurity issues fixed:\n\n- CVE-2026-26961: rack: greedy multipart boundary parsing can lead to parser differentials and WAF bypass\n  (bsc#1261398).\n- CVE-2026-26962: rack: improper unfolding of folded multipart headers can lead to downstream header injection and\n  response splitting(bsc#1261471).\n- CVE-2026-34763: rack: unescaped regex interpolation of configured root path can lead to root directory disclosure\n  (bsc#1261406).\n- CVE-2026-34230: rack: crafted `Accept-Encoding` headers can cause a denial of service (bsc#1261388).\n- CVE-2026-34785: rack: prefix matching logic can lead to the exposure of unintended files under the static root\n  (bsc#1261417).\n- CVE-2026-34786: rack: URL-encoded path mismatch can lead to `header_rules` bypass (bsc#1261426).\n- CVE-2026-34826: rack: missing individual byte range limit checks when parsing HTTP `Range` headers can lead to\n  excessive resource consumption and a denial of service (bsc#1261436).\n- CVE-2026-34829: rack: multipart parsing without `Content-Length` header can lead to unbounded chunked file uploads\n  and a denial of service (bsc#1261447).\n- CVE-2026-34230: rack: quadratic complexity when processing of wildcard `Accept-Encoding` headers can lead to a denial\n  of service (bsc#1261388).\n- CVE-2026-34830: rack: improper sanitization of the `X-Accel-Mapping` request header can lead to the exposure of\n  unintended files via `X-Accel-Redirect` (bsc#1261458).\n- CVE-2026-34831: rack: `Content-Length` header and body byte size mismatch when creating error responses can lead to\n  incorrect HTTP response framing (bsc#1261466).\n\nOther updates and bugfixes:\n\n- Version 3.1:\n  * Remove all errors and warnigs due to new Ruby and Ruby on Rails versions\n- Version 2.28:\n  * Set arch to unknown for Rancher based products (jsc#SCC-759)\n  * Fix purge for large amount of systems (bsc#1262706)\n  * Change data type to `MEDIUMTEXT` in profiles table (bsc#1268305)\n  * Remove `proxy_byos` column\n  * Fix race condition when no system matches (bsc#1268301)\n  * Fix race condition for PAYG (bsc#1268149)\n  * Fix race condition to update a system (bsc#1268303)\n- Version 2.27:\n  * Fix ReDoS vulnerability in `Addressable`\n  * Fixes out-of-bounds read vulnerability in `rdiscount`\n","status":"published","published":"2026-08-25T06:34:56Z","modified":"2026-08-27T18:23:12.978274573Z","updated_at":"2026-11-02T16:58:41.885092Z"},{"id":"SUSE-SU-2026:1745-1","title":"Security update for rmt-server","description":"This update for rmt-server fixes the following issues:\n\nUpdate to version 2.27.\n\nSecurity issues fixed:\n\n- CVE-2026-26961: rack: greedy multipart boundary parsing can lead to parser differentials and WAF bypass\n  (bsc#1261398).\n- CVE-2026-26962: rack: improper unfolding of folded multipart headers can lead to downstream header injection and\n  response splitting(bsc#1261471).  \n- CVE-2026-34763: rack: unescaped regex interpolation of configured root path can lead to root directory disclosure\n  (bsc#1261406).\n- CVE-2026-34785: rack: prefix matching logic can lead to the exposure of unintended files under the static root\n  (bsc#1261417).\n- CVE-2026-34786: rack: URL-encoded path mismatch can lead to `header_rules` bypass (bsc#1261426).\n- CVE-2026-34826: rack: missing individual byte range limit checks when parsing HTTP `Range` headers can lead to\n  excessive resource consumption and a denial of service (bsc#1261436).\n- CVE-2026-34829: rack: multipart parsing without `Content-Length` header can lead to unbounded chunked file uploads\n  and a denial of service (bsc#1261447).\n- CVE-2026-34230: rack: quadratic complexity when processing of wildcard `Accept-Encoding` headers can lead to a denial\n  of service (bsc#1261388).  \n- CVE-2026-34830: rack: improper sanitization of the `X-Accel-Mapping` request header can lead to the exposure of\n  unintended files via `X-Accel-Redirect` (bsc#1261458).\n- CVE-2026-34831: rack: `Content-Length` header and body byte size mismatch when creating error responses can lead to\n  incorrect HTTP response framing (bsc#1261466).\n\nOther updates and bugfixes:\n\n- Fix ReDoS in `Addressable`.\n- Fix out-of-bounds read in `rdiscount`.\n","status":"published","published":"2026-05-07T07:22:43Z","modified":"2026-05-08T08:15:48.775796Z","updated_at":"2026-11-02T15:54:01.610851Z"},{"id":"SUSE-SU-2026:1964-1","title":"Security update for rmt-server","description":"This update for rmt-server fixes the following issues\n\n- CVE-2026-26961: rack: mismatch in header handling can allow to smuggle multipart content (bsc#1261398).\n- CVE-2026-26962: rack: improper unfolding of folded multipart headers can lead to header injection or response\n  splitting (bsc#1261471).\n- CVE-2026-34230: rack: crafted Accept-Encoding header can cause a denial of service (bsc#1261388).\n- CVE-2026-34763: rack: failing of the prefix stripping can lead to information disclosure (bsc#1261406).\n- CVE-2026-34785: rack: prefix matching can expose unintended files under the static root (bsc#1261417).\n- CVE-2026-34786: rack: URL-encoded path mismatch can lead to `header_rules` bypass (bsc#1261426).\n- CVE-2026-34826: rack: multipart byte range processing can allow denial of service (bsc#1261436).\n- CVE-2026-34829: rack: multipart parsing without `Content-Length` header allows unbounded chunked file uploads\n  (bsc#1261447).\n- CVE-2026-34830: rack: crafted `X-Accel-Mapping`headers can lead to regex injection (bsc#1261458).\n- CVE-2026-34831: rack: `Content-Length` mismatch can lead to incorrectly framed error responses (bsc#1261466).\n\nOther fixes:\n\n- Update to version 2.27\n","status":"published","published":"2026-05-18T08:10:04Z","modified":"2026-05-19T08:45:12.089394872Z","updated_at":"2026-11-02T15:54:01.610851Z"},{"id":"SUSE-SU-2026:23321-1","title":"Security update for rmt-server","description":"This update for rmt-server fixes the following issues:\n\nUpdate to version 3.1 (bsc#1274715).\n\nSecurity issues fixed:\n\n- CVE-2026-26961: rack: greedy multipart boundary parsing can lead to parser differentials and WAF bypass\n  (bsc#1261398).\n- CVE-2026-26962: rack: improper unfolding of folded multipart headers can lead to downstream header injection and\n  response splitting(bsc#1261471).\n- CVE-2026-34763: rack: unescaped regex interpolation of configured root path can lead to root directory disclosure\n  (bsc#1261406).\n- CVE-2026-34230: rack: crafted `Accept-Encoding` headers can cause a denial of service (bsc#1261388).\n- CVE-2026-34785: rack: prefix matching logic can lead to the exposure of unintended files under the static root\n  (bsc#1261417).\n- CVE-2026-34786: rack: URL-encoded path mismatch can lead to `header_rules` bypass (bsc#1261426).\n- CVE-2026-34826: rack: missing individual byte range limit checks when parsing HTTP `Range` headers can lead to\n  excessive resource consumption and a denial of service (bsc#1261436).\n- CVE-2026-34829: rack: multipart parsing without `Content-Length` header can lead to unbounded chunked file uploads\n  and a denial of service (bsc#1261447).\n- CVE-2026-34230: rack: quadratic complexity when processing of wildcard `Accept-Encoding` headers can lead to a denial\n  of service (bsc#1261388).\n- CVE-2026-34830: rack: improper sanitization of the `X-Accel-Mapping` request header can lead to the exposure of\n  unintended files via `X-Accel-Redirect` (bsc#1261458).\n- CVE-2026-34831: rack: `Content-Length` header and body byte size mismatch when creating error responses can lead to\n  incorrect HTTP response framing (bsc#1261466).\n\nOther updates and bugfixes:\n\n- Version 3.1:\n  * Remove all errors and warnigs due to new Ruby and Ruby on Rails versions\n- Version 2.28:\n  * Set arch to unknown for Rancher based products (jsc#SCC-759)\n  * Fix purge for large amount of systems (bsc#1262706)\n  * Change data type to `MEDIUMTEXT` in profiles table (bsc#1268305)\n  * Remove `proxy_byos` column\n  * Fix race condition when no system matches (bsc#1268301)\n  * Fix race condition for PAYG (bsc#1268149)\n  * Fix race condition to update a system (bsc#1268303)\n- Version 2.27:\n  * Fix ReDoS vulnerability in `Addressable`\n  * Fixes out-of-bounds read vulnerability in `rdiscount`\n","status":"published","published":"2026-08-25T06:34:19Z","modified":"2026-09-10T18:23:10.500108459Z","updated_at":"2026-11-02T15:54:03.503431Z"},{"id":"SUSE-SU-2026:2487-1","title":"Security update for rmt-server","description":"This update for rmt-server fixes the following issues\n\n- CVE-2026-26961: rack: mismatch in header handling can allow to smuggle multipart content (bsc#1261398).\n- CVE-2026-26962: rack: improper unfolding of folded multipart headers can lead to header injection or response\n  splitting (bsc#1261471).\n- CVE-2026-34230: rack: crafted Accept-Encoding header can cause a denial of service (bsc#1261388).\n- CVE-2026-34763: rack: failing of the prefix stripping can lead to information disclosure (bsc#1261406).\n- CVE-2026-34785: rack: prefix matching can expose unintended files under the static root (bsc#1261417).\n- CVE-2026-34786: rack: URL-encoded path mismatch can lead to `header_rules` bypass (bsc#1261426).\n- CVE-2026-34826: rack: multipart byte range processing can allow denial of service (bsc#1261436).\n- CVE-2026-34829: rack: multipart parsing without `Content-Length` header allows unbounded chunked file uploads\n  (bsc#1261447).\n- CVE-2026-34830: rack: crafted `X-Accel-Mapping`headers can lead to regex injection (bsc#1261458).\n- CVE-2026-34831: rack: `Content-Length` mismatch can lead to incorrectly framed error responses (bsc#1261466).\n\nChanges for rmt-server:\n\n- Updated to version 2.27\n","status":"published","published":"2026-06-22T12:08:31Z","modified":"2026-06-24T09:00:14.591265313Z","updated_at":"2026-11-02T15:54:04.519245Z"},{"id":"USN-8989-1","title":"ruby-rack vulnerabilities","description":"Andrew Lacambra discovered that Rack did not properly parse certain regular\nexpressions. An attacker could possibly use this issue to bypass network\nsecurity filters. (CVE-2026-26961)\n\nWilliam T. Nelson discovered that Rack did not handle multipart headers\ncorrectly. An attacker could possibly use this issue to cause downstream\nparsing issues or a denial of service. (CVE-2026-26962)\n\nIt was discovered that Rack did not handle the Forwarded header correctly.\nAn attacker could possibly use this issue to manipulate header values.\n(CVE-2026-32762)\n\nIt was discovered that Rack could consume excessive CPU when handling\ncertain Accept-Encoding values. An attacker could possibly use this issue\nto cause a denial of service. (CVE-2026-34230)\n\nHaruki Oyama discovered that certain configurations of Rack could\nerroneously fail to derive the displayed directory path, and expose the\nfull file system path. An attacker could possibly use this issue to\ndisclose deployment details such as layout and usernames. (CVE-2026-34763)\n\nIt was discovered that Rack did not properly handle static file paths. An\nattacker could possibly use this issue to exfiltrate unintentionally served\ndata. (CVE-2026-34785)\n\nHaruki Oyama discovered that Rack did not apply header rules to certain\nrequests for URL-encoded static paths. An attacker could possibly use this\nissue to bypass security-relevant response headers. (CVE-2026-34786)\n\nIt was discovered that Rack did not limit the number of ranges requested in\nthe Range header. An attacker could possibly use this issue to cause a\ndenial of service. (CVE-2026-34826)\n\nIt was discovered that Rack could consume excessive CPU when parsing\ncertain multipart parameters. An attacker could possibly use this issue to\ncause a denial of service. (CVE-2026-34827)\n\nIt was discovered that Rack could consume unbounded disk space when\nhandling requests without a Content-Length header. An attacker could\npossibly use this issue to cause a denial of service. (CVE-2026-34829)\n\nMehtab Zafar discovered that Rack directly interpreted the X-Accel-Mapping\nheader as a regular expression without escaping. An attacker could possibly\nuse this issue to exfiltrate arbitrary files from internal locations.\n(CVE-2026-34830)\n\nIt was discovered that Rack did not properly handle messages with Unicode.\nAn attacker could possibly use this issue to cause a denial of service.\n(CVE-2026-34831)\n\nIt was discovered that Rack did not properly parse the Host header. An\nattacker could possibly use this issue to bypass security filters or poison\ngenerated links. (CVE-2026-34835)","status":"published","published":"2026-11-03T17:12:03Z","modified":"2026-11-04T03:43:07.892494882Z","updated_at":"2026-11-04T03:56:18.279609Z"}]}}
