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
- 92% confidence
- Finding
- The script executes an external npm package via `npx -y @infimind/ecom-content-cli@latest`, which can download and run code at invocation time. Because it uses the mutable `latest` tag and forwards sensitive environment variables to the child process, compromise of the package, its dependencies, or the registry path would directly expose the MCP token and allow arbitrary code execution in the user's environment.
