CVE-2026-34830 Rack: Rack::Sendfile regex injection via HTTP_X_ACCEL_MAPPING header allows arbitrary file reads through nginx
Attackers can inject regex metacharacters via HTTP headers to bypass file restrictions and read arbitrary files from nginx internal locations.
- 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-34830?
CVE-2026-34830 is a medium-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::Sendfile#map_accel_path interpolates the value of the X-Accel-Mapping request header directly into a regular expression when rewriting file paths for X-Accel-Redirect. Because the header value is not escaped, an attacker who can supply X-Accel-Mapping to the backend can inject regex metacharacters and control the generated X-Accel-Redirect response header. In deployments using Rack::Sendfile with x-accel-redirect, this can allow an attacker to cause nginx to serve unintended files from configured internal locations. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.
Weakness: CWE-625
Which versions are affected by CVE-2026-34830?
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-34830?
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-34830 being exploited?
There is no known exploitation of CVE-2026-34830 in the wild and no public exploit code.
Other vulnerabilities in rack
- CVE-2026-34785 Rack: Local file inclusion in `Rack::Static` via URL Prefix Matching
- 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
Sources
Also known as DEBIAN-CVE-2026-34830, GHSA-qv7j-4883-hwh7, MINI-2v26-hfm2-jc48, MINI-2x9j-83v7-439j, MINI-48p3-8q98-w6qq, MINI-4rqm-rwgw-ggc2 and 21 more.