Back to skill

Security audit

extracting-tiktok-comments-for-research

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its TikTok comment research purpose, but it needs review because it collects public user data through Apify and documents an insecure token-in-URL fallback.

Review before installing. Use this only when you intend to send TikTok URLs and resulting public comments/usernames to Apify or Apidojo for processing. Prefer an Authorization header or official Apify tooling over the documented token-in-query curl example, use a least-privilege Apify token, and consider anonymizing or minimizing exported commenter identifiers.

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

Apify API Token Exposed in URL Query String

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 98–108
Vulnerability Type: Credential exposure through a URL query parameter
Risk Level: Medium

Vulnerable Code

bash
**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 '{
    "postURLs": [
      "https://www.tiktok.com/@[handle]/video/[VIDEO_ID]"
    ],
    "maxCommentsPerPost": 500,
    "includeReplies": false
  }'
text

### Technical Analysis

The Skill instructs users or agents to place `APIFY_TOKEN` directly in an HTTPS URL query string. Although TLS protects the URL while it is in transit, query strings are commonly retained by shell history, command-line auditing, process inspection, proxy and API access logs, observability platforms, and copied command output.

Sending data to Apify is necessary for the Skill's declared TikTok scraping function. However, exposing the credential in the URL is not necessary and exceeds the minimum exposure required to authenticate the request. The token should be conveyed through an authorization header so that it is less likely to be recorded by URL-oriented logging systems.

No evidence was found that the Skill intentionally sends the token to an unrelated destination. The risk is the insecure transport location and incidental disclosure of a reusable credential.

### Attack Path

1. A user or agent follows the documented REST fallback command with a valid `APIFY_TOKEN`.
2. The expanded command or complete request URL is captured in shell history, process telemetry, command auditing, proxy logs, API access logs, or monitoring data.
3. An attacker with access to one of those records extracts the query-string token.
4. The attacker submits authenticated requests to Apify using the stolen token.
5. Apify operations available to that token can then be perform
...[truncated 583 chars]
Remediation
View remediation

Remediation Suggestions

Remove the token from the query string and send it in an authorization header:

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 '{
    "postURLs": [
      "https://www.tiktok.com/@[handle]/video/[VIDEO_ID]"
    ],
    "maxCommentsPerPost": 500,
    "includeReplies": false
  }'

Apply the following additional controls:

  1. Use an Apify token restricted to the minimum permissions and resources required by this Skill.
  2. Prevent .env files and credentials from being committed by adding them to .gitignore and secret-scanning rules.
  3. Restrict permissions on local credential files to the owning user.
  4. Avoid printing tokens or expanded authenticated commands in logs and diagnostic output.
  5. Redact existing query parameters in proxy, API gateway, and observability logs.
  6. Rotate any token that may already have been exposed through command history or request logging.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest says the skill extracts comments from 'any video or creator' and the workflow suggests pulling from a creator handle, but the actual actor examples and dataset fields are centered on explicit video/post URLs and per-comment fields only. It also promises returned fields limited to username, comment text, likes, reply count, and timestamp, which does not substantiate later creator-level or bio-based analysis capabilities.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger description is broad enough to activate on common research or sentiment-analysis requests that may not clearly imply TikTok scraping or external data collection. In an agent environment, this can cause over-triggering and unexpected collection/transmission of user-specified targets to a third-party service, increasing privacy, consent, and data-handling risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill instructs collection of public TikTok comments and commenter usernames without any warning about privacy expectations, platform terms, or downstream handling of personal data. Even though the data is public, usernames and comment text are still personal data in many contexts, and silent collection or export to a third-party processor can create compliance and trust risks.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The skill explicitly sends user-provided TikTok URLs and associated scraping job data to an external Apify endpoint. External transmission is expected for this skill, but it is still security-relevant because users may not realize their research targets and potentially collected personal data are being processed by a third party.

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~tiktok-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{

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 101)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 '{
    "postURLs": [

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Step 4 instructs analysis 'From commenter bios (if available),' but Step 3 enumerates the extracted fields and includes only comment text, username, likes, reply count, and timestamp. This is not just incomplete documentation; it directs an analysis based on data the documented workflow does not obtain.

Content

No source excerpt is available for this finding.