T08 · Insecure Dependencies
- Location
SKILL.md:24- Finding
Unpinned Global Installation of a Third-Party npm Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 24–28
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: MediumVulnerable Code
markdown If the CLI is not installed, install it: ```bash npm install -g pinterest-ads-clitext ### Technical Analysis The Skill instructs the agent to install the latest available version of `pinterest-ads-cli` globally. It does not specify an exact reviewed version, provide a lockfile or integrity hash, verify package provenance, or include the dependency's source code in the audited project. Because npm packages can define lifecycle scripts that execute during installation, the effective code run by this instruction may change after the Skill has been reviewed. Global installation also places the package outside the project boundary and can expose the user's broader environment to package installation logic. The external package implementation was not included in the audited artifact. Therefore, the package's read-only behavior and network destinations cannot be independently verified by this audit. This finding identifies an unsafe supply-chain mechanism; it does not establish that the current npm package is malicious. ### Attack Path 1. An attacker compromises the npm publisher account, package registry entry, or upstream release process for `pinterest-ads-cli`. 2. The attacker publishes a malicious release containing an npm lifecycle script or modified CLI implementation. 3. An agent follows the Skill's unpinned instruction and executes `npm install -g pinterest-ads-cli`. 4. npm retrieves the attacker-controlled latest release and may execute its lifecycle scripts with the installing user's privileges. 5. The malicious package can access resources available to that user, potentially including local files and the Pinterest OAuth credential subsequently provided through the environment or credential file. 6. If invoked later, a modified CLI could also misuse o ...[truncated 1090 chars]- Remediation
View remediation
Remediation Suggestions
-
Pin the package to an exact version that has been reviewed:
bash npm install --save-exact pinterest-ads-cli@<reviewed-version> -
Prefer a project-local installation over
npm install -gso that the dependency remains scoped to the project and can be managed through a lockfile. -
Commit a package lockfile containing npm integrity metadata and use a reproducible installation command such as
npm ci. -
Verify package provenance, publisher identity, repository linkage, signatures or attestations where available, and the contents of the published npm artifact.
-
Disable lifecycle scripts during installation when the reviewed package does not require them:
bash npm install --ignore-scripts --save-exact pinterest-ads-cli@<reviewed-version> -
Run the CLI in a restricted environment with only the required files, network access, and minimum OAuth scopes exposed.
-
Protect the credential file with restrictive permissions, avoid logging tokens, and use only the scopes required for the requested operation, such as
ads:read,catalogs:read,user_accounts:read, orbilling:read. -
Include or vendor reviewable CLI source in the audited artifact, or cryptographically bind installation instructions to the exact artifact that was reviewed.
-
