RubySec

Providing security resources for the Ruby community

GHSA-wvg4-6p58-3gh3 (rack): Rack::Static `header_rules` bypass via unnormalized dot segments in the request path

Rack::Static `header_rules` bypass via unnormalized dot segments in the request path

Published: October 30, 2026

SECURITY IDENTIFIERS

GEM

rack

SEVERITY

CVSS v3.x: 5.3 (Medium)

PATCHED VERSIONS

~> 2.2.25 ~> 3.1.23 >= 3.2.8

DESCRIPTION

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.

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.

RELATED