Back to skill

Security audit

抖音每日点赞飙升榜

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its Douyin ranking purpose, but it needs review because it uses an API key and external service while also advertising scheduled subscription pushes without clear persistence controls.

Install only if you are comfortable giving this skill a RedFox API key and sending Douyin ranking queries to redfox.hk. Treat subscription or automatic push features cautiously until the publisher documents scheduling, stored preferences, opt-out controls, and retention, and be careful with clickable video links because returned URLs are not strongly validated by the script.

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/douyin_daily_increment.py:173
Finding

Untrusted API Response Fields Are Rendered as Unsanitized Markdown

Content
View full analysis

Vulnerability Details

File Location: scripts/douyin_daily_increment.py, lines 173–191
Vulnerability Type: Improper output neutralization and insufficient URL validation
Risk Level: Medium

Vulnerable Code

python
for idx, item in enumerate(items[:limit], start=1):
    raw_title = (item.get("aweme_desc") or "-").replace("|", "|").replace("[", "【").replace("]", "】").replace("\n", " ").replace("\r", " ")
    work_url = item.get("share_url", "")
    if work_url:
        title = f"[{raw_title}]({work_url})"
    else:
        title = raw_title
    author = item.get("user_nickname", "-")
    cat = item.get("category") or "-"
    collect = format_number(item.get("add_collect_count"))
    comment = format_number(item.get("add_comment_count"))
    share = format_number(item.get("add_share_count"))
    like = f"**{format_number(item.get('add_digg_count'))}**"
    pub_time = format_time(item.get("create_time_str"))

    if is_all:
        print(f"| {idx} | {title} | {author} | {cat} | {collect} | {comment} | {share} | {like} | {pub_time} |")
    else:
        print(f"| {idx} | {title} | {author} | {collect} | {comment} | {share} | {like} | {pub_time} |")

Technical Analysis

The script treats fields returned by the remote API as trusted presentation data. In particular, share_url is inserted directly into a Markdown hyperlink without parsing the URL, enforcing HTTPS, or restricting the destination to expected Douyin domains.

The user_nickname and category fields are also inserted directly into Markdown table rows without escaping pipe characters, carriage returns, line feeds, or Markdown metacharacters. Although aweme_desc receives limited replacement, that protection is not consistently applied to all remote fields.

If the API, its upstream data source, or the network trust boundary is compromised, an attacker can return:

  • An HTTPS link to an attacker-controlled phishing d ...[truncated 1738 chars]
Remediation
View remediation

Remediation Suggestions

  1. Parse share_url with urllib.parse.urlparse before rendering it.
  2. Require the https scheme and reject URLs containing credentials, control characters, malformed hosts, or unexpected ports.
  3. Restrict links to an explicit allowlist of verified Douyin domains and carefully validate subdomain boundaries. For example, a hostname should either equal an allowed domain or end with "." + allowed_domain; a simple substring check is insufficient.
  4. If URL validation fails, render the title as plain text and omit the hyperlink.
  5. Apply one centralized Markdown-table escaping function to every remote string field, including the title, author, category, timestamp fallback, and URL-derived display values.
  6. Replace or escape pipe characters, carriage returns, line feeds, backslashes, and relevant Markdown metacharacters before interpolation.
  7. Consider returning structured data separately from presentation formatting so the consuming Agent can safely render remote values.
  8. Add tests using malicious URLs, embedded newlines, pipe characters, link syntax, and Unicode control characters.

Example hardening pattern:

python
from urllib.parse import urlparse

ALLOWED_HOSTS = {
    "douyin.com",
    "iesdouyin.com",
}

def escape_markdown_cell(value):
    text = str(value or "-")
    return (
        text.replace("\\", "\\\\")
            .replace("|", "\\|")
            .replace("\r", " ")
            .replace("\n", " ")
            .replace("[", "\\[")
            .replace("]", "\\]")
    )

