T08 · Insecure Dependencies
Warning
- Location
- install.sh:54
- Finding
- Mutable Dependencies and Browser Artifacts Are Installed Without a Lockfile or Integrity Verification## Vulnerability Details **File Location**: `install.sh:54-62`; related dependency declarations at `package.json:12-15` and installation instructions at `SKILL.md:53` **Vulnerability Type**: Supply-chain exposure through mutable dependency resolution **Risk Level**: Medium **Vulnerable code (`install.sh:54-62`):** ```bash # 3. Install npm packages locally in the skill directory echo "==> Installing npm dependencies..." cd "$SCRIPT_DIR" [ ! -f package.json ] && npm init -y --silent npm install --save playwright-extra puppeteer-extra-plugin-stealth 2>&1 | tail -3 # 4. Install Chromium browser echo "==> Downloading Chromium..." npx playwright install chromium 2>&1 | tail -5 ``` **Related dependency declarations (`package.json:12-15`):** ```json "dependencies": { "playwright-extra": "^4.3.6", "puppeteer-extra-plugin-stealth": "^2.11.2" } ``` ### Technical Analysis The project does not include a package lockfile, and its dependencies use caret version ranges. Consequently, each installation can resolve package versions that differ from those reviewed during the audit. The installation script also invokes `npm install` directly and executes `npx playwright install chromium`, retrieving packages and browser artifacts from external infrastructure at installation time. npm packages may execute lifecycle scripts during installation. If an allowed dependency release, transitive dependency, npm account, registry response, or downloaded browser artifact is compromised, attacker-controlled content could execute under the privileges of the user running `install.sh`. The script invokes `apt-get`, `apk`, or `yum` without privilege dropping. In container or administrative environments, it may therefore be run as root, increasing the impact of a supply-chain compromise. No evidence was found that the currently declared packages are malicious; the vulnerability is the mutable and insufficiently verified in ...[truncated 1398 chars]
- Remediation
- ## Remediation Suggestions 1. Pin all direct dependencies to reviewed exact versions rather than caret ranges. 2. Generate, review, and commit a `package-lock.json`, then replace `npm install` with `npm ci`. 3. Explicitly declare every package used by `npx`, including the appropriate Playwright package, and invoke its local binary instead of allowing `npx` to resolve missing packages dynamically. 4. Use `npm ci --ignore-scripts` where dependency functionality permits it. If lifecycle scripts are required, explicitly audit and allow only the necessary scripts. 5. Verify downloaded browser artifacts using publisher-provided cryptographic checksums or signatures. 6. Run dependency and browser installation as a dedicated unprivileged account. Separate privileged operating-system package installation into a reviewed administrative step. 7. Add automated dependency review, vulnerability scanning, and lockfile-integrity checks to the release process. 8. Avoid modifying dependency declarations during installation by removing `--save` from runtime setup scripts.
