T08 · Insecure Dependencies
- Location
SKILL.md:76- Finding
Unpinned Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:76; additional references atscripts/imagegen.py:7andscripts/imagegen.py:19-22
Vulnerability Type: Unverified and unpinned third-party dependency
Risk Level: MediumVulnerable Code
bash pip3 install requestsThe script also instructs users to perform the same unconstrained installation when the dependency is unavailable:
python try: import requests except ImportError: print("缺少依赖:requests。请运行 pip3 install requests", file=sys.stderr) sys.exit(1)Technical Analysis
The installation command does not pin
requeststo a reviewed version and does not use a lockfile, package hash, or explicitly trusted package index. Consequently, the code installed when users follow the documented setup procedure may change independently of the reviewed Skill package.The package name itself is legitimate and there is no evidence that the project intentionally installs a malicious dependency. Nevertheless, installation from the active pip configuration creates a supply-chain boundary that is not controlled by this project. A compromised upstream release, malicious package-index mirror, DNS or repository compromise, or unsafe user-level pip configuration could cause different code to be installed.
Python packages may execute code during installation or when imported. The script imports
requestsimmediately at startup, so a substituted package could execute with the privileges of the user running the Skill.Attack Path
- An attacker compromises the configured Python package source, a dependency release, or a package mirror used by the victim.
- The user follows the documented
pip3 install requestsinstruction. - pip resolves and installs the attacker-controlled or otherwise unreviewed package version because no version or hash is enforced.
- Malicious code executes during installation or when
imagegen.pyimports t ...[truncated 711 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin
requestsand all transitive dependencies to reviewed versions in a requirements or lock file. - Include cryptographic hashes and install with hash verification, for example:
bash python3 -m pip install --require-hashes -r requirements.txt - Generate the lock file through a controlled dependency-review process and update it only after security testing.
- Document the trusted package index explicitly rather than relying on arbitrary global or user pip configuration.
- Run dependency vulnerability scanning in CI and establish a controlled process for applying security updates.
- Recommend installation in an isolated virtual environment without elevated privileges.
- Pin
