Back to skill

Security audit

Youtube Analytics CLI

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent YouTube analytics helper, but it asks users to globally install an unpinned third-party CLI that handles OAuth refresh tokens and private analytics data.

Review before installing. Use only a pinned, verified version of the CLI in an isolated environment, grant the minimum YouTube OAuth scopes needed, avoid the monetary-read scope unless revenue reporting is required, and never paste refresh tokens, client secrets, or credential file contents into chat or logs.

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 Credential-Handling Third-Party CLI

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 Snippet

markdown
If the CLI is not installed, install it:

```bash
npm install -g youtube-analytics-cli
text

### Technical Analysis

The Skill instructs the agent to install the latest available version of `youtube-analytics-cli` globally from the npm registry. The dependency is not pinned to a reviewed version or integrity hash, and its implementation is not included in the audited project.

This CLI is subsequently trusted to process sensitive YouTube authentication material, including API keys, OAuth client secrets, and refresh tokens. Because the installed version can change after this Skill has been reviewed, the effective executable payload is not fixed. A compromised maintainer account, registry compromise, malicious release, or package-identity mistake could cause arbitrary package installation or runtime code to execute under the privileges of the user running the agent.

Global installation increases the affected scope by modifying the user's shared executable environment. It may also expose later invocations to the compromised version. The documentation alone does not prove that the package is malicious; the vulnerability is the unsafe, unpinned supply-chain trust boundary.

The documented credential-file access and communication with Google APIs are otherwise consistent with the Skill's declared YouTube analytics functionality. The requested OAuth scopes are read-only, with monetary-read access presented for revenue reports. No evidence in the audited file establishes transmission of credentials to unrelated endpoints, but the absent CLI implementation prevents verification of its actual secret handling and network destinations.

### Attack Path

1. An attacker compromises the npm package, its publisher account, or its releas
...[truncated 1445 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the dependency to a specifically reviewed version rather than installing the mutable latest release:
    bash
    npm install --global youtube-analytics-cli@<reviewed-version>
    
  2. Verify the package name, publisher, provenance, signatures where available, and registry source before installation.
  3. Lock and verify the expected package integrity digest in a controlled installation process.
  4. Prefer a project-local, isolated installation over a global installation so the package cannot modify the user's shared executable environment.
  5. Vendor the reviewed CLI implementation into the audited package, or include its locked source and dependency manifest so credential and network behavior can be independently audited.
  6. Disable npm lifecycle scripts during installation where compatible, then explicitly review any required installation scripts.
  7. Run the CLI in a sandbox with restricted filesystem and network access, allowing only required Google API endpoints.
  8. Supply credentials only for the specific invocation, use credential files with restrictive filesystem permissions, and avoid broadly inherited environment variables.
  9. Grant only the OAuth scopes needed for the requested operation. Do not request the monetary-read scope unless the user explicitly requests revenue reporting.
  10. Document package verification and upgrade-review procedures so version changes cannot silently alter the executable code trusted with credentials.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

The skill explicitly directs use of local credential files, environment variables, and a refresh token for OAuth access. While normal for API clients, this is dangerous in an agent context because it encourages interaction with highly sensitive secrets that could be read, echoed, mishandled, or exfiltrated by surrounding tooling, and refresh tokens grant durable access to private account analytics.

Content

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

md
1. `--credentials <path>` flag (per-command)
2. `YOUTUBE_API_KEY`, `YOUTUBE_CLIENT_ID`, `YOUTUBE_CLIENT_SECRET`, `YOUTUBE_REFRESH_TOKEN` env vars
3. `~/.config/youtube-analytics-cli/credentials.json` (auto-detected)

The credentials JSON file supports these fields:

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The error-handling section reinforces operational paths involving OAuth secrets and the default credentials file location. Even though it is documentation, it normalizes handling long-lived tokens in a way that can prompt agents or users to troubleshoot by exposing credential locations or contents, increasing risk of credential disclosure and unauthorized access to private analytics data.

Content

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

md
- **OAuth credentials required** -- the command needs `client_id`, `client_secret`, and `refresh_token`. API key alone is not sufficient for analytics commands.
- **Token refresh failed** -- the refresh token may be expired or revoked. The user needs to re-authorize and obtain a new refresh token.
- **No credentials found** -- provide credentials via `--credentials`, environment variables, or `~/.config/youtube-analytics-cli/credentials.json`.
- **HTTP 403 Forbidden** -- the OAuth scopes may be insufficient, or the YouTube Analytics API may not be enabled in the Google Cloud project.
- **Empty results** -- check date range, metrics/dimensions compatibility, and whether the channel has data for the requested period.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill advertises itself as read-only analytics/reporting, but the documentation also states it can manage analytics groups. That mismatch can cause users or higher-level agents to authorize or invoke the skill under a false assumption of non-mutating behavior, increasing the risk of unintended state-changing operations against the user's YouTube account.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger list includes broad terms like 'YouTube' and common analytics phrases, which can cause the skill to be invoked in unrelated conversations. Over-broad invocation is risky here because the skill can access private channel analytics when OAuth credentials are present, so accidental routing could expose sensitive account data or prompt unnecessary credential use.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Calling the CLI 'read-only' while instructing users to 'manage analytics groups' is a capability contradiction. In agentic environments, such contradictions are dangerous because planners may permit the skill in contexts where only non-mutating tools should be used, leading to accidental changes or overbroad trust.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill handles sensitive OAuth material including client secrets and refresh tokens, but does not provide a clear safety warning about secret handling, storage, and redaction. In an agent setting, that omission can lead users to paste credentials into chat, store them insecurely, or allow logs/output to expose private channel analytics and long-lived tokens.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.