Back to skill

Security audit

Pinterest Ads CLI

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its Pinterest Ads reporting purpose, but it asks agents to globally install an unpinned third-party CLI and then use sensitive Pinterest account, audience, billing, and lead-form data.

Review before installing. Use a pinned, locally installed version of the CLI where possible, verify the npm package provenance, avoid exposing broad OAuth scopes, and treat audience, billing, customer-list, and lead-form outputs as sensitive data that should be summarized or redacted unless the user clearly needs the raw records.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
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: Unpinned third-party dependency installed globally
Risk Level: Medium

Vulnerable Code

markdown
If the CLI is not installed, install it:

```bash
npm install -g pinterest-ads-cli
text

### Technical Analysis

The Skill instructs the agent to install the latest available version of `pinterest-ads-cli` globally. It does not specify an exact reviewed version, provide a lockfile or integrity hash, verify package provenance, or include the dependency's source code in the audited project.

Because npm packages can define lifecycle scripts that execute during installation, the effective code run by this instruction may change after the Skill has been reviewed. Global installation also places the package outside the project boundary and can expose the user's broader environment to package installation logic.

The external package implementation was not included in the audited artifact. Therefore, the package's read-only behavior and network destinations cannot be independently verified by this audit. This finding identifies an unsafe supply-chain mechanism; it does not establish that the current npm package is malicious.

### Attack Path

1. An attacker compromises the npm publisher account, package registry entry, or upstream release process for `pinterest-ads-cli`.
2. The attacker publishes a malicious release containing an npm lifecycle script or modified CLI implementation.
3. An agent follows the Skill's unpinned instruction and executes `npm install -g pinterest-ads-cli`.
4. npm retrieves the attacker-controlled latest release and may execute its lifecycle scripts with the installing user's privileges.
5. The malicious package can access resources available to that user, potentially including local files and the Pinterest OAuth credential subsequently provided through the environment or credential file.
6. If invoked later, a modified CLI could also misuse o
...[truncated 1090 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the package to an exact version that has been reviewed:

    bash
    npm install --save-exact pinterest-ads-cli@<reviewed-version>
    
  2. Prefer a project-local installation over npm install -g so that the dependency remains scoped to the project and can be managed through a lockfile.

  3. Commit a package lockfile containing npm integrity metadata and use a reproducible installation command such as npm ci.

  4. Verify package provenance, publisher identity, repository linkage, signatures or attestations where available, and the contents of the published npm artifact.

  5. Disable lifecycle scripts during installation when the reviewed package does not require them:

    bash
    npm install --ignore-scripts --save-exact pinterest-ads-cli@<reviewed-version>
    
  6. Run the CLI in a restricted environment with only the required files, network access, and minimum OAuth scopes exposed.

  7. Protect the credential file with restrictive permissions, avoid logging tokens, and use only the scopes required for the requested operation, such as ads:read, catalogs:read, user_accounts:read, or billing:read.

  8. Include or vendor reviewable CLI source in the audited artifact, or cryptographically bind installation instructions to the exact artifact that was reviewed.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

md
## Authentication

The CLI requires a Pinterest **OAuth2 access token**. Most commands need the `ads:read` scope. Additional scopes may be required for specific commands: `catalogs:read` for catalog commands, `user_accounts:read` for trends, and `billing:read` for billing data. Credentials are resolved in this order:

1. `--credentials <path>` flag (per-command)
2. Environment variable: `PINTEREST_ADS_ACCESS_TOKEN`

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 583)May include surrounding context.

md
## Authentication

The CLI requires a Pinterest **OAuth2 access token**. Most commands need the `ads:read` scope. Additional scopes may be required for specific commands: `catalogs:read` for catalog commands, `user_accounts:read` for trends, and `billing:read` for billing data. Credentials are resolved in this order:

1. `--credentials <path>` flag (per-command)
2. Environment variable: `PINTEREST_ADS_ACCESS_TOKEN`

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 586)May include surrounding context.

md
## Authentication

The CLI requires a Pinterest **OAuth2 access token**. Most commands need the `ads:read` scope. Additional scopes may be required for specific commands: `catalogs:read` for catalog commands, `user_accounts:read` for trends, and `billing:read` for billing data. Credentials are resolved in this order:

1. `--credentials <path>` flag (per-command)
2. Environment variable: `PINTEREST_ADS_ACCESS_TOKEN`

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 43)May include surrounding context.

md
1. `--credentials <path>` flag (per-command)
2. Environment variable: `PINTEREST_ADS_ACCESS_TOKEN`
3. Auto-detected file: `~/.config/pinterest-ads-cli/credentials.json`

The credentials JSON file format:

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 584)May include surrounding context.

md
1. `--credentials <path>` flag (per-command)
2. Environment variable: `PINTEREST_ADS_ACCESS_TOKEN`
3. Auto-detected file: `~/.config/pinterest-ads-cli/credentials.json`

The credentials JSON file format:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill explicitly guides use of audiences and customer-lists without any caution that results may expose sensitive audience segmentation or customer-derived data. In an agent setting, this increases the chance of disclosing marketing audience composition or customer list metadata to an unauthorized user or broader chat context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The billing section encourages use of billing-profiles, order-lines, and order-line but does not warn that these commands may reveal sensitive financial and account configuration data. In a skill used by an autonomous agent, absence of such guardrails can lead to unnecessary exposure of financial details in responses or logs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The lead form commands can expose lead-generation assets and potentially personal or business-contact information, yet the skill provides no privacy warning or handling guidance. This omission is risky because agents may surface raw lead form data directly to users or conversation history without validating authorization or minimizing disclosure.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.