subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def _install_npm() -> str | None: if NODE_MODULES.is_dir(): return None r = subprocess.run( ["npm", "install", "--omit=dev", "--no-audit", "--no-fund"], cwd=str(WEMD_DIR), capture_output=True, text=True, timeout=120, )- Confidence
- 91% confidence
- Finding
- This code automatically runs `npm install` in a bundled dependency directory, which executes package lifecycle scripts and fetches code from the network. Even though the command is hardcoded and not shell-injected, it creates a real supply-chain and arbitrary code execution risk if dependencies are compromised or the package lock is untrusted.
