T08 · Insecure Dependencies
- Location
SKILL.md:24- Finding
Unpinned Global Installation of a Third-Party CLI
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 24-28
Vulnerability Type: Unsafe third-party package installation
Risk Level: MediumVulnerable Code
markdown If the CLI is not installed, install it: ```bash npm install -g apple-ads-clitext ### Technical Analysis The Skill instructs the agent to install the latest available version of `apple-ads-cli` globally from the npm registry. The dependency is not pinned to a reviewed version and no package integrity hash, publisher verification, provenance requirement, or lifecycle-script restriction is specified. An npm installation may execute package lifecycle scripts such as `preinstall`, `install`, and `postinstall`. Global installation also places executable files into a shared command path. Consequently, the effective code executed by this Skill can change after the Skill itself has been reviewed. This risk is particularly significant because the installed CLI is subsequently entrusted with an Apple Ads OAuth access token and organization identifier. The Skill permits credentials to be supplied through environment variables, a command-line-selected credentials file, or the automatically detected `~/.config/apple-ads-cli/credentials.json` file. The repository contains only documentation and does not include the CLI implementation, so its claimed read-only behavior, credential handling, network destinations, and filesystem access cannot be independently verified from the audited artifact. No evidence establishes that the referenced package is currently malicious. The confirmed issue is the unsafe, unpinned global dependency installation procedure and the resulting supply-chain exposure. ### Attack Path 1. An attacker compromises the npm package, its publisher account, source repository, or release process. 2. The attacker publishes a new package version containing a malicious lifecycle script or modified CLI executable. 3. A user or age ...[truncated 1455 chars]- Remediation
View remediation
Remediation Suggestions
- Pin the CLI to a specifically reviewed version instead of installing the latest release:
bash npm install --global --ignore-scripts apple-ads-cli@REVIEWED_VERSION - Verify package provenance, publisher identity, repository ownership, release signatures, and npm integrity metadata before installation.
- Record and validate a cryptographic digest for the reviewed package archive in a trusted installation process.
- Avoid global installation. Prefer a locked, isolated project environment or a verified standalone artifact so the package cannot replace shared executables.
- Disable npm lifecycle scripts with
--ignore-scriptsunless a reviewed version demonstrably requires them. If scripts are required, audit each script before execution. - Vendor or include the reviewed CLI implementation where practical so its behavior can be audited together with the Skill.
- Run the CLI under a restricted account or sandbox with minimal filesystem and network access. Allow outbound traffic only to the required Apple API endpoints.
- Use a narrowly scoped Apple Ads credential with the minimum server-side permissions necessary for reporting. Do not reuse credentials across unrelated tools.
- Store the credentials file with owner-only permissions, avoid exposing tokens in broadly inherited environments, and never include credentials in command output or logs.
- Document the exact verified package version, expected network endpoints, credential-access behavior, and upgrade review procedure.
- Pin the CLI to a specifically reviewed version instead of installing the latest release:
