CVE-2026-34830 Rack: Rack::Sendfile regex injection via HTTP_X_ACCEL_MAPPING header allows arbitrary file reads through nginx

Medium 5.9 Published Updated

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.

PackageAffectedFixed in
rack RubyGemsAll versions2.2.23
rack RubyGemsAll versions2.2.23
rack RubyGemsFrom 3.0.0.beta13.1.21
rack RubyGemsFrom 3.0.0.beta13.1.21
rack RubyGemsFrom 3.2.03.2.6
rack RubyGemsFrom 3.2.03.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.

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.

Is CVE-2026-34830 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free