T08 · Insecure Dependencies
- Location
scripts/video_to_text.py:39- Finding
Automatic Installation of Unpinned Packages into the System Python Environment
- Content
View full analysis
Vulnerability Details
File Locations:
scripts/video_to_text.py:39-52scripts/video_clip.py:17-32
Vulnerability Type: Automatic unpinned dependency installation and supply-chain exposure
Risk Level: HighVulnerable Code
From
scripts/video_to_text.py:python def check_dependencies(): """检查并安装依赖""" print("🔍 检查依赖...") deps = ["faster-whisper", "requests"] for dep in deps: try: __import__(dep.replace("-", "_")) print(f" ✅ {dep} 已安装") except ImportError: print(f" 📦 正在安装 {dep}...") try: subprocess.run([sys.executable, "-m", "pip", "install", dep, "--break-system-packages"], capture_output=True) print(f" ✅ {dep} 安装完成") except Exception as e: print(f" ❌ {dep} 安装失败: {e}") return FalseFrom
scripts/video_clip.py:python def check_dependencies(): """检查并安装依赖""" print("🔍 检查依赖...") # 检查 auto-editor result = subprocess.run(["which", "auto-editor"], capture_output=True) if result.returncode != 0: print("📦 正在安装 auto-editor...") try: subprocess.run([sys.executable, "-m", "pip", "install", "auto-editor", "--break-system-packages"], capture_output=True) print(" ✅ auto-editor 安装完成") except Exception as e: print(f" ❌ auto-editor 安装失败: {e}") return False else: print(" ✅ auto-editor 已安装") return TrueTechnical Analysis
The scripts automatically install
faster-whisper,requests, orauto-editorwhen an import or executable check fails. No package versions or cryptographic hashes are pinned, so the package content installed during one invocation may differ from the content installed during another invocation.Python package installation can execute package build and installation logic. Conseque ...[truncated 2722 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove all automatic pip installation from normal execution paths.
- If a dependency is missing, terminate with a clear error and provide a separate, user-controlled setup procedure.
- Install dependencies only inside a dedicated virtual environment or container.
- Pin direct and transitive dependency versions in a lock file.
- Require cryptographic hashes, such as through
pip install --require-hashes -r requirements.txt. - Remove
--break-system-packages; do not modify an externally managed Python environment. - Review and approve package sources and configure pip to use a trusted registry.
- Record tested dependency versions in the documentation.
- Check subprocess return codes and report installation failure accurately if a separate installer is retained.
- Update
SKILL.mdso its dependency-installation description accurately distinguishes informational setup commands from executable installation behavior.
