CVE-2026-34785 Rack: Local file inclusion in `Rack::Static` via URL Prefix Matching
Attackers can read sensitive files by exploiting prefix matching in Rack::Static, requiring specific configuration to expose unintended files.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-34785?
CVE-2026-34785 is a high-severity path traversal vulnerability in rack, published on 2 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Which versions are affected by CVE-2026-34785?
6 open source packages ship an affected version, including rack. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
rack RubyGems | All versions | 2.2.23 |
rack RubyGems | All versions | 2.2.23 |
rack RubyGems | From 3.0.0.beta1 | 3.1.21 |
rack RubyGems | From 3.0.0.beta1 | 3.1.21 |
rack RubyGems | From 3.2.0 | 3.2.6 |
rack RubyGems | From 3.2.0 | 3.2.6 |
Products include Rack Rack.
How do I fix CVE-2026-34785?
Upgrade rack to a fixed version for your release line: 2.2.23, 3.1.21 or 3.2.6.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2026-34785 being exploited?
There is no known exploitation of CVE-2026-34785 in the wild and no public exploit code.
Other vulnerabilities in rack
- CVE-2026-34827 Rack: Algorithmic-Complexity DoS in Rack::Multipart::Parser
- CVE-2026-34829 Rack: Denial of Service via Unbounded Multipart File Upload Without Content-Length
- CVE-2026-22860 Rack has a Directory Traversal via Rack:Directory
- CVE-2025-61919 Rack is vulnerable to a memory-exhaustion DoS through unbounded URL-encoded body parsing
- CVE-2025-61770 Rack's unbounded multipart preamble buffering enables DoS (memory exhaustion)
Sources
Also known as DEBIAN-CVE-2026-34785, GHSA-h2jq-g4cq-5ppq, MINI-2rjv-48v3-hp9w, MINI-2vpc-fx7j-9jqx, MINI-3r9g-3cm3-m7hr, MINI-3vmh-r8r5-pgpr and 21 more.