CVE-2025-61771: Ruby Unescaped Path Regex Interpolation

Unescaped regex interpolation in path replacement. When an unescaped variable is interpolated into a regular expression (e.g., `/\A#{var}/`) to strip a prefix, regex metacharacters in the variable (like `+` or `.`) will cause the replacement to fail silently. This can lead to sensitive path disclosures, such as leaking the webserver's absolute root directory

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Ruby
greprules fetch cve-2025-61771-ruby-unescaped-path-regex-interpolation --engine opengrep

Description

Unescaped regex interpolation in path replacement. When an unescaped variable is interpolated into a regular expression (e.g., `/\A#{var}/`) to strip a prefix, regex metacharacters in the variable (like `+` or `.`) will cause the replacement to fail silently. This can lead to sensitive path disclosures, such as leaking the webserver's absolute root directory