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: Unsafe and unpinned third-party dependency installation
Risk Level: MediumComplete Code Snippet:
bash # Check if the CLI is available meta-ads-open-cli --help # Get authenticated user info meta-ads-open-cli me # List accessible ad accounts meta-ads-open-cli ad-accountsIf the CLI is not installed, install it:
bash npm install -g meta-ads-open-cliTechnical Analysis
The Skill instructs the agent to globally install the latest registry version of
meta-ads-open-cliwithout pinning an audited version or verifying package integrity. An unversioned npm installation resolves dynamically, meaning the installed package and its transitive dependencies can change after the Skill has been reviewed.npm packages may execute lifecycle scripts during installation. If the package, one of its dependencies, its maintainer account, or the package registry distribution channel is compromised, attacker-controlled code could execute with the privileges of the user running the installation. The global
-ginstallation also modifies an environment outside the project directory and may expose the installed executable to unrelated sessions.The credential auto-discovery documented at
SKILL.md:31-42is functionally relevant to authenticated Meta API access and does not itself demonstrate credential exfiltration. However, a compromised CLI installed through this dependency path could attempt to accessMETA_ADS_ACCESS_TOKENor~/.config/meta-ads-open-cli/credentials.json.Attack Path
- An attacker compromises the npm package maintainer, published package, transitive dependency, or registry distribution path.
- The attacker publishes a malicious release that becomes the version selected by the unpinned installation command.
- The agent finds that the CLI is unavailable and follows the Skill instructi ...[truncated 1126 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin
meta-ads-open-clito an exact version that has been reviewed, rather than resolving the latest release:bash npm install --global --ignore-scripts meta-ads-open-cli@<reviewed-exact-version> - Verify the package source, publisher, provenance, and integrity before installation. Record an expected integrity hash where the installation mechanism permits it.
- Avoid global installation. Prefer a project-local, isolated environment or an approved preinstalled binary so the package cannot modify shared user tooling.
- Disable npm lifecycle scripts with
--ignore-scriptsunless the reviewed package demonstrably requires them. If scripts are required, audit those scripts and all transitive dependencies first. - Use a lockfile and automated dependency scanning for a locally managed installation.
- Run the CLI as a non-privileged user and never invoke the npm installation with
sudoor administrator rights. - Grant the Meta token only the API permissions required for the requested operation. Use a dedicated token and credential file with restrictive filesystem permissions.
- Do not expose token values in command output or logs, and rotate the token if dependency compromise is suspected.
- Pin
