T08 · Insecure Dependencies
- Location
references/setup.md:117- Finding
Unpinned Third-Party Package and Browser Binary Installation
- Content
View full analysis
Vulnerability Details
File Location:
references/setup.md:117
Vulnerability Type: Supply-chain risk from unpinned dependencies
Risk Level: MediumComplete Code Snippet:
markdown 3. Perform the smallest fitting path. - local install: `npm install playwright` and `npx playwright install chromium` - existing browser binary with a Playwright client (commonly `playwright-core`) and `PLAYWRIGHT_EXECUTABLE_PATH` - existing Playwright package via `PLAYWRIGHT_MODULE_PATH` - existing remote browser via `PLAYWRIGHT_WS_ENDPOINT` or `PLAYWRIGHT_CDP_ENDPOINT`Technical Analysis
The documented installation path runs
npm install playwrightwithout selecting an exact, previously audited version. It then invokesnpx playwright install chromium, which executes package-provided CLI code and downloads a browser binary. The instructions do not require a lockfile, package integrity verification, a trusted registry, or independent verification of the downloaded browser artifact.Playwright is a legitimate package, and the Skill requires user confirmation before installation. Nevertheless, using mutable package resolution increases exposure to package-registry compromise, compromised future releases, transitive dependency compromise, registry substitution, and unexpected changes in installation behavior. Execution through
npxshould also be constrained to the explicitly installed local package so that it cannot resolve an unintended package from a registry.Attack Path
- An attacker compromises a package release, transitive dependency, configured npm registry, or package-delivery path.
- A user follows the browser-assisted setup instructions and authorizes the installation.
npm install playwrightresolves the mutable package version or affected dependency.- Package installation logic or the subsequently invoked CLI executes with the privileges of the user running npm.
- `npx play ...[truncated 742 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin Playwright to an exact, reviewed version rather than installing a mutable latest release.
- Provide and enforce a lockfile containing package integrity metadata.
- Configure npm to use an explicitly trusted HTTPS registry and reject unexpected registry substitutions.
- Invoke the pinned local binary directly, such as through an audited package script or
./node_modules/.bin/playwright, instead of allowingnpxto resolve an absent package remotely. - Document how the browser artifact is obtained and verified, including expected checksums or the package vendor's supported integrity mechanism.
- Run installation as a non-privileged user in an isolated environment with minimal access to secrets and unrelated workspace files.
- Retain the existing requirement for explicit user confirmation before package or browser installation.
