CVE-2026-31975: Shell Command Injection Via Cd Template Literal

Potential OS command injection: a template literal builds a shell command using `cd "${...}"` (or `Set-Location -Path "${...}"`) followed by additional `${...}` interpolations. If any interpolated value is attacker-controlled (e.g. taken from a request body, WebSocket payload, or query parameter), shell metacharacters in the value will break out of the quote

Provally CuratedPublic repositoryHighHigh confidenceVerifiedApache-2.0JS
greprules fetch cve-2026-31975-shell-command-injection-via-cd-template-literal --engine opengrep

Description

Potential OS command injection: a template literal builds a shell command using `cd "${...}"` (or `Set-Location -Path "${...}"`) followed by additional `${...}` interpolations. If any interpolated value is attacker-controlled (e.g. taken from a request body, WebSocket payload, or query parameter), shell metacharacters in the value will break out of the quote