CVE-2026-34230: Ruby Unescaped Regex Interpolation Substitution

Unescaped variables interpolated into a regular expression can allow regex metacharacters to alter the intended match pattern. In string substitutions (like `sub` and `gsub`), this can lead to application logic bypasses or information disclosure if a directory prefix or known pattern fails to match and is not stripped as intended. Always use `Regexp.escape`

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Ruby
greprules fetch cve-2026-34230-ruby-unescaped-regex-interpolation-substitution --engine opengrep

Description

Unescaped variables interpolated into a regular expression can allow regex metacharacters to alter the intended match pattern. In string substitutions (like `sub` and `gsub`), this can lead to application logic bypasses or information disclosure if a directory prefix or known pattern fails to match and is not stripped as intended. Always use `Regexp.escape`