subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def install_package(package_name, version): """安装指定版本的包""" try: subprocess.check_call( [sys.executable, '-m', 'pip', 'install', '--quiet', f'{package_name}>={version}'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL- Confidence
- 95% confidence
- Finding
- The script spawns a pip subprocess to install packages at runtime, which introduces code execution and supply-chain risk because it downloads and installs code from package indexes without explicit user approval. Even though arguments are passed as a list and there is no obvious shell injection, automatic package installation is still dangerous in an agent skill because it performs unexpected system modification and network access.
