What’s Vulnerable › Vulnerabilities
CVE-2026-34785: Rack: Local file inclusion in `Rack::Static` via URL Prefix Matching
- Severity: high (CVSS 7.5 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.4% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2026-04-02 · updated 2026-07-24
- Weakness: CWE-187
Description
Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, Rack::Static determines whether a request should be served as a static file using a simple string prefix check. When configured with URL prefixes such as "/css", it matches any request path that begins with that string, including unrelated paths such as "/css-config.env" or "/css-backup.sql". As a result, files under the static root whose names merely share the configured prefix may be served unintentionally, leading to information disclosure. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.
Affected products
- rack: before 2.2.23; from 3.0.0 before 3.1.21; from 3.2.0 before 3.2.6 — fixed in 2.2.23, 3.1.21, 3.2.6
- Rubygems Rack: before 2.2.23; from 3.0.0.beta1 before 3.1.21; from 3.2.0 before 3.2.6; 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.9.0, 0.9.1 (+169) — fixed in 2.2.23, 3.1.21, 3.2.6
How to fix
Upgrade to a fixed version: rack 2.2.23, 3.1.21, 3.2.6; Rubygems Rack 2.2.23, 3.1.21, 3.2.6. Check the vendor advisory for mitigations.
References
- https://github.com/rack/rack/security/advisories/GHSA-h2jq-g4cq-5ppq
- https://access.redhat.com/security/cve/CVE-2026-34785
- https://bugzilla.redhat.com/show_bug.cgi?id=2454486
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-34785.json
Get alerted when CVE-2026-34785 or the next vulnerability affects your stack