CVE-2026-34826: Ruby Unescaped Regex Interpolation

A variable is interpolated into a regular expression in a substitution method without escaping. If the variable contains regex metacharacters, the match can fail or behave unexpectedly, potentially leading to information disclosure or regex injection vulnerabilities. Sanitize the variable using `Regexp.escape` or `Regexp.quote` first.

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

Description

A variable is interpolated into a regular expression in a substitution method without escaping. If the variable contains regex metacharacters, the match can fail or behave unexpectedly, potentially leading to information disclosure or regex injection vulnerabilities. Sanitize the variable using `Regexp.escape` or `Regexp.quote` first.