Back to skill

Security audit

Microsoft Ads CLI

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a Microsoft Ads reporting helper, but it tells agents to globally install an unpinned third-party npm CLI that will handle ad-account credentials.

Install only if you trust the microsoft-ads-cli npm package and are comfortable giving it access to Microsoft Ads credentials and account reporting data. Prefer a pinned, reviewed, local install, avoid running it with elevated privileges, and keep the credentials file tightly permissioned.

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:29
Finding

Unpinned Global Installation of a Third-Party npm Package

Content
View full analysis
Remediation
View remediation
``` 2. Verify the package's npm publisher, repository association, provenance attestations, and integrity before use. 3. Record and validate the expected package tarball integrity hash. 4. Prefer a project-local, lockfile-controlled installation over global installation: ```bash npm install --save-exact microsoft-ads-cli@ ``` 5. Disable npm lifecycle scripts with `--ignore-scripts` when the reviewed package does not require them. 6. Execute the CLI in a restricted environment with access only to the credentials and filesystem paths required for Microsoft Ads reporting. 7. Avoid installing the package with `sudo`, an administrator account, or another privileged context. 8. Review the referenced CLI implementation and each dependency update before changing the pinned version. 9. Store Microsoft Ads credentials in a secure credential manager where supported. If a JSON credential file remains necessary, restrict its permissions to the owning user and never print its contents in logs. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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 (4)

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 37)May include surrounding context.

md
## Authentication

The CLI requires a Microsoft **OAuth2 access token** and a **Developer Token**. Credentials are resolved in this order:

1. `--credentials <path>` flag (per-command)
2. Environment variables: `MICROSOFT_ADS_ACCESS_TOKEN` + `MICROSOFT_ADS_DEVELOPER_TOKEN` (both required), plus optional `MICROSOFT_ADS_CUSTOMER_ID` and `MICROSOFT_ADS_ACCOUNT_ID`

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 361)May include surrounding context.

md
## Authentication

The CLI requires a Microsoft **OAuth2 access token** and a **Developer Token**. Credentials are resolved in this order:

1. `--credentials <path>` flag (per-command)
2. Environment variables: `MICROSOFT_ADS_ACCESS_TOKEN` + `MICROSOFT_ADS_DEVELOPER_TOKEN` (both required), plus optional `MICROSOFT_ADS_CUSTOMER_ID` and `MICROSOFT_ADS_ACCOUNT_ID`

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 41)May include surrounding context.

md
1. `--credentials <path>` flag (per-command)
2. Environment variables: `MICROSOFT_ADS_ACCESS_TOKEN` + `MICROSOFT_ADS_DEVELOPER_TOKEN` (both required), plus optional `MICROSOFT_ADS_CUSTOMER_ID` and `MICROSOFT_ADS_ACCOUNT_ID`
3. Auto-detected file: `~/.config/microsoft-ads-cli/credentials.json`

The credentials file format:

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill claims the CLI is read-only, but the description also says it can manage conversion goals, which implies write-capable operations. This mismatch can mislead an agent into invoking actions with side effects under the assumption that the tool is safe for read-only use, increasing the risk of unintended configuration changes in a live advertising account.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.