CVE-2026-34786: Rack Vulnerability Allows Header Rules Bypass via URL-Encoding

rack Updated 02 Apr 2026

Summary

02/04/2026
Yes i
Moderate
5.3

CVE-2026-34786: Rack:: Static header_rules bypass via URL-encoded paths. Affects rack across 3 version ranges.

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

Fixed in 2.2.23, 3.1.21 or 3.2.6, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Rack is a modular Ruby web server interface that serves as a foundation for web applications. It provides a simple interface for handling HTTP requests and responses, allowing developers to build web applications with ease. Rack::Static is a middleware component that serves static files, such as images, stylesheets, and JavaScript, while applying specified response headers for security and caching. However, a vulnerability in Rack::Static allows attackers to bypass security headers by using URL-encoded paths, which can lead to significant security risks.

Vulnerability Detail

The vulnerability arises from the way Rack::Static evaluates header_rules against the raw URL-encoded PATH_INFO. The checks for header_rules are performed on the encoded path, while the underlying file-serving path is decoded before serving the file. This mismatch allows an attacker to request an encoded variant of a static file path, which can serve the same file without the intended security headers. As a result, security measures such as clickjacking defenses or content restrictions may be bypassed, depending on the configured rules and the types of files being served.

How To Fix

Latest published version: 3.2.7 as of 23 Oct 2026

gem install rack -v 3.2.7

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.2.23 2.2.23
    gem install rack -v 2.2.23
  • >= 3.0.0.beta1, < 3.1.21 3.1.21
    gem install rack -v 3.1.21
  • >= 3.2.0, < 3.2.6 3.2.6
    gem install rack -v 3.2.6

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, do not rely solely on Rack::Static header_rules for security-critical headers. Instead, consider setting security headers at the reverse proxy or web server layer to ensure they apply consistently to both encoded and unencoded path forms. Additionally, normalize or reject encoded path variants for static content at the edge, where feasible.

Conclusion

In summary, CVE-2026-34786 is a vulnerability in the Rack library that allows attackers to bypass security headers for static files served by Rack::Static. It is crucial to update to the patched versions of Rack to mitigate this risk and consider implementing additional security measures at the web server layer.

See every vulnerability recorded for rack →

Share this vulnerability

FAQ

CVE-2026-34786 is a vulnerability in the Rack library that allows attackers to bypass security headers by using URL-encoded paths.

If your application relies on Rack::Static for serving static files with security headers, this vulnerability can allow attackers to access those files without the intended protections.

You should update your Rack package to one of the patched versions: 2.2.23, 3.1.21, or 3.2.6.

Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

The CVSS score of this vulnerability is 5.3, indicating a moderate level of severity.

Related vulnerabilities

Recent vulnerabilities recorded for rack.

How To Fix

Latest published version: 3.2.7 as of 23 Oct 2026

gem install rack -v 3.2.7

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.2.23 2.2.23
    gem install rack -v 2.2.23
  • >= 3.0.0.beta1, < 3.1.21 3.1.21
    gem install rack -v 3.1.21
  • >= 3.2.0, < 3.2.6 3.2.6
    gem install rack -v 3.2.6

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback