Back to skill

Security audit

KOLens TikTok KOL Search

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed KOLens API guide for finding TikTok creators and contact details, with manageable risks around privacy compliance and verifying the API endpoint before sending a key.

Install only if you trust the KOLens service and have a legitimate basis to collect creator data. Set KOLENS_API_URL to the verified HTTPS endpoint from the service administrator, keep the API key scoped and revocable, avoid fetching contacts unless needed, and follow applicable privacy and anti-spam laws.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:53
Finding

Bearer Credential Disclosure Through an Unrestricted API Base URL

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 53-56
Vulnerability Type: Bearer credential transmission to a user-configurable network destination
Risk Level: Medium

Vulnerable Code

bash
curl -X POST "${KOLENS_API_URL}/api/scrape" \
  -H "Authorization: Bearer ${KOLENS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"keyword":"[KEYWORD]","max_videos":30,"fetch_contacts":true}'

The same pattern occurs at lines 77-78, 100-105, 133-134, 170-181, and 191-192.

Technical Analysis

KOLENS_API_URL is a required environment variable supplied independently of the Skill. The documented commands send KOLENS_API_KEY as a bearer credential to whichever origin is specified by this variable. The Skill does not require HTTPS, validate the hostname, or restrict the destination to an approved KOLens API origin.

Network access and bearer authentication are necessary for the declared KOLens functionality. However, permitting an arbitrary destination exceeds the minimum network privilege required. If the environment variable is misconfigured or influenced by an attacker, the API key will be disclosed directly in an HTTP authorization header. A plaintext http:// URL could also expose the credential to network interception.

This is not evidence of intentional exfiltration: the requests are consistent with the declared API workflow. The weakness is the lack of destination validation before transmitting a secret.

Attack Path

  1. An attacker influences deployment configuration, setup instructions, or the process environment.
  2. The attacker sets KOLENS_API_URL to an attacker-controlled URL, such as https://attacker.example.
  3. A user or agent invokes one of the documented curl commands.
  4. curl connects to the attacker-controlled server and sends Authorization: Bearer ${KOLENS_API_KEY}.
  5. The attacker records the bearer credential.
  6. The attacker reuses the credential ...[truncated 614 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the API origin in the Skill rather than accepting an unrestricted URL.
  2. If configurability is required, parse and validate the URL before every request:
    • Require the https scheme.
    • Permit only explicitly approved hostnames.
    • reject embedded credentials, unexpected ports, fragments, and malformed URLs.
  3. Prevent credentials from being forwarded to another origin. Do not enable redirect following for authenticated requests; if redirects are operationally required, validate every redirect destination against the same allowlist.
  4. Harden curl invocations with controls such as:
    bash
    curl --fail-with-body --proto '=https' --proto-redir '=https' --max-redirs 0 \
      -X POST "https://approved-kolens.example/api/scrape" \
      -H "Authorization: Bearer ${KOLENS_API_KEY}" \
      -H "Content-Type: application/json" \
      -d '{"keyword":"[KEYWORD]","max_videos":30,"fetch_contacts":true}'
    
  5. Use narrowly scoped, revocable, and short-lived credentials where supported.
  6. Document the canonical API hostname and warn users not to send the key to unverified endpoints.
  7. Rotate the API key immediately if it may have been used with an untrusted URL.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:170
Finding

Predictable Shared Temporary File Permits Symlink-Based File Overwrite

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 170-175
Vulnerability Type: Unsafe predictable temporary file
Risk Level: Medium

Vulnerable Code

bash
# 1. Submit job
curl -s -X POST "${KOLENS_API_URL}/api/scrape" \
  -H "Authorization: Bearer ${KOLENS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"keyword":"camping","max_videos":30,"fetch_contacts":true}' > /tmp/job.json

JOB_ID=$(cat /tmp/job.json | jq -r '.job_id')

Technical Analysis

The workflow writes API output to the fixed path /tmp/job.json. Shared temporary directories are commonly writable by multiple local users. Shell redirection opens the destination without securely creating a unique file and follows symbolic links.

An attacker with local access can pre-create /tmp/job.json as a symbolic link to another path. When the workflow runs, the shell may truncate and overwrite the linked target with the API response if the workflow's operating account has permission to write that target. An attacker may also pre-populate or race the predictable file to manipulate the job_id subsequently consumed by the workflow.

The temporary file is not necessary: the job identifier can be captured directly from the command output. If a file is required, it should be created atomically with unpredictable naming and restrictive permissions.

Attack Path

  1. A local attacker predicts that the workflow will use /tmp/job.json.
  2. Before invocation, the attacker creates a symbolic link:
    bash
    ln -s /path/writable-by-victim /tmp/job.json
    
  3. A more privileged or different local account runs the documented workflow.
  4. Shell redirection follows the symbolic link and truncates or overwrites the target with the API response.
  5. Alternatively, where file ownership and timing permit, the attacker substitutes crafted JSON containing an attacker-selected job_id.
  6. The workflow parses the substituted i ...[truncated 740 chars]
Remediation
View remediation

Remediation Suggestions

  1. Avoid a temporary file by parsing the response directly:
    bash
    JOB_ID=$(
      curl --fail-with-body -sS -X POST "${KOLENS_API_URL}/api/scrape" \
        -H "Authorization: Bearer ${KOLENS_API_KEY}" \
        -H "Content-Type: application/json" \
        -d '{"keyword":"camping","max_videos":30,"fetch_contacts":true}' |
      jq -er '.job_id'
    )
    
  2. If retaining the complete response is required, create the file securely:
    bash
    umask 077
    JOB_FILE=$(mktemp "${TMPDIR:-/tmp}/kolens-job.XXXXXX")
    trap 'rm -f "$JOB_FILE"' EXIT
    
  3. Write only to the path returned by mktemp; do not use predictable names in a shared directory.
  4. Validate the response with jq -e and reject missing, null, or malformed job identifiers.
  5. Do not run the workflow with elevated privileges unless explicitly required. Its declared functionality only requires outbound API access and ordinary user-level temporary storage.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly promotes collecting creators' contact information, including email and website data, but does not present a strong operational warning, consent boundary, or user-facing safeguard before enabling privacy-sensitive collection. This increases the risk of misuse for unsolicited outreach, spam, or privacy-law violations, especially because contact harvesting is a core advertised capability rather than an incidental byproduct.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

This command sends user-supplied search terms and an API credential to an external service, which is an external data transmission by design. In context, that is expected for an API integration, but it is still security-relevant because it transfers potentially sensitive user intent and uses a configurable endpoint, creating risk if the base URL is misconfigured, untrusted, or attacker-controlled.

Content

Scanner excerpt · SKILL.md (reported line 53)May include surrounding context.

Step 1: Submit a Scraping Job

bash
curl -X POST "${KOLENS_API_URL}/api/scrape" \
  -H "Authorization: Bearer ${KOLENS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"keyword":"[KEYWORD]","max_videos":30,"fetch_contacts":true}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

The workflow example repeats external transmission of data and credentials to the configured KOLens API and writes the returned job metadata to a local temporary file. While this is normal API usage, it still creates exposure through third-party transmission and local artifact handling if the endpoint is untrusted or the environment is shared.

Content

Scanner excerpt · SKILL.md (reported line 170)May include surrounding context.

bash
# 1. Submit job
curl -s -X POST "${KOLENS_API_URL}/api/scrape" \
  -H "Authorization: Bearer ${KOLENS_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"keyword":"camping","max_videos":30,"fetch_contacts":true}' > /tmp/job.json