rack
Affected
- introduced
0, fixed2.2.25(ecosystem)
Fixed versions
2.2.25
Fix
The export has no generic command for this ecosystem.
Advisory
Also known as: CVE-2026-125110
Rack: Rack::Static header_rules bypass via dot-segment normalization mismatch
Summary
Rack::Static normalizes the request path with Utils.clean_path_info when deciding which file to serve, but matches header_rules against a path that is only URL-decoded. A request containing dot segments, raw or percent-encoded, is served the normalized target file while the header rules for that file's location are not applied.
This allows an attacker to receive a protected static file without the security headers configured for it.
Details
Rack::Static#call computes the served path as Utils.clean_path_info(Utils.unescape_path(path)). Rack::Static#applicable_rules applies only Utils.unescape_path before testing string and regular expression rules. A request for /assets/../uploads/file.html or /assets/..%2fuploads/file.html is served as uploads/file.html, but the decoded path /assets/../uploads/file.html does not start with uploads, so a rule scoped to that directory never matches.
The fix for CVE-2026-34786 (GHSA-q4qf-9j86-f5mh) added URL decoding to rule matching but did not add dot segment normalization, so versions that include that fix remain affected.
Impact
Applications that use Rack::Static header_rules to attach security-relevant headers to particular paths or file types are affected. An unauthenticated attacker who knows the path of a protected file can request it through a dot segment path and receive it without those headers, for example without Content-Disposition: attachment or a restrictive Content-Security-Policy that prevents uploaded HTML from rendering inline. The file itself is served unchanged. Applications that do not use path-specific header_rules are not affected.
Mitigation
header_rules are matched against the same normalized path used to serve the file.Rack::Static header_rules to prevent inline rendering of untrusted uploads; serve them from a separate origin.Credit
Medium Basis: The source's own band: MODERATE
0, fixed 2.2.25 (ecosystem)2.2.25
The export has no generic command for this ecosystem.
3.0.0, fixed 3.1.23 (ecosystem)3.1.23
The export has no generic command for this ecosystem.
3.2.0, fixed 3.2.8 (ecosystem)3.2.8
The export has no generic command for this ecosystem.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0