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 spawns an external process that executes a package fetched via `npx`, which materially expands the trust boundary from local Python code to remotely distributed Node.js code. Because the package reference uses `@latest`, the exact code executed can change over time, so a compromised upstream package or malicious update would run with access to the provided environment and stdio channels.
