T08 · Insecure Dependencies
- Location
scripts/env-check.py:153- Finding
Unpinned Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
scripts/env-check.py:153-156; related installation guidance inSKILL.md:10-15
Vulnerability Type: Unpinned and integrity-unverified third-party dependencies
Risk Level: MediumVulnerable Code
python if missing: print(f"\n>>> 缺失 Python 库可一键安装:\n {sys.executable} -m pip install " + " ".join(missing)) else: print("\n>>> Python 库齐全。")The related instructions in
SKILL.mdrecommend creating a virtual environment and installing the listed packages without a lockfile, exact versions, or integrity hashes:markdown `pwntools z3-solver sympy pycryptodome gmpy2 requests volatility3 flask-unsign pillow numpy pyzbar python-magic-bin dnspython`. ... `python -m venv ctf-venv` 然后装上述包。Technical Analysis
The environment-checking script constructs a
pip installcommand from missing package names without enforcing exact versions, package hashes, or an approved package index. Dependency resolution therefore selects whatever compatible releases are available from the configured index at installation time. The resulting environment is not reproducible and can change after the Skill has been reviewed.If a listed package, one of its transitive dependencies, or the configured package index is compromised, installation may execute attacker-controlled build or installation logic. In addition,
check_python_lib()imports installed modules to inspect their versions, which executes each package's module initialization code. The broad dependency set increases the exposed supply-chain surface.The script only prints the installation command and does not install packages automatically. Consequently, exploitation requires a user or agent to follow the generated instruction. No evidence was found that the package names were intentionally malicious or that the project configures an untrusted package repository.
Attack
...[truncated 1376 chars]
- Remediation
View remediation
Remediation Suggestions
- Create a reviewed requirements lockfile containing exact versions for all direct and transitive dependencies.
- Generate and verify cryptographic hashes for every distribution, and install with:
bash python -m pip install --require-hashes -r requirements.lock - Configure an explicitly approved package index and disable unintended fallback indexes where appropriate.
- Review dependency provenance and package ownership before adding or updating packages.
- Use automated dependency scanning and controlled update workflows to detect compromised, vulnerable, or abandoned components.
- Minimize the default dependency set and install specialized CTF tooling only when required.
- Perform installation and package imports inside an isolated, non-privileged virtual environment or disposable container.
- Update
env-check.pyto print the locked installation command rather than dynamically joining unrestricted package names.
