{"id":"CVE-2026-34831","state":"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.","publishedAt":"2026-04-02T16:43:08.762Z","updatedAt":"2026-04-03T17:48:11.330Z","severity":{"score":4.8,"label":"Medium","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","source":"GitHub_M"},"assigner":"GitHub_M","products":["rack rack"],"affected":[{"vendor":"rack","product":"rack","versions":[{"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"}]}],"references":["https://github.com/rack/rack/security/advisories/GHSA-q2ww-5357-x388"],"weaknesses":["CWE-130","CWE-135"],"ingestedAt":"2026-10-29T20:11:40.391Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/34xxx/CVE-2026-34831.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-34831","state":"PUBLISHED","datePublished":"2026-04-02T16:43:08.762Z","dateUpdated":"2026-04-03T17:48:11.330Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-03-30T20:52:53.284Z"},"containers":{"cna":{"title":"Rack: Content-Length mismatch in Rack::Files error responses","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"rack","product":"rack","versions":[{"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"}]}],"references":[{"url":"https://github.com/rack/rack/security/advisories/GHSA-q2ww-5357-x388","name":"https://github.com/rack/rack/security/advisories/GHSA-q2ww-5357-x388","tags":["x_refsource_CONFIRM"]}],"metrics":[{"cvssV3_1":{"attackComplexity":"HIGH","attackVector":"NETWORK","availabilityImpact":"NONE","baseScore":4.8,"baseSeverity":"MEDIUM","confidentialityImpact":"LOW","integrityImpact":"LOW","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-130","lang":"en","description":"CWE-130: Improper Handling of Length Parameter Inconsistency","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-135","lang":"en","description":"CWE-135: Incorrect Calculation of Multi-Byte String Length","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-04-02T16:43:08.762Z"},"source":{"advisory":"GHSA-q2ww-5357-x388","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-04-03T17:43:52.462237Z","id":"CVE-2026-34831","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-04-03T17:48:11.330Z"}}]}}}