Back to skill

Security audit

Analyzing TikTok Hashtag Performance

Security checks for vulnerabilities and agentic risk

Overview

The skill is transparent about using Apify to analyze TikTok data, but it exposes broader scraper controls and insecure token handling that deserve review before installation.

Install only if you are comfortable giving the agent access to an Apify token and sending TikTok targets to Apify. Keep runs scoped to user-requested hashtags, set maxItems, avoid customMapFunction unless you fully trust the code, and prefer MCP or an authorization-header API pattern over the token-in-URL curl example.

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

Apify API Token Exposed in URL Query String

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 92–96
Vulnerability Type: Sensitive credential exposure through a URL query parameter
Risk Level: Medium

Complete Code Snippet:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tiktok-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "keywords": ["[hashtag1]", "[hashtag2]", "[hashtag3]"]
  }'

Technical Analysis

The REST fallback places APIFY_TOKEN in the request URL. Although the token is read from an environment variable rather than hardcoded, expanding it into a query string increases the likelihood of credential disclosure.

URLs may be retained by shell or command-execution telemetry, HTTP clients, reverse proxies, gateways, application logs, monitoring platforms, and error reports. Depending on the execution environment, the expanded command may also be observable through process inspection. TLS protects the request while it is in transit but does not prevent the URL from being recorded at either endpoint or by local observability systems.

Attack Path

  1. A user or agent follows the documented REST fallback with a valid APIFY_TOKEN.
  2. The shell expands $APIFY_TOKEN into the URL before invoking curl.
  3. The complete URL is captured by process telemetry, debugging output, proxy or server access logs, monitoring infrastructure, or another logging mechanism.
  4. An attacker with access to one of those records extracts the token.
  5. The attacker submits authenticated requests to Apify using the exposed token.
  6. The attacker can perform actions permitted by that token until it is revoked, rotated, or otherwise expires.

Impact Assessment

Successful exploitation grants the attacker the same Apify API privileges as the compromised token. Depending on its permissions, this may permit unauthorized actor runs, consumption of account resources or credits, and access t ...[truncated 218 chars]

Remediation
View remediation

Remediation Suggestions

  • Use Apify's supported authorization-header mechanism instead of placing the token in the URL. For example, where supported:

    bash
    curl -X POST \
      "https://api.apify.com/v2/acts/apidojo~tiktok-scraper/runs" \
      -H "Authorization: Bearer $APIFY_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "keywords": ["[hashtag1]", "[hashtag2]", "[hashtag3]"]
      }'
    
  • Confirm the exact authentication-header syntax against the current Apify API documentation before publishing the replacement.

  • Configure command, proxy, application, and monitoring logs to redact authorization headers and known secret values.

  • Grant the token only the minimum permissions needed for actor execution and dataset retrieval.

  • Rotate the token if the documented command has already been used in an environment where URLs or process arguments may have been retained.

  • Avoid enabling verbose HTTP or shell tracing while authenticated requests are executed.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

User-supplied JavaScript is an arbitrary execution primitive that is not justified by the stated purpose of analyzing hashtag performance. This makes the skill significantly more dangerous because an attacker can smuggle logic into the external processing pipeline, potentially altering outputs, exfiltrating accessible data, or abusing the actor beyond intended analytics.

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 hashtag-performance analysis, but its documented inputs allow broad TikTok scraping targets such as profiles, music pages, locations, and arbitrary searches. This scope expansion increases the chance the skill is repurposed to collect unrelated data beyond user expectations, weakening least-privilege and making misuse easier.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Allowing a customMapFunction introduces arbitrary JavaScript transformation capability that is unnecessary for a hashtag-analysis skill and materially broadens what downstream processing can do. Even if executed by the external actor, exposing arbitrary code input creates a code-injection and data-manipulation surface that can be abused to process or extract more than intended.

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

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tiktok-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 99)May include surrounding context.

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tiktok-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "keywords": ["[hashtag1]", "[hashtag2]", "[hashtag3]"]

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The markdown instructs users to set an APIFY_TOKEN environment variable, which is a credential, but does not include any warning to keep the token secret, avoid committing it to files, or avoid exposing it in shared logs or commands. Because this file is a markdown skill description and explicitly discusses credential use, a brief warning about secure handling would improve user safety.

Content

No source excerpt is available for this finding.