T08 · Insecure Dependencies
- Location
SKILL.md:52- Finding
Unpinned Dependency Installation with Unsafe System-Python Fallback
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 52–68
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: MediumVulnerable Code Snippet:
bash cd ~/.claude/skills/huny-img python3 -m venv ~/.pyenv/versions/py312-huny-img source ~/.pyenv/versions/py312-huny-img/bin/activate pip install python-dotenv cp .env.example .env # Edit .env and provide TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEYbash pip install python-dotenv --break-system-packages python3 ./scripts/hunyuan3-text-to-image.py ...Technical Analysis
The setup instructions install
python-dotenvwithout pinning an audited version or verifying an integrity hash. Consequently, the package contents resolved at installation time can differ from those reviewed during this audit.The fallback command uses
--break-system-packages, bypassing Python's externally managed environment protections and allowing the dependency to be installed into the system Python environment. This expands the potential effect of a compromised package beyond an isolated virtual environment.The installed package is imported by
scripts/hunyuan3-text-to-image.pybefore Tencent Cloud credentials are loaded. Python executes module initialization code during import, so a malicious or compromised dependency could access process environment variables, local files available to the user, and network resources.The named
python-dotenvpackage is not itself shown to be malicious. The vulnerability is the mutable, unverified dependency resolution process and the unsafe system-environment fallback.Attack Path
- An attacker compromises a package release, package index, configured mirror, DNS/network dependency path, or another relevant package-resolution component.
- A user follows the documented setup instructions and runs the unpinned
pip install python-dotenvcommand. - Pip installs the attacker-co ...[truncated 1449 chars]
- Remediation
View remediation
Remediation Suggestions
-
Pin
python-dotenvto a specifically reviewed version in a requirements file. -
Record and enforce cryptographic hashes:
text python-dotenv==AUDITED_VERSION --hash=sha256:EXPECTED_PACKAGE_HASHInstall it with:
bash python3 -m pip install --require-hashes -r requirements.txt -
Generate and review a lock file so dependency updates occur only through an explicit audit process.
-
Require installation inside a dedicated virtual environment.
-
Remove the
--break-system-packagesfallback and fail safely when the isolated environment is unavailable. -
Use a trusted, explicitly configured package index and avoid unverified mirrors.
-
Run dependency vulnerability and provenance checks as part of release validation.
-
Restrict Tencent Cloud credentials to only the API actions and resources required for image generation, rotate them regularly, and avoid exposing them to unrelated processes.
-
