T08 · Insecure Dependencies
- Location
SKILL.md:10- Finding
Global Installation and Execution of an Unaudited Third-Party npm Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 10–16
Vulnerability Type: T08: Insecure Dependencies
Risk Level: MediumVulnerable Code
markdown CLI for a machine-to-machine classified marketplace. Publish ads, get auto-matched with counterparts, exchange messages. Install (prefer global install over `npx` to allow inspection before execution): ```bash npm install -g m2m-ads@0.1.4Always pin the exact version. Do not use
npx m2m-adswithout a version tag.text ### Technical Analysis The Skill instructs users or agents to globally install and subsequently execute the external npm package `m2m-ads@0.1.4`. The executable package is not included in the audited project, so its implementation and npm lifecycle scripts are outside the reviewed code boundary. A global npm installation may execute package lifecycle scripts and installs executable code that runs with the filesystem and network permissions of the invoking user. Pinning an exact version prevents unexpected version drift, but it does not independently establish that the selected release is trustworthy or that its registry artifact corresponds to the cited source repository. The document recommends package inspection and signature auditing later in its security guidance, but these checks are optional rather than enforced before installation. There is no evidence in the reviewed files that `m2m-ads@0.1.4` is malicious. The vulnerability is the unverified supply-chain trust and broad execution exposure created by directing agents to globally install external executable code. ### Attack Path 1. An agent follows the Skill and runs `npm install -g m2m-ads@0.1.4`. 2. npm retrieves the package and its dependency tree from the configured package registry. 3. Any permitted lifecycle scripts execute during installation with the invoking user's privileges. 4. The user later invokes the globally installed `m2m-ads` executable, executing code that was not present in this audit ...[truncated 1128 chars]- Remediation
View remediation
Remediation Suggestions
-
Require verification before installation
- Make tarball inspection and provenance verification mandatory rather than optional.
- Retrieve the package with
npm pack m2m-ads@0.1.4. - Compare the artifact against the referenced source repository and expected release.
- Verify registry signatures or attestations where available.
- Publish and validate a trusted cryptographic digest for the expected tarball.
-
Avoid global installation
- Install the dependency in an isolated, dedicated project or container.
- Do not run npm as
rootor throughsudo. - Restrict the installation environment from unrelated credentials and sensitive files.
-
Control lifecycle scripts
- Inspect all package and transitive-dependency lifecycle scripts before allowing them to run.
- Where compatible, install initially with
npm install --ignore-scriptsand explicitly authorize only reviewed setup operations.
-
Reduce runtime privileges
- Execute the CLI in a sandbox or container using a non-privileged account.
- Mount only the required configuration and working directories.
- Apply outbound network restrictions so the process can reach only explicitly approved services.
- Avoid exposing unrelated environment variables, SSH keys, cloud credentials, or host filesystem paths.
-
Improve dependency governance
- Vendor and audit the required executable code with the Skill where licensing and maintenance constraints permit.
- Maintain a lockfile or equivalent inventory for the full dependency tree.
- Monitor the package and its transitive dependencies for ownership changes, advisories, and integrity changes.
- Re-audit artifacts before updating the pinned version.
-
