Back to skill

Security audit

scraping-youtube-comments

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed Apify-based YouTube comment scraper, but it has scope mismatches and unsafe API-token handling examples that should be reviewed before use.

Review and narrow the skill before installing if you only want video comment scraping. Prefer Apify MCP or an Authorization header instead of token-in-URL curl examples, use a limited Apify token, and treat exported comment datasets as potentially personal data.

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

Apify API Token Exposed in URL Query Parameters

Content
View full analysis
"], "maxComments": 200}' ``` Save `id` as `RUN_ID`. Poll until `status = SUCCEEDED`: ```bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"' ``` Fetch results: ```bash curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN&format=json" ``` ``` ### Technical Analysis The REST fallback embeds `APIFY_TOKEN` directly in the query string of three URLs. Network access to Apify is necessary for the declared YouTube-comment scraping functionality, and the requests use HTTPS. However, placing a reusable credential in a URL creates unnecessary exposure beyond the minimum privileges required. After shell expansion, the token becomes part of the `curl` command-line argument and full request URL. Query strings can consequently be captured by: - Local process inspection or process-accounting facilities. - Shell tracing and diagnostic output. - HTTP proxy, gateway, monitoring, and server access logs. - Error reports or copied command output. - Automation systems that record command lines or requested URLs. HTTPS protects the request from passive interception in transit but does not prevent credential disclosure through endpoints, process metadata, or logging infrastructure. Apify supports authorization headers, so exposing the token in the query string is not necessary. The documentation also accepts user-provided YouTube URLs and submits them to the expected Apify service. That transfer is consistent with the Skill's declared remote scraping functionality and is not, by itself, an unrelated e ...[truncated 1487 chars]
Remediation
View remediation
"], "maxComments": 200}' curl \ -H "Authorization: Bearer $APIFY_TOKEN" \ "https://api.apify.com/v2/actor-runs/$RUN_ID" curl \ -H "Authorization: Bearer $APIFY_TOKEN" \ "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?format=json" ``` 3. Use a narrowly scoped Apify token with only the permissions required to run the specified actor and retrieve its results. 4. Avoid shell tracing, verbose HTTP diagnostics, and logging of authorization headers. 5. Store the token in a protected environment variable or secret manager rather than command history or project files. 6. Redact credentials from application, proxy, CI/CD, and monitoring logs. 7. Rotate the token immediately if the query-string workflow has been used in an environment where URLs or process arguments may have been retained. 8. Add secret-scanning and documentation linting checks that reject credentials in URL query parameters. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The heading and summary in L018-L020 present the skill as exporting comment datasets from YouTube videos. This is contradicted by the later input table in L031-L042, which supports channels, playlists, Shorts, search keywords, and trending retrieval rather than a strictly video-comment-only workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description in L003-L010 limits the skill to scraping comments from a YouTube video and returning per-comment fields. However, the documented inputs in L031-L042 describe a broader YouTube discovery/search scraper, including channel handles, trending retrieval, keyword search, regional filters, and a custom JavaScript mapping function, which goes beyond the stated comment-scraping purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

L048-L051 describe a constrained workflow for validating video URLs and running a scraper in comment mode. But L060-L074 invoke an actor with generic '{"param": "value"}' input and use a different actor name than the manifest metadata, undermining the claim that this skill is specifically scoped to YouTube video comments.

Content

No source excerpt is available for this finding.

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~youtube-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["<url>"], "maxComments": 200}'

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~youtube-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["<url>"], "maxComments": 200}'

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~youtube-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["<url>"], "maxComments": 200}'

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~youtube-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["<url>"], "maxComments": 200}'

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file describes exporting and saving YouTube comment data as CSV or JSON, which affects user data handling and may involve personal information such as usernames and comment text. Under the markdown-specific warning criterion, the description should disclose privacy or data-handling considerations when collecting and storing scraped content.

Content

No source excerpt is available for this finding.