T08 · Insecure Dependencies
- Location
SKILL.md:28- Finding
Unpinned Global Installation of a Third-Party CLI
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 28-32
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 x-ads-clitext ### Technical Analysis The Skill directs the agent to install the latest available version of `x-ads-cli` globally from the npm registry. The command does not specify an exact reviewed version, validate package integrity, restrict lifecycle scripts, or require explicit user approval. Because the project contains only `SKILL.md`, the CLI implementation is outside the audited artifact. Consequently, its claimed read-only behavior, network destinations, OAuth credential handling, and installation scripts cannot be verified from this project. A global npm installation may execute package lifecycle scripts with the privileges of the user running npm. The resulting executable is also trusted with four sensitive OAuth values: API Key, API Secret, Access Token, and Access Token Secret. These may be obtained from environment variables, an explicitly supplied file, or `~/.config/x-ads-cli/credentials.json`. The documented credential-file access is functionally necessary for authenticated X Ads API operations and does not, by itself, exceed the Skill's declared purpose. The risk arises because an unpinned and unaudited dependency is given access to those credentials and associated advertising data. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or a future release of `x-ads-cli`. 2. The agent finds that the CLI is unavailable and follows the documented `npm install -g x-ads-cli` instruction. 3. npm downloads the current package version rather than a previously reviewed, integrity-verified version. 4. Malicious package lifecycle code can execute during installation with the installing user's privileges. 5. When invoked, the compromised CLI can read the ...[truncated 1037 chars]- Remediation
View remediation
Remediation Suggestions
- Pin
x-ads-clito an exact, reviewed version rather than installing the latest release implicitly. - Verify the package's provenance, publisher identity, repository linkage, and integrity before installation.
- Record and validate an expected package integrity hash where the installation mechanism permits it.
- Prefer a project-local, lockfile-controlled installation over modifying the user's global Node.js environment.
- Disable npm lifecycle scripts during installation where compatible, or separately review every required lifecycle script.
- Require explicit user confirmation before installing third-party software.
- Audit or vendor the CLI implementation so its network behavior, OAuth signing, credential access, and read-only claims can be verified.
- Use OAuth credentials with the narrowest available permissions and account access.
- Protect the credentials file with restrictive filesystem permissions and never print credential values in command output, logs, or error messages.
- Document the expected API hosts and consider outbound-network restrictions so the CLI cannot transmit credentials to unrelated destinations.
- Pin
