Back to skill

Security audit

finding-brand-collaborations-on-tiktok

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed Apify/TikTok research workflow, but users should handle the Apify token and saved outputs carefully.

Install only if you are comfortable sending TikTok search terms and collected public TikTok data to Apify/apidojo. Prefer the MCP or helper flow where credentials are handled securely, avoid putting regulated or secret information in keywords, and do not use the REST fallback with the token in the URL unless you understand the logging exposure risk.

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

Apify API Token Exposed in Request URL

Content
View full analysis

Vulnerability Details

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

Vulnerable Code

bash
curl -X POST   "https://api.apify.com/v2/acts/apidojo~tiktok-scraper/runs?token=$APIFY_TOKEN"   -H "Content-Type: application/json"   -d '{
    "keywords": ["#ad", "#sponsored", "#fitnesspartner"],
    "maxItems": 300
  }'

Technical Analysis

The REST fallback interpolates the APIFY_TOKEN environment variable directly into a URL query parameter. Although HTTPS protects the request in transit, URLs can be exposed outside the encrypted connection through shell history, process command-line inspection, debugging output, reverse-proxy logs, monitoring systems, and server access logs.

Consequently, users following this documented command may unintentionally disclose a reusable account credential to local users or infrastructure operators with access to those records.

Attack Path

  1. A user sets APIFY_TOKEN and runs the documented REST fallback command.
  2. The shell expands $APIFY_TOKEN into the command-line URL.
  3. The complete URL is retained or observed through shell history, process inspection, diagnostic output, proxy telemetry, or access logs.
  4. An attacker with access to one of those sources extracts the token.
  5. The attacker submits unauthorized requests to Apify APIs using the stolen token.
  6. The attacker can exercise any capabilities granted to that token until it is revoked or expires.

Impact Assessment

Successful exploitation may permit unauthorized use of Apify resources within the compromised token's permission scope. Potential consequences include running actors, consuming quotas, causing unexpected charges, and accessing account-scoped resources or results available to the token.

This issue does not independently grant operating-system privileges. Its scope is limited by the permissions associated with the exposed Apify token.

Remediation
View remediation

Remediation Suggestions

Transmit the token in an authorization header rather than a URL query parameter:

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": ["#ad", "#sponsored", "#fitnesspartner"],
    "maxItems": 300
  }'

Apply the following additional controls:

  1. Avoid enabling shell tracing, verbose HTTP output, or debug logging when secrets are present.
  2. Ensure authorization headers are redacted from application, proxy, and observability logs.
  3. Store the token in a protected secret manager or restricted environment variable rather than source files.
  4. Grant the token only the minimum permissions required for actor execution.
  5. Rotate any token previously used with the query-string example if relevant logs or command history may have been accessible.
  6. Add automated documentation or static checks that reject credentials in URL query parameters.
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 (3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs users to run an external Apify actor, save results to local files, and supply an APIFY_TOKEN, but it does not clearly warn that query terms and collected TikTok data will be transmitted to a third-party service and may be written to disk. This creates a real privacy and operational risk, especially if users include sensitive competitive-intelligence terms, customer data, or run it in environments where local artifact creation is restricted.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The REST fallback explicitly sends user-supplied search terms and an APIFY_TOKEN to api.apify.com, which is a third-party endpoint. Without clear consent and data-handling guidance, this can expose sensitive research topics, identifiers, or credentials through outbound network transmission and service-side logging.

Content

Scanner excerpt · SKILL.md (reported line 89)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": ["#ad", "#sponsored", "#fitnesspartner"],
    "maxItems": 300
  }'

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The REST fallback explicitly sends user-supplied search terms and an APIFY_TOKEN to api.apify.com, which is a third-party endpoint. Without clear consent and data-handling guidance, this can expose sensitive research topics, identifiers, or credentials through outbound network transmission and service-side logging.

Content

Scanner excerpt · SKILL.md (reported line 89)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": ["#ad", "#sponsored", "#fitnesspartner"],
    "maxItems": 300
  }'

Static analysis

No suspicious patterns detected.