CVE-2025-61919: Ruby Unescaped Prefix Regex Interpolation

Unescaped regex interpolation used in string replacement. If the interpolated variable contains regex metacharacters, the match may fail or behave unexpectedly. When stripping base paths, this can lead to absolute path disclosure. Use `Regexp.escape()` or `Regexp.quote()` to safely interpolate variables into regular expressions.

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

Description

Unescaped regex interpolation used in string replacement. If the interpolated variable contains regex metacharacters, the match may fail or behave unexpectedly. When stripping base paths, this can lead to absolute path disclosure. Use `Regexp.escape()` or `Regexp.quote()` to safely interpolate variables into regular expressions.