T08 · Insecure Dependencies
- Location
scripts/run.sh:43- Finding
Automatic Installation of Unpinned Runtime Dependencies
- Content
View full analysis
Vulnerability Details
File Location:
scripts/run.sh, lines 43-47
Vulnerability Type: Supply-chain risk caused by automatic installation of unpinned dependencies
Risk Level: MediumVulnerable Code
bash # 检查依赖库 python3 -c "import requests, bs4" 2>/dev/null if [ $? -ne 0 ]; then echo "正在安装必要的依赖库..." pip3 install requests beautifulsoup4 -q fiTechnical Analysis
The wrapper automatically installs
requestsandbeautifulsoup4when either required import is unavailable. Neither package is pinned to a reviewed version, and no cryptographic hashes or trusted package-index configuration are specified.As a result, the code installed at runtime can differ from the code that was evaluated during this audit. Package resolution depends on the invoking environment's pip configuration and currently available package releases. A compromised package release, compromised package repository, or attacker-controlled pip index configuration could therefore supply malicious package content. Installation may execute package build or installation logic before the paper-fetching script starts.
This is classified as
T08: Insecure Dependenciesbecause the risk is introduced through mutable and insufficiently constrained third-party dependencies.Attack Path
- The invoking environment does not have
requestsorbs4available, causing the import check to fail. - An attacker compromises a dependency release or package repository, or influences pip configuration to point to a malicious index or proxy.
run.shexecutespip3 install requests beautifulsoup4 -qwithout version or hash validation.- pip retrieves and installs the attacker-controlled package artifact.
- Malicious build, installation, or imported runtime code executes with the privileges of the user running
run.sh. - The malicious dependency can access resources available to that user and may alter subsequent script behavior.
Impact Assessment
Successful e ...[truncated 647 chars]
- The invoking environment does not have
- Remediation
View remediation
Remediation Suggestions
- Remove automatic dependency installation from
run.sh. If dependencies are unavailable, terminate with a clear message directing the operator to an explicit installation procedure. - Declare dependencies in a dedicated requirements or lock file using exact, reviewed versions.
- Generate and verify cryptographic hashes for every package artifact. Install with a command such as:
bash python3 -m pip install --require-hashes -r requirements.txt- Install dependencies inside a project-specific virtual environment rather than the invoking user's global Python environment.
- Explicitly use an approved package repository and prevent unexpected fallback to additional indexes.
- Review and update pinned dependencies through a controlled process that includes vulnerability scanning and integrity verification.
- Prefer prebuilt, verified artifacts where appropriate, and avoid executing untrusted source-distribution build logic.
- Document dependency installation as a separate administrative step so running the Skill does not silently mutate the environment.
- Remove automatic dependency installation from
