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
- 84% confidence
- Finding
- The script launches `npx -y @infimind/ecom-content-cli@latest`, which executes code fetched at runtime and tracks the mutable `latest` tag. This creates a supply-chain and trust-boundary risk: if the package or a dependency is compromised, or if the registry response is tampered with, the process will run attacker-controlled code with access to the inherited environment, including `MCP_TOKEN`.
