T08 · Insecure Dependencies
- Location
scripts/generate_pdf.py:20- Finding
Automatic Installation of an Unpinned Runtime Dependency
- Content
View full analysis
str: install_if_missing("markdown") ``` ### Technical Analysis The PDF generator automatically invokes `pip` when the `markdown` module is unavailable. The package version is not pinned, no package hash is verified, and no lock file or isolated environment is used. Package resolution may also be affected by the invoking environment's pip configuration, configured indexes, or package mirrors. Python packages can execute code during installation. Consequently, the script treats mutable content retrieved from a package repository as trusted executable code. Automatic environment modification is not required for Markdown-to-PDF conversion and exceeds the minimum privileges necessary for the declared functionality. This is not direct evidence that the named `markdown` package is malicious. The vulnerability is the unsafe dependency acquisition mechanism and its exposure to repository compromise, malicious mirrors, configuration manipulation, and future upstream compromise. ### Attack Path 1. The Skill is invoked on a system where the `markdown` module is not installed or cannot be imported. 2. An attacker compromises or controls a package index, configured mirror, DNS/network path, or relevant pip configuration used by the environment. 3. The script executes `python -m pip install markdown -q` without enforcing a known version or artifact hash. 4. Pip downloads and installs ...[truncated 674 chars]- Remediation
View remediation
