T08 · Insecure Dependencies
- Location
scripts/fetch_papers.py:7- Finding
Unpinned Dependencies Are Installed Automatically at Runtime
- Content
View full analysis
Vulnerability Details
File Location:
scripts/fetch_papers.py:7-15,scripts/fetch_papers.py:115-121; installation instructions also appear inSKILL.md:21-24andSKILL.md:34-35
Vulnerability Type: Supply-chain risk caused by unpinned runtime dependencies
Risk Level: MediumVulnerable Code
python try: import openpyxl from openpyxl.styles import Font, PatternFill, Alignment, Border, Side from openpyxl.utils import get_column_letter except ImportError: print('正在安装 openpyxl...') import subprocess subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'openpyxl', '-q']) import openpyxl from openpyxl.styles import Font, PatternFill, Alignment, Border, Side from openpyxl.utils import get_column_letterpython try: from scholarly import scholarly as sc except ImportError: import subprocess subprocess.check_call([sys.executable,'-m','pip','install','scholarly','-q']) from scholarly import scholarly as scThe documented installation command is also unpinned and directs users to modify an externally managed Python environment:
bash pip3 install openpyxl scholarly --break-system-packages -qTechnical Analysis
The script automatically invokes
pipwhen either dependency is unavailable. Neither package is restricted to a reviewed version, integrity hash, trusted artifact, or locked transitive dependency set. The code executed by the project can therefore change without any change to the audited repository.Python package installation can execute package build hooks and other package-supplied code. A compromised upstream release, package index, distribution account, or transitive dependency could consequently execute code with the privileges of the user running this Skill. The documented use of
--break-system-packagesalso bypasses protections for externally managed Python environments and can al ...[truncated 1255 chars]- Remediation
View remediation
Remediation Suggestions
- Remove all automatic
pip installoperations from runtime code. Fail with a clear dependency error instead. - Define dependencies in a lock file using exact reviewed versions, including transitive dependencies.
- Require package hashes, such as through
pip install --require-hashes -r requirements.txt. - Install dependencies in a dedicated virtual environment during a separate, explicit setup phase.
- Avoid
--break-system-packages; do not modify externally managed Python environments. - Use a controlled package mirror or other trusted artifact repository where appropriate.
- Add dependency vulnerability and provenance checks to the release process.
- Remove all automatic
