subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
env = os.environ.copy() env["MCP_TOKEN"] = token env["API_URL"] = os.environ.get("IMIVA_API_URL", os.environ.get("API_URL", DEFAULT_API_URL)) proc = subprocess.Popen( [npx, "-y", PACKAGE], stdin=subprocess.PIPE, stdout=subprocess.PIPE,- Confidence
- 88% confidence
- Finding
- The script launches an external npm package at runtime using `npx -y @infimind/ecom-content-cli@latest`, which executes whatever code is currently published under `latest`. This creates a supply-chain and arbitrary-code-execution risk, especially because the subprocess is given a full environment including credentials and then performs token-backed network access.
