Back to list

Rack has Content-Length mismatch in Rack::Files error responses — CVE-2026-34831

GitHub · GitHub · CVE-2026-34831

ID
CVE-2026-34831
Date
Updated
Activity
Source
GitHub
Vendor
GitHub
Threat
medium
CVSS
4.8
EPSS
0.00041

Summary

## Summary `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…

Product

rubygems: rack

What to do

General, cautious steps (verify details in the official source):

  • Review exposure and plan remediation based on risk and environment.
  • Identify affected product versions in your inventory and verify whether you are impacted.
  • Apply vendor patches/updates or recommended mitigations as soon as available.
  • Read the official advisory for exact affected versions and remediation steps.

Official advisory

Related advisories