Back to skill

Security audit

scraping-tiktok-comments

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned for TikTok comment scraping, but its REST examples place an Apify API token in URLs where it can be exposed in logs or process history.

Review before installing if you plan to use the REST fallback. Prefer an Apify MCP or helper that keeps credentials out of URLs, use a dedicated least-privilege APIFY_TOKEN, avoid command tracing or shared terminal logs, and treat scraped comment datasets as third-party processed 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:84
Finding

Apify API Token Exposed in URL Query Strings

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 84–97
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~tiktok-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["<url>"], "maxItems": 200}'
bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"'
bash
curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN&format=json"

Technical Analysis

The documented REST workflow embeds APIFY_TOKEN in request URL query strings. The credential is sent to the intended Apify domain over HTTPS, and authentication is necessary for the declared scraping functionality. However, placing a secret in a URL creates unnecessary exposure because URLs are commonly captured in shell history, process listings, terminal recordings, proxy and access logs, monitoring platforms, and copied diagnostic output.

This behavior exceeds minimum necessary credential exposure because Apify API authentication can be performed with an HTTP authorization header. HTTPS protects the request while in transit but does not prevent disclosure through local process inspection, command logging, endpoint monitoring, or server-side URL logging.

Attack Path

  1. A user exports a valid APIFY_TOKEN and runs one of the documented curl commands.
  2. The shell expands $APIFY_TOKEN into the command-line URL.
  3. A local user, process-monitoring tool, shell recorder, proxy, logging system, or diagnostic collector captures the expanded command or requested URL.
  4. An attacker obtains the captured token.
  5. The attacker reuses it against the Apify API within the token's assigned permissions.
  6. The attacker may consume account resources or access actor runs and datasets available to that token until it is revoked or e ...[truncated 641 chars]
Remediation
View remediation

Remediation Suggestions

Use Apify's authorization header instead of placing the token in the URL:

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

Apply the same header-based authentication to polling and dataset retrieval:

bash
curl \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  "https://api.apify.com/v2/actor-runs/$RUN_ID"
bash
curl \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?format=json"

Additional hardening measures:

  1. Issue a dedicated, least-privilege Apify token for this Skill.
  2. Store the token in an approved secret manager or protected environment variable rather than source files.
  3. Avoid verbose command tracing, such as set -x, while handling credentials.
  4. Ensure logs and diagnostics redact authorization headers and secret values.
  5. Rotate any token that may already have appeared in command history, process telemetry, logs, or shared terminal output.
  6. Document token revocation and incident-response procedures.
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 (5)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill clearly instructs the user to send TikTok video URLs and receive scraped comment data via Apify, but it does not disclose that this involves transmission to a third-party service. That omission can mislead users about data handling and trust boundaries, especially where URLs, derived datasets, or account-linked usage may be sensitive in enterprise or research contexts.

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tiktok-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["<url>"], "maxItems": 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 85)May include surrounding context.

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tiktok-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["<url>"], "maxItems": 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 92)May include surrounding context.

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tiktok-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls": ["<url>"], "maxItems": 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 97)May include surrounding context.

REST API fallback:

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

Static analysis

No suspicious patterns detected.