Back to skill

Security audit

scraping-tiktok-user-data

Security checks for vulnerabilities and agentic risk

Overview

This TikTok scraping skill is mostly coherent, but it under-discloses optional full follower/following collection and shows a credential-handling pattern that users should review before installing.

Review this skill before installing if you may scrape follower or following lists. Use it only with authorized, minimum-necessary TikTok data, set explicit limits, avoid collecting complete social graphs unless needed, and prefer header-based Apify authentication over token-in-URL curl examples.

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

Apify API Token Exposed Through URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 83–94
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-user-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"username": "<handle>", "maxVideos": 50}'
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 places APIFY_TOKEN directly in URL query strings. Although authentication with Apify is necessary for the Skill's declared scraping functionality, transmitting the credential as part of a command-line URL unnecessarily broadens its exposure.

The shell expands $APIFY_TOKEN before launching curl, potentially making the credential visible in process arguments. Query strings may also be retained by shell tracing, command auditing, terminal capture, monitoring products, HTTP proxy logs, server access logs, and copied troubleshooting output. TLS protects the request in transit but does not prevent disclosure through these local or endpoint logging channels.

The network destination is consistent with the declared functionality, and there is no evidence that the Skill deliberately sends the token to an unrelated service. The vulnerability is the unsafe authentication mechanism rather than the required network access itself.

Attack Path

  1. A user sets a valid APIFY_TOKEN and follows the documented REST fallback.
  2. The shell expands the environment variable into the curl URL.
  3. A local process observer, command-auditing system, shell trace, proxy, server log, or diagnostic capture records the complete URL.
  4. An attacker with access to that record ...[truncated 553 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove authentication tokens from all URL query parameters.

  • Pass the credential through an authorization header supported by Apify, for example:

    bash
    curl \
      -H "Authorization: Bearer $APIFY_TOKEN" \
      "https://api.apify.com/v2/actor-runs/$RUN_ID"
    
  • Apply the same header-based authentication approach to actor launch, status polling, and dataset retrieval requests.

  • Disable shell tracing around commands that handle credentials and avoid printing complete request headers or URLs in diagnostics.

  • Use narrowly scoped tokens where the platform supports them.

  • Rotate the token immediately if it may already have appeared in process telemetry, proxy logs, command logs, or shared troubleshooting output.

  • Ensure monitoring and logging systems redact authorization credentials.

  • Document that retrieved TikTok data is sent to and processed by the third-party Apify actor, especially when optional follower or following collection is enabled.

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 (7)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The output description says the skill returns only video-level data, while later inputs permit follower/following list extraction. This mismatch can mislead users and downstream agents about the sensitivity of the exported data, causing over-collection or accidental handling of personal social-graph information under weaker safeguards.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is presented as a video-history scraper, but its documented inputs also enable extraction of complete follower and following lists. That broadens the data collection scope into relationship-graph scraping without clearly constraining usage, increasing privacy and compliance risk because operators may collect more personal data than users expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill documents collection of complete follower and following lists and detailed TikTok user data but provides no privacy warning or use-limitation notice. Collecting and exporting social-graph data can create privacy, platform-policy, and regulatory exposure, especially when users may not realize the breadth of personal data being scraped.

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tiktok-user-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"username": "<handle>", "maxVideos": 50}'

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tiktok-user-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"username": "<handle>", "maxVideos": 50}'

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tiktok-user-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"username": "<handle>", "maxVideos": 50}'

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~tiktok-user-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"username": "<handle>", "maxVideos": 50}'

Static analysis

No suspicious patterns detected.