CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-34786

CVE-2026-34786: Security Header Bypass in Rack::Static via Path Canonicalization Flaw

Amit Schendel
Amit Schendel
Senior Security Researcher

Apr 2, 2026·4 min read·51 visits

Executive Summary (TL;DR)

Rack::Static evaluates security header rules against raw URL paths before decoding them. Requesting an encoded file extension (e.g., %2ejs) bypasses header rules (like CSP) while still serving the requested file.

A canonicalization vulnerability in the Rack Ruby gem's Rack::Static middleware allows attackers to bypass security header rules. By supplying URL-encoded paths, an attacker can evade pattern-matching logic while still retrieving the targeted static files.

Vulnerability Overview

Rack middleware uses Rack::Static to serve static files and apply security headers based on path patterns. The middleware evaluates these rules against the raw, unescaped PATH_INFO string extracted from the HTTP request.

A discrepancy exists because the underlying file-serving logic, typically handled by Rack::File, URI-decodes the path before accessing the filesystem. This canonicalization mismatch allows an attacker to manipulate the request path with URL encoding to evade the initial checks.

The flaw is tracked as CWE-180 (Incorrect Behavior Order: Validate Before Canonicalize). By encoding characters critical to pattern matching, such as replacing a file extension dot with %2E, an attacker bypasses the header rules but still retrieves the intended file.

Root Cause Analysis

The vulnerability originates in the Rack::Static#applicable_rules method located in lib/rack/static.rb. This method iterates through configured matching rules, including arrays of file extensions, strings, and regular expressions, to determine which HTTP headers apply to a given request.

During the evaluation phase, the path variable strictly contains the raw PATH_INFO value. If a developer defines a rule applying a Content-Security-Policy header to all .js files, the regex generated by the middleware literalizes the dot character.

When a request specifies an encoded extension like %2ejs, the exact string match fails against the regex expecting .js. The rules engine concludes no headers are required, while the subsequent file-serving layer decodes the path and successfully locates the file on disk.

Code Analysis

The vulnerable implementation processes the raw path directly within the rule evaluation block. The regular expression dynamically created from array inputs expects literal dot characters preceding the file extension, leading to the mismatch when URL encoding is used.

