CVE-2026-48981: Python Os System Command Injection

Constructing shell commands using string formatting or concatenation and passing them to `os.system()` can lead to OS command injection. An attacker could inject arbitrary shell commands through the interpolated variables. Instead, use `subprocess.run()` and pass arguments as a list to avoid shell interpretation.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2026-48981-python-os-system-command-injection --engine opengrep

Description

Constructing shell commands using string formatting or concatenation and passing them to `os.system()` can lead to OS command injection. An attacker could inject arbitrary shell commands through the interpolated variables. Instead, use `subprocess.run()` and pass arguments as a list to avoid shell interpretation.