CVE-2026-52726: Shell Command Replace Injection

Constructing shell commands by substituting string placeholders with unquoted variables via `str.replace()` can lead to OS command injection. Ensure replacements use `shlex.quote()` to escape the injected values before passing the command to subprocess.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2026-52726-shell-command-replace-injection --engine opengrep

Description

Constructing shell commands by substituting string placeholders with unquoted variables via `str.replace()` can lead to OS command injection. Ensure replacements use `shlex.quote()` to escape the injected values before passing the command to subprocess.