T08 · Insecure Dependencies
- Location
scripts/convert-weasyprint.sh:31- Finding
Runtime Installation of Unpinned Python Dependencies
- Content
View full analysis
/dev/null; then echo "⚠️ Python 依赖未安装,正在安装..." python3 -m pip install -q markdown weasyprint fi ``` ### Technical Analysis The conversion wrapper automatically installs `markdown` and `weasyprint` by package name when they are unavailable. No version constraints, integrity hashes, lockfile, isolated virtual environment, or explicitly approved package repository are used. Consequently, the code installed during a conversion is determined by the mutable state of the configured Python package index. The behavior can change after the Skill has been reviewed. Installation may also modify the invoking user's global Python environment. This pattern does not prove that the current packages are malicious, but it creates a supply-chain attack surface. A compromised upstream release, package index, mirror, DNS path, or local `pip` configuration could supply attacker-controlled package code. Python packages can execute code during installation, and the wrapper subsequently imports the installed modules. ### Attack Path 1. The attacker compromises an upstream dependency release, configured package mirror, or package-resolution path. 2. A user runs `scripts/convert-weasyprint.sh` in an environment where either dependency is missing. 3. The dependency check fails and invokes: ```bash python3 -m pip install -q markdown weasyprint ``` 4. `pip` downloads the currently resolved, unverified package artifacts. 5. Attacker-controlled installation or package code executes with the permissions of the user running the wrapper. 6. The malicious package may retain access whenever it is imported in later conversions. ### Impact Assessment Successful exploitation per ...[truncated 685 chars]- Remediation
View remediation
