T08 · Insecure Dependencies
- Location
SKILL.md:27- Finding
Unpinned Global Installation of a Third-Party npm Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 27
Vulnerability Type:T08: Insecure Dependencies
Risk Level: MediumComplete Code Snippet:
bash # If the CLI is not installed, install it: npm install -g reddit-ads-cliTechnical Analysis
The Skill instructs the Agent to install the latest available version of
reddit-ads-cliglobally from the npm registry. The dependency is not pinned to a reviewed version, protected by a lockfile, or verified against an expected integrity hash. Because the package implementation is not included in this project, its installation-time and runtime behavior cannot be verified by this audit.npm packages may execute lifecycle scripts during installation. A compromised package release or publisher account could therefore cause arbitrary code to run with the permissions of the user invoking npm. Global installation unnecessarily broadens the package's persistence and availability compared with an isolated, project-local installation.
This risk is especially relevant because the installed CLI is subsequently expected to receive a Reddit OAuth access token through
REDDIT_ADS_ACCESS_TOKEN, an explicit credentials path, or~/.config/reddit-ads-cli/credentials.json.Attack Path
- An attacker compromises the npm package, its publisher account, or a dependency used by a newly published version.
- The Agent follows the Skill instruction and runs
npm install -g reddit-ads-cli. - npm downloads the latest release rather than a previously reviewed and pinned version.
- Malicious package code or an npm lifecycle script executes with the invoking user's privileges.
- The package may inspect local files and environment variables, including Reddit credentials available to the invoking user.
- The malicious package could exfiltrate credentials, alter user-owned files, or execute additional commands within that user's permission boundary.
Impact A
...[truncated 634 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin
reddit-ads-clito a specifically reviewed version rather than installing the latest release implicitly. - Prefer a project-local, isolated installation over a global installation.
- Use a lockfile and verify the downloaded package against an expected integrity value or trusted signed artifact.
- Verify that the referenced package name, publisher, repository, and release provenance are official before installation.
- Disable npm lifecycle scripts during installation with
--ignore-scriptswhen the reviewed package is compatible with that restriction. - Run the CLI under a minimally privileged account or sandbox with access limited to the files and network endpoints required for Reddit Ads reporting.
- Use a short-lived, least-privilege Reddit OAuth token and avoid exposing unrelated secrets in the process environment.
- Restrict credentials-file permissions to the owning user and avoid logging or printing token contents.
- Pin
