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, lines 27-31
Vulnerability Type: Unpinned and globally installed third-party dependency
Risk Level: HighVulnerable Code
markdown If the CLI is not installed, install it: ```bash npm install -g amazon-ads-open-clitext ### Technical Analysis The Skill instructs users or agents to install `amazon-ads-open-cli` globally from npm without specifying a reviewed version, validating an integrity hash, verifying publisher provenance, or reviewing the installed implementation. Package installation can execute npm lifecycle scripts and place an executable in the user's global command path. Because no version is pinned, the effective code can change after this Skill has been reviewed. A compromised package release, maintainer account, or registry resolution could therefore introduce arbitrary code into the installation process. This risk is especially significant because the installed CLI is subsequently expected to access an Amazon Ads OAuth access token, client ID, profile ID, advertising account data, and asynchronously generated reports. The project does not include the CLI implementation, so its credential handling, network destinations, and runtime behavior cannot be verified within the audited artifact. ### Attack Path 1. An attacker compromises the npm package, its maintainer account, or the package publication process. 2. The attacker publishes a malicious version under the same package name. 3. A user or agent follows the Skill instruction and runs `npm install -g amazon-ads-open-cli`. 4. npm resolves the unpinned package to the malicious release. 5. Malicious package code or lifecycle scripts execute with the privileges of the user performing the installation. 6. The globally installed executable can later access Amazon Ads credentials supplied through environment variables or `~/.config/amazon-ads-open-cli/credentials.json`. 7. The malic ...[truncated 1171 chars]- Remediation
View remediation
Remediation Suggestions
- Pin the CLI to a specific reviewed version instead of resolving the latest release:
bash npm install -g amazon-ads-open-cli@<reviewed-version> - Document the expected npm registry, package publisher, repository, and reviewed release checksum.
- Verify package integrity and provenance before installation, including npm provenance attestations where available.
- Prefer a project-local or isolated installation over a global installation to reduce command-path and system-wide exposure.
- Use a lockfile or another reproducible dependency mechanism where practical.
- Disable npm lifecycle scripts during installation when the reviewed package does not require them, and explicitly document any scripts that are necessary.
- Audit or vendor the executable implementation before allowing it to access Amazon Ads credentials.
- Run the CLI with a dedicated, least-privileged operating-system identity and an Amazon OAuth token restricted to the minimum required scopes.
- Store the credential file with restrictive filesystem permissions and avoid exposing tokens in command-line arguments, logs, or command output.
- Provide an approved installation artifact or verified release digest so the installed implementation cannot silently change after Skill review.
- Pin the CLI to a specific reviewed version instead of resolving the latest release:
