CVE-2026-34831
Rack: Content-Length mismatch in Rack::Files error responses
Reported by github_m · Published April 2, 2026
rack is fixed in 3.2.6, 3.1.21 and 2.2.23 (RubyGems)
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.
EPSS 0.16% · 4.7th percentile
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| rack | RubyGems | 3.2.6, 3.1.21, 2.2.23 |
| ruby3.3-rack-2.2 | Wolfi | 2.2.23-r0 |
| kube-fluentd-operator | Chainguard | 1.18.2-r67 |
| gitlab-rails-ce-fips-18.9 | Chainguard | 18.9.6-r0 |
| logstash-9.1 | Wolfi | 9.1.10-r6 |
| logstash-9.2 | Chainguard | 9.2.8-r2 |
| gitlab-cng-18.8 | Chainguard | 18.8.9-r0 |
| pact-broker-docker | Chainguard | 2.137.0.2.118.0-r4 |
| gitlab-rails-ce-18.8 | Chainguard | 18.8.10-r0 |
| gitlab-rails-ce-18.9 | Chainguard | 18.9.6-r0 |
| ruby3.2-rails-7.2 | Chainguard | 7.2.3.1-r2, 7.2.3.1-r1 |
| logstash-9.3 | Chainguard | 9.3.3-r2 |
14 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| rack | rack | < 2.2.23, >= 3.0.0.beta1, < 3.1.21, >= 3.2.0, < 3.2.6 |
| rack | rack | 3.2.0, >= 3.0.0.beta1, < 3.1.21 |
Timeline
- Apr 2, 2026 CVE Published
- Apr 2, 2026 CVE Updated
- May 13, 2026 Security Advisory
- May 18, 2026 EPSS Score (30 in total, the first dated here)
- Jun 11, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2026-34831
vulnetix vdb fixes CVE-2026-34831
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2026-34831/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/rack/rack/security/advisories/GHSA-q2ww-5357-x388 x_refsource_CONFIRM