T08 · Insecure Dependencies
- Location
scripts/svg2png.py:72- Finding
Automatic Installation of an Unpinned Runtime Dependency
- Content
View full analysis
Vulnerability Details
File Location:
scripts/svg2png.py:72-77
Vulnerability Type: Unsafe runtime dependency installation
Risk Level: HighVulnerable Code
python def convert_cairosvg(svg_path, png_path, scale): try: import cairosvg except ImportError: subprocess.check_call([sys.executable, "-m", "pip", "install", "--break-system-packages", "-q", "cairosvg"]) import cairosvgTechnical Analysis
When CairoSVG is unavailable, the conversion script automatically invokes
pipand installs the latest availablecairosvgpackage. No exact version or package hash is specified, so the code installed at runtime can differ from the code present when the Skill was audited.The
--break-system-packagesoption bypasses protections intended to preventpipfrom modifying a Python environment managed by the operating system. Installation occurs under the privileges of the user running the Skill and is triggered implicitly during ordinary conversion rather than through a separate, explicit setup process.This creates a supply-chain trust boundary: a compromised upstream release, package-index account, configured package mirror, DNS/network path, or dependency of CairoSVG could result in attacker-controlled package code being installed and loaded. The script subsequently imports the newly installed package in the same process.
Attack Path
- The user or agent invokes
scripts/svg2png.pyas directed bySKILL.md. - Node.js is unavailable, Puppeteer conversion fails, or the script otherwise enters the CairoSVG fallback.
- The local Python environment does not already contain CairoSVG.
- The script invokes
python -m pip install --break-system-packages -q cairosvg. pipresolves an unpinned package and its transitive dependencies from the configured package index.- If the resolved supply-chain artifact or index path is compromised, malicious installation or impor ...[truncated 847 chars]
- The user or agent invokes
- Remediation
View remediation
Remediation Suggestions
- Remove runtime installation from the conversion path. If CairoSVG is absent, terminate with a clear message describing an explicit installation procedure.
- Declare CairoSVG and all other required dependencies in a lock file with exact versions and cryptographic hashes.
- Install dependencies during a deliberate setup phase rather than while processing user content.
- Use a dedicated virtual environment or locked container instead of modifying the system-managed Python environment.
- Remove
--break-system-packages. - Restrict package installation to an approved package index and verify artifacts through hashes or signed provenance.
- Add dependency scanning and automated update review to the release process.
- Update
SECURITY.md, which currently describes only a one-time Puppeteer installation and does not disclose this automaticpipinstallation behavior.
