Back to skill

Security audit

analyzing-youtube-competitor-channel-strategy

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward YouTube competitor-analysis helper that uses Apify as disclosed, with a credential-handling caution but no hidden or destructive behavior found.

Install only if you are comfortable using Apify for YouTube scraping and sending the requested channel/search data to Apify. Prefer MCP or a helper that uses authorization headers, avoid pasting token-bearing URLs into logs, and use a narrowly scoped Apify token where possible.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:86
Finding

Apify API Token Exposed in URL Query Strings

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 86–96
Vulnerability Type: API credential exposure through URL query parameters
Risk Level: Medium

Vulnerable Code

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~youtube-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": "https://www.youtube.com/@[COMPETITOR_CHANNEL]", "maxItems": 100}'
bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN"

Technical Analysis

The REST fallback embeds APIFY_TOKEN in URL query strings. This token is intentionally transmitted to the legitimate Apify API, so the behavior is not evidence of malicious exfiltration. Nevertheless, query-string authentication unnecessarily increases credential exposure.

When the shell expands $APIFY_TOKEN, the resulting secret-bearing URL may become visible in process arguments. URLs may also be captured by shell or command telemetry, debugging output, HTTP infrastructure, proxy logs, server access logs, monitoring platforms, and copied diagnostic records. HTTPS protects the request in transit but does not prevent exposure at either endpoint or through local process inspection.

The competitor channel identifiers and analysis parameters sent to Apify are necessary for the Skill's declared remote scraping functionality. The insecure placement of the authentication secret, rather than the network request itself, is the confirmed issue.

Attack Path

  1. A user configures a valid APIFY_TOKEN and follows the documented REST fallback.
  2. The shell expands $APIFY_TOKEN directly into each command's URL.
  3. A local process observer, telemetry collector, proxy, server logger, monitoring system, or diagnostic capture records the complete URL.
  4. An attacker with access to that record extracts the token.
  5. The attacker submits authenticated requests to Apify using the st ...[truncated 526 chars]
Remediation
View remediation

Remediation Suggestions

  • Use Apify's supported authorization header rather than a URL query parameter, for example:

    bash
    curl -X POST \
      "https://api.apify.com/v2/acts/apidojo~youtube-scraper/runs" \
      -H "Authorization: Bearer $APIFY_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"searchTerms": "https://www.youtube.com/@[COMPETITOR_CHANNEL]", "maxItems": 100}'
    
    bash
    curl \
      "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items" \
      -H "Authorization: Bearer $APIFY_TOKEN"
    
  • Avoid verbose shell tracing, request logging, or diagnostic output that could reveal authorization headers.

  • Configure log and telemetry systems to redact credentials and authorization metadata.

  • Use a narrowly scoped token with only the permissions required to run the designated actor and retrieve its output.

  • Prefer short-lived credentials where supported, rotate tokens regularly, and immediately revoke any token suspected of exposure.

  • Keep the token in a protected environment variable or secret manager and ensure .env files are excluded from source control with restrictive filesystem permissions.

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

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~youtube-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": "https://www.youtube.com/@[COMPETITOR_CHANNEL]", "maxItems": 100}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~youtube-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": "https://www.youtube.com/@[COMPETITOR_CHANNEL]", "maxItems": 100}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~youtube-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchTerms": "https://www.youtube.com/@[COMPETITOR_CHANNEL]", "maxItems": 100}'

Static analysis

No suspicious patterns detected.