subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
stdout_path.open("w", encoding="utf-8") as stdout_handle, stderr_path.open("w", encoding="utf-8") as stderr_handle, ): process = subprocess.Popen( command, cwd=cwd, env=environment,- Confidence
- 83% confidence
- Finding
- This code executes a command and environment derived from job configuration, including job["codex"]["command"], profile/config overrides, cwd, and a full environment mapping, with no visible validation or allowlisting. Although shell injection is mitigated by passing an argument list to Popen, this still permits arbitrary executable selection and environment-variable injection, which can execute attacker-controlled binaries or alter Codex/Python behavior if untrusted users can create or modify jobs.
