Back to skill

Security audit

抖音KOL对标账号

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it can send API credentials and search inputs to any endpoint configured in the environment, so users should review it before installing.

Install only if you intend to use the AI Skills API for Douyin KOL research. Keep AISKILLS_BASE_URL unset or restricted to the legitimate service, use a limited API key, and avoid sending confidential campaign, customer, or competitive data unless that third-party processing is approved.

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
scripts/run.py:26
Finding

Unrestricted API Base URL Override Can Disclose Credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/run.py:26-40, 85-93 and duplicated in douyin-kol-search/scripts/run.py:26-40, 85-93
Vulnerability Type: Unvalidated credential-bearing request destination
Risk Level: Medium

Complete Code Snippet

python
def build_base_url():
    return os.getenv("AISKILLS_BASE_URL", DEFAULT_BASE_URL).rstrip("/")

def build_headers():
    api_key = os.getenv("AISKILLS_API_KEY", "").strip()
    tenant_id = os.getenv("AISKILLS_TENANT_ID", "default").strip() or "default"
    if not api_key:
        fail("AISKILLS_API_KEY is required")
    return {
        "Content-Type": "application/json",
        # Cloudflare blocks urllib's default Python user agent for this endpoint.
        "User-Agent": "ai-skills-runner/1.0 (+https://ai-skills.ai)",
        "Accept": "application/json",
        "X-API-Key": api_key,
        "X-Tenant-Id": tenant_id,
    }

def request_json(method, path, payload):
    body = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(
        f"{build_base_url()}{path}",
        data=body,
        method=method,
        headers=build_headers(),
    )
    try:
        with urllib.request.urlopen(req, context=SSL_CONTEXT) as response:
            return json.loads(response.read().decode("utf-8"))

Technical Analysis

The runner accepts AISKILLS_BASE_URL without validating its scheme, hostname, port, or origin. It subsequently attaches AISKILLS_API_KEY and AISKILLS_TENANT_ID to every request sent to that destination.

An attacker who can influence the process environment or deployment configuration can replace the legitimate endpoint with an attacker-controlled URL. The override can also use plaintext HTTP. The configured SSL context does not protect an HTTP request and does not prevent credential transmission to an unrelated HTTPS host with a valid certificate.

The same vulnerable implementation exists in both copies of the runner.

Attack Path

  1. The victim co ...[truncated 1128 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove AISKILLS_BASE_URL configurability if endpoint overrides are unnecessary.
  2. If overrides are required, parse the URL with urllib.parse.urlsplit() and enforce:
    • The https scheme.
    • An explicit allowlist of trusted hostnames.
    • Approved ports only.
    • No embedded username or password.
    • No fragments or unexpected path components.
  3. Reject plaintext HTTP even in development unless credentials are omitted and the mode is explicitly isolated.
  4. Prevent credential forwarding across origins. Disable redirects where practical or verify every redirect target before following it.
  5. Use a narrowly scoped API key with usage limits and rotation support.
  6. Apply the same fix to douyin-kol-search/scripts/run.py to keep both duplicated runners consistent.
  7. Add tests confirming that untrusted hosts, plaintext schemes, embedded credentials, unexpected ports, and cross-origin redirects are rejected before request headers are created or transmitted.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (15)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents use of environment variables and outbound network access to call an external API, but it does not declare any explicit tool scope such as allowed tools or permissions. This weakens least-privilege controls and makes it harder for a host system or reviewer to understand and constrain what the skill is allowed to access, increasing the blast radius if the runner or surrounding implementation is modified or abused.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README instructs users to send search parameters directly to an external API but does not warn that those inputs leave the local environment. Users may include sensitive business plans, customer data, campaign information, or competitive research terms in search parameters without realizing they are transmitted to a third party.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill enables allow_implicit_invocation for a broad, generic KOL-assistance use case without clear trigger boundaries or narrowing conditions. This can cause the agent to invoke the skill in loosely related contexts, increasing the chance of unintended data routing, over-broad tool use, or prompt-surface expansion when user queries mention creators, marketing, or competitor research.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The display name, description, and default prompt are written to target a Chinese-language use case, but there is no indication that users can choose another language or that the skill is intentionally restricted to a Chinese locale. This can violate language or locale policy when a skill imposes a language without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill enables implicit invocation with no visible trigger restrictions, scope limits, or user-consent guardrails. That increases the chance the agent will auto-select this skill in loosely related conversations, potentially causing unintended data routing, unwanted influence on recommendations, or invocation without clear user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest uses the question "如何找对标账号?" as an invocation-style description, which is broad enough to overlap with ordinary marketing or creator-assistance conversations. The file does not provide explicit trigger boundaries, exclusion conditions, or negative examples to clarify when this skill should activate versus when general advice should be given.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script takes arbitrary user-provided params from the CLI and forwards them to a remote SaaS endpoint without any disclosure, confirmation, or local filtering. In a skill intended to process creator-research inputs, those params may contain sensitive business data, campaign plans, contact details, or competitive intelligence, so silent transmission to a third party creates a real privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This JSON schema contains multiple user-facing titles, descriptions, and placeholders only in Chinese, such as "页码", "搜索关键词", and "选择内容分类标签进行筛选". Because the file does not offer multilingual support or explain that the skill is intentionally limited to a Chinese-speaking or region-specific context, it creates a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This manifest uses a generic user-facing question and broad skill name around finding benchmark accounts/KOLs, but does not define specific trigger phrases, scope limits, or exclusion conditions. In a manifest file, that ambiguity can cause unintended invocation for ordinary conversations about account discovery or marketing research.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The billing error path always returns a Chinese-language message regardless of user locale or preferences. This is a natural-language policy issue because the skill enforces a specific language without opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This JSON schema contains user-facing titles, descriptions, placeholders, and enum labels entirely in Chinese, but it does not indicate that the skill is China/Chinese-specific or provide any user language choice. Under the natural-language policy rule, forcing a specific language without opt-in can be a locale-policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The user-facing question and skill name are presented only in Chinese, which implies a fixed language/locale experience. There is no indication in this file that users can opt into another language or that the Chinese-only constraint is explicitly documented as a justified regional requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The billing-insufficient message is hardcoded in Chinese (余额不足,请前往 ... 充值后重试) even though the rest of the script is otherwise locale-neutral. This imposes a specific language on all users without opt-in or justification, which is a natural-language locale policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The visible natural-language fields are entirely in Chinese, with no indication that the skill is intended only for Chinese-speaking users or that another language can be selected. This can violate language/locale policy when a skill implicitly forces a specific language without opt-in or justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This code serializes the provided params and sends them to a remote service, along with tenant and API-key-based headers. While the network behavior is expected for a runner, there is no confirmation prompt or user-facing notice in this file explaining that supplied data will be transmitted off-host.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.