T08 · Insecure Dependencies
- Location
SKILL.md:38- Finding
Unpinned Third-Party Package Installation and Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 38-48
Vulnerability Type: Unsafe third-party dependency retrieval and execution
Risk Level: MediumComplete Code Snippet:
markdown Install as a dev dependency so the version is pinned in the lockfile: ```bash npm install --save-dev liarjsAgainst a browser started outside the test process
bash npx liarjs@0.3 --cdp http://127.0.0.1:9222text ### Technical Analysis The documented workflow retrieves and executes the external npm package `liarjs`, but the project does not include the package source, a lockfile, an integrity hash, or other verification material. The `npm install --save-dev liarjs` command does not specify a package version. It therefore resolves the version selected by the npm registry at installation time. The `npx liarjs@0.3` command is constrained to the `0.3` release line rather than an immutable, independently verified artifact and may download and immediately execute the resolved package. This creates a supply-chain trust boundary that cannot be audited from the files in this project. If the registry package, publisher account, distribution channel, or a subsequently resolved release is compromised, package lifecycle scripts or the CLI entry point could execute attacker-controlled code with the invoking user's permissions. This finding does not establish that the current `liarjs` package is malicious; it identifies the unsafe and insufficiently reproducible dependency-execution pattern. ### Attack Path 1. An attacker compromises the external package publisher, registry entry, or another part of the npm distribution chain. 2. The attacker publishes malicious content under a version accepted by the documented command. 3. A user follows the Skill instructions and runs the unpinned `npm install` command or the `npx` command. 4. npm retrieves the externally controlled artifact. 5. Package lifecycle hook ...[truncated 786 chars]- Remediation
View remediation
Remediation Suggestions
- Pin a specific reviewed package version in every command, rather than using an unversioned package name or a version family such as
0.3. - Commit a lockfile containing npm integrity hashes and require installation through
npm ci. - Review the exact package archive and its lifecycle scripts before recommending execution.
- Disable package lifecycle scripts with
--ignore-scriptswhere the package can operate without them. - Prefer a vendored, checksummed, or internally mirrored artifact from a controlled registry.
- Document the expected npm publisher, package checksum, registry, and verification procedure.
- Run the tool in a minimally privileged environment without unnecessary credentials or sensitive files.
- Restrict CDP endpoints to loopback or another trusted interface, require explicit user authorization before attachment, and use disposable browser profiles where practical.
- Pin a specific reviewed package version in every command, rather than using an unversioned package name or a version family such as
