subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: # npm pack 下载 tarball result = subprocess.run( ['npm', 'pack', package], capture_output=True, text=True, cwd=str(cache_dir), timeout=60 )- Confidence
- 93% confidence
- Finding
- This subprocess invocation runs `npm pack` on a package name derived from a user-supplied command. Although it avoids shell injection by using an argument list, it still triggers execution of an external package-management tool against attacker-influenced input, which can fetch untrusted registry content and invoke npm behavior in a privileged local context. In this skill, the danger is elevated because the whole purpose is to inspect arbitrary MCP servers, so interacting with untrusted packages is part of normal operation.
