Back to skill

Security audit

analyzing-competitor-tiktok-content-strategy

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly coherent, but its examples handle an Apify credential in a way that could expose the token.

Install only if you are comfortable sending TikTok targets to Apify and using an Apify token. Prefer the Apify MCP or a helper that uses authorization headers; avoid the documented curl URL-token form, do not paste expanded tokens into logs or saved transcripts, and avoid customMapFunction unless you understand where that JavaScript runs.

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 Strings

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 92–97 and 114–119
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-profile-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"usernames": ["[handle1]", "[handle2]"]}'
bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tiktok-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "profiles": ["https://www.tiktok.com/@[handle1]"]
  }'

Technical Analysis

The documented REST fallback embeds APIFY_TOKEN in the request URL. When the shell expands the environment variable, the credential becomes part of the command-line argument and URL.

Although HTTPS encrypts the request in transit, it does not protect the token from exposure through local process inspection, shell or terminal logging, debugging output, proxy and access logs, monitoring platforms, error reports, or other systems that retain complete URLs. URL query parameters are commonly recorded more broadly than authorization headers.

Attack Path

  1. A user sets a valid APIFY_TOKEN and executes one of the documented REST fallback commands.
  2. The shell expands $APIFY_TOKEN into the URL passed to curl.
  3. A local observer or logging component captures the process arguments or complete request URL.
  4. An attacker extracts the exposed token from that record.
  5. The attacker submits authenticated requests to Apify using the stolen credential.
  6. The attacker can perform operations allowed by the token until it expires, is revoked, or is rotated.

Impact Assessment

Successful exploitation grants access equivalent to the permissions assigned to the compromised Apify token. Depending on its scope, an attacker could invoke actors, consume paid platform ...[truncated 255 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace query-string authentication with Apify's supported authorization-header mechanism so the token is not included in the URL.
  • Avoid passing secrets as command-line arguments wherever possible.
  • Ensure diagnostic tooling, proxies, and monitoring systems redact authorization data and sensitive query parameters.
  • Do not print expanded credentials in examples, debug output, or error messages.
  • Apply least privilege to Apify tokens and use separate tokens for distinct environments or workflows.
  • Rotate any token that may previously have been used with these commands and review relevant logs for unintended disclosure.
  • Add documentation warning users never to commit .env files or include tokens in saved command transcripts.
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 (5)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented inputs expand the skill from competitor profile analysis to broader TikTok scraping targets such as hashtags, music pages, search results, and locations. This increases the skill’s data collection scope beyond the stated purpose, which can enable over-collection, misuse, or user confusion about what data will be transmitted to the external scraping service.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Allowing a user-supplied custom JavaScript transformation function introduces a capability far beyond passive analytics and can enable arbitrary code execution within the scraper/output-processing environment. Even if intended for flexible formatting, this materially increases the attack surface and could be abused to manipulate outputs, exfiltrate additional data, or execute unauthorized logic.

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

REST API fallback:

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

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

REST API fallback:

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

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

REST API fallback:

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

Static analysis

No suspicious patterns detected.