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
- 94% confidence
- Finding
- The script spawns an external process that fetches and executes a package via `npx`, which materially expands trust to the local Node/npm toolchain and the remote npm registry. Because the package reference uses `@latest`, behavior can change over time and a compromised upstream package or dependency could execute arbitrary code with the user's environment and token available.
