CVE-2026-34785: Rack Rack::Static information disclosure via partial string matching

CVE-2026-34785 · Severity: high · CVSS 7.5 · 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 flaw in how it handles static files (like images or stylesheets) allows unauthorized users to access sensitive files that should be private. This could lead to the exposure of configuration files, database backups, or security credentials if they are stored in the same directory as public assets.

Technologies: rack (RubyGems). Vendors: RubyGems.

Quick answers

Is CVE-2026-34785 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-34785 being exploited in the wild.
How severe is CVE-2026-34785?
High severity, with a CVSS score of 7.5, 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-34785?
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-34785 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-34785?
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

The Rack::Static component performs static-route matching using a simple string prefix check (path.index(url) == 0) without enforcing path segment boundaries. When a URL prefix like '/css' is configured, the logic matches any request path starting with that string, such as '/css-config.env' or '/css-backup.sql', rather than just files within a '/css/' directory. An unauthenticated remote attacker can exploit this to download sensitive files located in the static root that happen to share a filename prefix with a permitted static directory. The issue is fixed in versions 2.2.23, 3.1.21, and 3.2.6 by ensuring matches occur only on exact prefix matches or at path boundaries.

Affected products

  • Rack Rack < 2.2.23, >= 3.0.0.beta1 < 3.1.21, >= 3.2.0 < 3.2.6
  • Red Hat Red Hat Satellite 6 6

Identifiers

  • CVE-2026-34785
  • GHSA-h2jq-g4cq-5ppq

Timeline

  • 2026-04-01: advisory: GitHub Security Advisory published
  • 2026-04-02: disclosed: NVD publication date
  • 2026-04-02: patched: Patched versions released

References

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