T08 · Insecure Dependencies
- Location
scripts/scrape.py:47- Finding
Unpinned Runtime Dependency and Browser Installation
- Content
View full analysis
Vulnerability Details
File Location:
scripts/scrape.py:47-56
Vulnerability Type: Supply-chain exposure through mutable runtime dependencies
Risk Level: Highpython print("Installing crawl4ai...", file=sys.stderr) pip = os.path.join(VENV_DIR, "bin", "pip") result = subprocess.run( [pip, "install", "crawl4ai", "-q"], capture_output=True, text=True ) if result.returncode == 0: # Install playwright chromium pw = os.path.join(VENV_DIR, "bin", "playwright") subprocess.run([pw, "install", "chromium"], capture_output=True, text=True)Technical Analysis
The scraper automatically installs the latest available
crawl4airelease and its transitive dependencies when the package is unavailable. It subsequently downloads Playwright Chromium artifacts. Neither operation uses an exact version, hash verification, a lockfile, or a restricted package source.Consequently, the effective executable code can change after the Skill has been audited. Python package installation may run package build hooks and other installation logic. The downloaded package and its dependencies later execute inside the Agent environment during scraping.
This network activity is required only to provision an optional scraping fallback, but automatic installation is broader than the minimum privileges needed for ordinary lead generation. Installation should be a separate, explicit, integrity-verified administrative action.
Attack Path
- A user or scheduled run invokes the Crawl4AI fallback or executes
scrape.py --check. - The script creates a virtual environment if needed.
- If
crawl4aicannot be imported, the script retrieves the current package and transitive dependencies from pip's configured index. - It also retrieves Playwright Chromium artifacts without local integrity enforcement.
- A compromised package release, dependency, index, mirror, or artifact distribution channel supplies ...[truncated 632 chars]
- A user or scheduled run invokes the Crawl4AI fallback or executes
- Remediation
View remediation
Remediation Suggestions
- Pin exact direct and transitive dependency versions in a reviewed lockfile.
- Require hashes for every Python distribution, such as with
pip install --require-hashes. - Pin and verify the Playwright browser revision and artifact checksum.
- Use a trusted, explicitly configured package index rather than the ambient pip configuration.
- Move dependency installation out of normal Skill execution and require informed user or administrator approval.
- Build and distribute a reviewed environment or container instead of downloading mutable code on demand.
- Run the browser and scraper under a sandboxed account with restricted filesystem access, no unnecessary credentials, and limited outbound networking.
- Fail closed if integrity verification cannot be completed.