def validate_work_url(value):
    try:
        parsed = urlparse(str(value))
        host = (parsed.hostname or "").lower().rstrip(".")
        allowed = any(
            host == domain or host.endswith("." + domain)
            for domain in ALLOWED_HOSTS
        )
        if parsed.scheme != "https" or not allowed:
            return None
        if parsed.username or parsed.
...[truncated 168 chars]
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README says users can 'Simply describe what you need in natural language — no commands to memorize,' which gives no clear boundary for when this skill should activate versus ordinary discussion about Douyin trends. The examples help, but the description lacks explicit trigger constraints or negative examples to prevent broad overlap with everyday requests.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill manifest says this is a tool for querying Douyin daily like-surge rankings, with category filtering and historical lookup. However, the README adds a distinct capability: users can subscribe by category/time and receive automatic daily pushes, which is broader than one-off query behavior and implies stateful scheduling/notification behavior not described in the manifest.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill instructs the agent to read an API key from the environment and make outbound network requests, but it does not declare any explicit tool scope such as allowed tools, hosts, or environment access boundaries. This weakens least-privilege controls and can allow unintended access to secrets or external endpoints if the skill is invoked in a broader runtime than expected.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are broad, generic terms like '飙升榜' and '抖音新增', which are likely to match ordinary conversation or unrelated ranking requests. Overbroad activation increases the chance the skill runs unintentionally, causing unexpected network calls, use of credentials, and disclosure of third-party content when the user did not explicitly request this skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The natural-language instructions and required outputs are entirely specified in Chinese, including mandatory user-facing prompt text, with no indication that the user may choose another language. Under the policy, forcing a specific language without opt-in is a language/locale policy violation unless the constraint is explicitly documented and justified.

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 · references/api-config.md (reported line 37)May include surrounding context.

请求示例:

bash
curl -X POST \
  -H "X-API-KEY: $REDFOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"source": "<见脚本>-ClawHub","type":"美食","startTime":"2026-05-28"}' \

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file contains all user prompts, agent responses, and operational guidance exclusively in Chinese. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The interaction guide advertises a subscription and scheduled push capability that is outside the declared scope of a ranking-query skill. This creates a scope mismatch that can mislead the orchestrator or user into collecting preferences, contact channels, or triggering actions the skill was not approved to perform, increasing the risk of unauthorized data handling or privilege creep.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Stating that users can request scheduled delivery at specified times implies background tasking or notification behavior not reflected in the skill's declared capabilities. Such undocumented behavior can enable unauthorized persistence, repeated outreach, or hidden data storage, which is especially risky in agent ecosystems that rely on manifests for security and least-privilege enforcement.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest centers on a single-day新增点赞 TOP50 ranking, but the README states the tool provides daily新增互动 including likes, favorites, comments, and shares. That expands the described output semantics beyond the manifest's narrower 'new likes surge ranking' purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file presents all operational instructions exclusively in Chinese, which can impose a language constraint on users without any explicit opt-in or justification. Under the policy rule for natural-language violations, forcing a specific language without user choice is a reportable issue.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The skill documentation presents historical date lookup as supported, while the manifest narrows that capability to at most 30 days. The code accepts any --start date string and forwards it to the API without validating or enforcing the claimed 30-day bound, creating a divergence between documented intent and actual behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The user-facing description, usage instructions, and help text in this file are entirely in Chinese, which effectively enforces a specific language for interaction. The policy calls for flagging language constraints when the skill does not offer a language choice or explicit opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code sends user-selected query parameters to an external API endpoint and includes the REDFOX_API_KEY in the request headers. Although the network call is part of the tool's purpose, there is no explicit user-facing warning that data will be sent to a third-party service.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The manifest and module documentation describe the skill as returning a TOP50 daily ranking, with TOP20 as the default and a full 50-row mode. The implementation adds an undocumented --limit option that lets callers request arbitrary counts up to 50, expanding behavior beyond the stated fixed output modes.

Content

No source excerpt is available for this finding.