def applicable_rules(path)
  @header_rules.find_all do |rule, new_headers|
    case rule
    # ...
    when Array
      /\.(#{rule.join('|')})\z/.match?(path)
    end
  end
end

The patch addresses this by enforcing canonicalization prior to validation. The path variable is explicitly decoded using ::Rack::Utils.unescape_path(path) before any rule matching occurs.

def applicable_rules(path)
  # Fix: Decode the path once before matching
  path = ::Rack::Utils.unescape_path(path)
 
  @header_rules.find_all do |rule, new_headers|
    case rule
    # ...
    when Array
      # Fix: Safely construct regex with union
      /\.#{Regexp.union(rule)}\z/.match?(path)
    end
  end
end

Exploitation

Exploitation requires a target application utilizing Rack::Static to serve files while enforcing security rules based on file extensions or paths. The attacker must understand the applied rules and the location of the static assets.

The attacker crafts an HTTP request where the file extension separator is URL-encoded. For example, instead of requesting /js/app.js, the attacker requests /js/app%2ejs.

The middleware processes /js/app%2ejs, failing to match the js header rule. The file server then decodes the path to /js/app.js and serves the file, bypassing the security controls.

Impact Assessment

The immediate impact is the circumvention of intended security policies applied to static files. This primarily affects defensive headers such as Content-Security-Policy (CSP), X-Frame-Options, and Cache-Control.

Bypassing CSP on JavaScript or HTML files facilitates Cross-Site Scripting (XSS) if the served files process untrusted input. The lack of X-Frame-Options exposes the application to UI redressing and Clickjacking attacks.

The vulnerability carries a CVSS v3.1 score of 5.3 (Medium), reflecting the requirement for chaining with other flaws to achieve direct compromise. The confidentiality, integrity, and availability of the underlying server infrastructure remain unaffected.

Remediation

Upgrading the Rack gem is the primary and complete remediation for this vulnerability. Administrators must update deployments to versions 2.2.23, 3.1.21, or 3.2.6.

If an immediate upgrade is unfeasible, administrators can deploy defensive configuration rules at the reverse proxy or web server layer. Configuring Nginx or Apache to reject requests containing URL-encoded dots (%2E or %2e) in static asset paths mitigates the bypass.

After applying the patch, security teams should verify the fix by requesting statically served files using encoded extensions. A successful remediation will apply the configured security headers uniformly across standard and encoded path requests.

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Affected Systems

Ruby Rack applications utilizing the Rack::Static middleware

Affected Versions Detail

Product
Affected Versions
Fixed Version
Rack (Ruby Gem)
Rack
< 2.2.232.2.23
Rack (Ruby Gem)
Rack
>= 3.0.0.beta1, < 3.1.213.1.21
Rack (Ruby Gem)
Rack
>= 3.2.0, < 3.2.63.2.6
AttributeDetail
CWE IDCWE-180
CVSS Score5.3
Attack VectorNetwork
ImpactSecurity Header Bypass
Exploit StatusNone
CISA KEVFalse

MITRE ATT&CK Mapping

T1556Modify Authentication Process
Credential Access / Defense Evasion
T1562Impair Defenses
Defense Evasion
T1562.001Disable or Modify Tools
Defense Evasion
CWE-180
Incorrect Behavior Order: Validate Before Canonicalize

Incorrect Behavior Order: Validate Before Canonicalize

Vulnerability Timeline

Initial fix commit d6af0639e25ec6f3cc12bf64baa4b991be0cbfa1 authored
2026-03-22
Rack version 3.2.6 released with the security fix
2026-04-01
CVE-2026-34786 published in NVD and CVE.org
2026-04-02

References & Sources

  • [1]GHSA-q4qf-9j86-f5mh: Rack::Static canonicalization flaw

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•42 minutes ago•CVE-2026-71317
6.5

CVE-2026-71317: Missing Authorization in Netflix Lemur Allows Unauthorized Subordinate CA Creation

CVE-2026-71317 is a critical Broken Object-Level Authorization (BOLA) / Missing Authorization vulnerability in Netflix Lemur versions prior to 1.9.3. When the self-service authority creation option is enabled (ADMIN_ONLY_AUTHORITY_CREATION = False), Lemur allows authenticated non-read-only users to request the creation of a subordinate Certificate Authority (sub-CA) chained to any internal parent authority, even if the requesting user lacks administrative or usage permissions over that parent CA. This allows attackers to generate subordinate CAs signed by trusted root certificates, exposing private keys and compromising the organizational PKI trust chain.

Alon Barad
Alon Barad
2 views•7 min read
•about 2 hours ago•CVE-2026-71322
4.3

CVE-2026-71322: Missing Authorization Check in Netflix Lemur Certificate Export

Netflix Lemur, a TLS/SSL certificate management framework, contains a missing authorization check in its certificate export endpoint. Prior to version 1.9.3, the validation logic verifying whether a user had permission to export a certificate was incorrectly placed inside a block that executed only if the selected plugin required a private key. When an authenticated user attempted to export a certificate using a plugin that did not require the private key, the authorization check was bypassed, allowing unauthorized access to the public portions of the certificate and producing misleading audit logs.

Alon Barad
Alon Barad
1 views•6 min read
•about 3 hours ago•GHSA-JF24-8G2H-2WG7
7.2

GHSA-JF24-8G2H-2WG7: Remote Code Execution in LibreNMS AboutController via Binary Path Substitution

A critical security flaw in LibreNMS allows authenticated administrators to execute arbitrary commands by modifying the configured binary path for snmpget and accessing the About page. This occurs due to insufficient verification of the executable file's identity and integrity prior to executing it with shell_exec.

Amit Schendel
Amit Schendel
1 views•6 min read
•about 4 hours ago•GHSA-7CJ5-V4PP-V632
4.8

GHSA-7cj5-v4pp-v632: Stored Cross-Site Scripting in LibreNMS Graph Descriptions

LibreNMS versions prior to 26.7.0 are vulnerable to a stored Cross-Site Scripting (XSS) vulnerability. An authenticated administrator can inject arbitrary HTML or JavaScript into graph descriptions via specific administrative configuration endpoints. When another authenticated user views the affected graph, the unescaped payload executes within their browser context.

Alon Barad
Alon Barad
2 views•5 min read
•about 5 hours ago•GHSA-7GWW-X7FH-JF9J
8.1

GHSA-7GWW-X7FH-JF9J: SSRF-Driven Stored Cross-Site Scripting in LibreNMS Oxidized Integration

An injection vulnerability in LibreNMS's Oxidized integration component allows administrative or network-positioned attackers to achieve stored cross-site scripting (XSS). By setting a malicious oxidized.url endpoint, the server makes outbound queries and processes returned JSON fields containing malicious HTML or JavaScript. These payloads are outputted directly in the web UI without appropriate output encoding.

Amit Schendel
Amit Schendel
2 views•6 min read
•about 6 hours ago•CVE-2026-17106
7.1

CVE-2026-17106: Container-to-Host Arbitrary File Write in moby/go-archive (CopyEscape)

CVE-2026-17106 (CopyEscape) is a container-to-host arbitrary file-write vulnerability within Docker's archiving and extraction library moby/go-archive. By utilizing a Time-of-Check to Time-of-Use (TOCTOU) race condition during the file-walking stage inside a running container, a malicious container process can force the host engine to produce a compromised tar stream. During client-side extraction, the Docker CLI resolves directory entries through absolute symbolic links, resulting in arbitrary file creation or modification on the host system.

Amit Schendel
Amit Schendel
4 views•6 min read