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
- 93% confidence
- Finding
- The script launches `npx -y @infimind/ecom-content-cli@latest`, which executes code fetched from the npm ecosystem at runtime. Using `@latest` and auto-confirming install means the exact code executed can change over time and could be replaced by a compromised or malicious package, leading to arbitrary code execution with access to the inherited environment and local files.
