T08 · Insecure Dependencies
- Location
scripts/patent-download.sh:15- Finding
Automatic Installation of Unpinned Third-Party Dependencies
- Content
View full analysis
Vulnerability Details
File Location:
scripts/patent-download.sh:15-19, 25-30;scripts/requirements.txt:1-8
Vulnerability Type: Uncontrolled third-party dependency installation
Risk Level: MediumVulnerable Code
bash if [ "$1" = "google" ]; then # Check patent-downloader if ! python3 -c "from patent_downloader import PatentDownloader" 2>/dev/null; then echo "Installing Google Patents dependency..." pip install patent-downloader fi # Run the unified entry point python3 cli.py "$@" exit $? fi # Legacy path: check Playwright if ! python3 -c "import playwright" 2>/dev/null; then echo "Installing browser automation dependencies..." pip install -r requirements.txt playwright install chromium fiThe referenced requirements file contains unconstrained dependencies:
text # Google Patents SDK patent-downloader # Browser automation playwright # HTTP requests requestsTechnical Analysis
The wrapper automatically invokes package managers when dependencies are absent. None of the Python packages are pinned to exact versions, and no package hashes or lockfile are provided. The Chromium browser binary installed by Playwright is similarly selected at installation time.
Python package installation can execute package build and installation logic. Consequently, the effective code executed by the Skill can change after the Skill itself has been reviewed. A compromised package release, compromised package index, dependency confusion event, or malicious transitive dependency could execute arbitrary code with the privileges of the user invoking the wrapper.
The automatic installation and associated supply-chain risk are disclosed in
SKILL.md, which reduces the risk of hidden behavior but does not provide a technical security boundary.Attack Path
- An attacker compromises an upstream package, its maint ...[truncated 1117 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove all automatic dependency installation from the runtime wrapper.
- Require a separate, explicit, user-approved setup command.
- Pin every direct and transitive Python dependency to an exact reviewed version.
- Use a hash-locked requirements file, such as one generated with
pip-compile --generate-hashes, and install withpip install --require-hashes. - Install dependencies in a dedicated virtual environment rather than the user's global Python environment.
- Pin and verify the Playwright and Chromium versions.
- Run dependency vulnerability and provenance checks in CI.
- Where practical, sandbox the browser and downloader with restricted filesystem, environment, and network access.
