Back to skill

Security audit

discovering-viral-tiktok-content-trends

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a straightforward TikTok trend research workflow, but its REST fallback places an Apify API token in a URL, which can expose a reusable credential in logs or process listings.

Review before installing. Use the MCP or helper-script path where possible, and avoid the documented REST fallback unless changed to send APIFY_TOKEN in an Authorization header. Treat the Apify token as a secret, use a narrowly scoped token if available, avoid logging commands that include it, and rotate the token if it has already been used in a URL.

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

Apify API Token Exposed in URL Query Parameter

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 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": ["#skincaretips", "#skincaretiktok"], "maxItems": 200}'

Technical Analysis

The REST fallback places APIFY_TOKEN in the request URL. When the shell expands the variable, the resulting command contains the complete credential in its query string.

Although HTTPS protects the request from passive network interception, it does not prevent the URL from being exposed through local process inspection, shell tracing, HTTP access logs, reverse proxies, monitoring systems, debugging output, or other telemetry that records complete URLs. Query parameters are commonly retained more broadly than authorization headers and therefore should not contain reusable credentials.

Attack Path

  1. A user follows the documented REST fallback with APIFY_TOKEN set.
  2. The shell expands $APIFY_TOKEN into the URL query parameter.
  3. The complete URL may be captured by process-monitoring facilities, shell tracing, proxy logs, API access logs, or observability tooling.
  4. An attacker who can read one of those records extracts the reusable token.
  5. The attacker submits authenticated requests to Apify using the exposed token.
  6. The attacker can consume resources or access data within the token's existing authorization scope until the token is revoked or expires.

Impact Assessment

Successful exploitation grants the attacker the same Apify API privileges assigned to the compromised token. Depending on its scope, this may permit unauthorized actor runs, consumption of paid platform resources, access to associated run results or datasets, and financial charges against the token owner's account.

The issue does not itself provide loca ...[truncated 80 chars]

Remediation
View remediation

Remediation Suggestions

Remove the token from the query string and use Apify's supported authorization header:

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":["#skincaretips","#skincaretiktok"],"maxItems":200}'

Apply the following additional controls:

  1. Use a narrowly scoped token with only the permissions required to run the intended actor.
  2. Prevent commands, headers, and environment variables containing credentials from being printed or included in debug logs.
  3. Redact authorization data in application, proxy, and observability logs.
  4. Store the token in an approved secret manager or protected environment variable rather than source-controlled files.
  5. Rotate any token that may previously have appeared in URL or process logs.
  6. Review retained telemetry and access logs for historical token exposure and unauthorized use.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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 (4)

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 88)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": ["#skincaretips", "#skincaretiktok"], "maxItems": 200}'

Filter: playCount >= min_views

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 88)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": ["#skincaretips", "#skincaretiktok"], "maxItems": 200}'

Filter: playCount >= min_views

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The instruction says to use English-language posts if targeting an English-speaking audience, which imposes a language choice in the workflow rather than presenting it as an explicit user preference. The policy requires language or locale constraints to be optional, user-chosen, or clearly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The markdown instructs users to set the APIFY_TOKEN environment variable, which is a credential, but does not include any caution about keeping the token secret or avoiding sharing it in commands, logs, or output. Because this skill uses that credential to call an external service, a brief warning about credential handling would improve user awareness.

Content

No source excerpt is available for this finding.