CVE-2026-34830: Rack Rack regular expression injection in Rack::Sendfile

CVE-2026-34830 · Severity: medium · CVSS 5.9 · Published 2026-04-02

Rack is a widely used interface for Ruby web applications that helps manage how web servers communicate with application code. A security flaw in its file-handling component could allow an attacker to trick the web server into serving private or internal files that should not be accessible to the public. This occurs when a specific technical header is manipulated to bypass intended security boundaries, potentially leading to the exposure of sensitive system data.

Technologies: rack (RubyGems). Vendors: RubyGems.

Quick answers

Is CVE-2026-34830 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-34830 being exploited in the wild.
How severe is CVE-2026-34830?
Medium severity, with a CVSS score of 5.9, published 2 April 2026.
Which products and versions are affected?
rack (RubyGems) ECOSYSTEM:introduced=0,fixed=2.2.23.
Is there a fix for CVE-2026-34830?
Yes. rack (RubyGems): upgrade to 2.2.23 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-34830 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-34830?
Check whether you run rack (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • rack (RubyGems): upgrade to 2.2.23 or later
    bundle update rack

Technical details

A regular expression injection vulnerability exists in Rack::Sendfile#map_accel_path. The component interpolates the value of the X-Accel-Mapping request header directly into a regular expression without proper escaping during path rewriting for X-Accel-Redirect. An attacker who can provide a crafted X-Accel-Mapping header to the backend can use regex metacharacters (e.g., '.*') to manipulate the resulting X-Accel-Redirect response header. This allows the attacker to bypass path restrictions and force the frontend proxy (like nginx) to serve unintended files from internal locations. The vulnerability is exploitable if the reverse proxy fails to strip or overwrite client-supplied X-Accel-Mapping headers. Patches are available in versions 2.2.23, 3.1.21, and 3.2.6.

Affected products

  • Rack Rack < 2.2.23, >= 3.0.0.beta1 < 3.1.21, >= 3.2.0 < 3.2.6

Identifiers

  • CVE-2026-34830
  • GHSA-qv7j-4883-hwh7

Timeline

  • 2026-04-01: advisory: GitHub Security Advisory published by maintainers
  • 2026-04-02: disclosed: CVE published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.