{"id":"CVE-2026-34831","published":"2026-04-02T16:43:08Z","modified":"2026-04-03T17:48:11Z","title":"Rack: Content-Length mismatch in Rack::Files error responses","vendor":"rack","product":"rack","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":4.8,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00156,"percentile":0.04819,"provenance":"source"},"cwes":[{"id":"CWE-130","name":"Improper Handling of Length Parameter Inconsistency"},{"id":"CWE-135","name":"Incorrect Calculation of Multi-Byte String Length"}],"references":[{"url":"https://github.com/rack/rack/security/advisories/GHSA-q2ww-5357-x388","tags":["x_refsource_CONFIRM"]}],"priority":{"score":4.3,"factors":[{"name":"EPSS percentile","points":0.96},{"name":"CVSS severity","points":3.36}]},"vendorSlug":"rack","affectedVersions":[{"vendor":"rack","product":"rack","versions":["< 2.2.23",">= 3.0.0.beta1, < 3.1.21",">= 3.2.0, < 3.2.6"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-04-03T17:43:52.462237Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"RubyGems","package":"rack","vulnerableRanges":["<2.2.23",">=3.0.0.beta1, <3.1.21",">=3.2.0, <3.2.6"],"patched":["2.2.23","3.1.21","3.2.6"],"from":["GHSA-q2ww-5357-x388"],"provenance":"source"}],"summary":{"text":"The Rack::Files error response path in the rack gem computes the Content-Length header with String#size instead of String#bytesize, so responses containing multibyte UTF-8 characters declare a length shorter than the bytes actually sent. An unauthenticated remote attacker can exploit this by requesting a non-existent path containing percent-encoded UTF-8 characters, which the server reflects in its 404 response; this requires a high-complexity condition and may lead to response desynchronization in deployments that rely on the incorrect Content-Length.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:21:52Z"},"euvd":{"id":"EUVD-2026-18392","exploited":false,"provenance":"source"}}