Back to skill

Security audit

Douyin Hot Trend 1

Security checks for vulnerabilities and agentic risk

Overview

This skill mainly fetches Douyin trends, but it also includes under-documented local database/report features with a real unsafe HTML-rendering risk.

Review before installing. The basic fetch command is purpose-aligned, but users should be comfortable with requests to Douyin and local storage of fetched trends under the skill's data directory. Avoid hosting or relying on the generated HTML report until titles, labels, inline JSON, and links are sanitized and URL schemes are restricted to safe Douyin HTTPS links.

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/generate_html.py:223
Finding

Stored DOM-Based Cross-Site Scripting Through Untrusted Douyin API Data

Content
View full analysis
({ rank: index + 1, title: item.word || '无标题', popularity: item.hot_value || 0, link: item.url || `https://www.douyin.com/search/${encodeURIComponent(item.word || '')}`, label: item.label || null, type: item.type || '未知' })); ``` The values are persisted without content or URL validation in `scripts/db.py:43-73`: ```python for item in items: try: title = item.get('title', '') if not title: continue item_id = generate_id(title, today) rank = item.get('rank', 0) popularity = item.get('popularity', 0) link = item.get('link', '') label = item.get('label', '') item_type = item.get('type', '未知') cursor.execute('SELECT id FROM hot_items WHERE id = ?', (item_id,)) if cursor.fetchone(): continue cursor.execute(''' INSERT INTO hot_items (id, platform, rank, title, popularity, link, label, item_type, fetched_at, fetch_date, raw_data) VALUES (?, 'douyin', ?, ?, ?, ?, ?, ?, ?, ?, ?) ''', (item_id, rank, title, popularity, link, label, item_type, now, today, json.dumps(item, ensure_ascii=False))) ``` The stored data is embedded into an executable script context in `scripts/generate_html.py:223`: ```python
Remediation
View remediation
`, `&`, U+2028, and U+2029 after JSON serialization. - Do not rely on JSON string escaping alone to prevent closing-script injection. 4. **Validate data before persistence** - Enforce expected types and reasonable length limits for titles, labels, and other fields. - Normalize popularity and rank as bounded integers. - Apply the URL allowlist before storing links. - Treat existing database contents as untrusted when generating reports. 5. **Apply browser defense in depth** - Add a restrictive Content Security Policy that disallows inline scripts after moving JavaScript to a separate file. - Use a policy similar to `default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'none'; base-uri 'none'; object-src 'none'`. - Add `rel="noopener noreferrer"` to links using `target="_blank"`. 6. **Clean existing persisted data** - Validate or delete records already stored in `data/douyin.db`. - Regenerate `data/index.html` only after the generator and stored records have been secured. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • 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 (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

If the skill claims to fetch public Douyin data but instead queries a local SQLite database, exposes fetch-log inspection, and provides undeclared statistics features, that is a meaningful trust-boundary violation. Users may invoke the skill expecting external public data retrieval, while it actually accesses local state and undisclosed functionality, which can leak internal data or enable unintended reconnaissance within the agent environment.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

If the skill claims to fetch public Douyin data but instead queries a local SQLite database, exposes fetch-log inspection, and provides undeclared statistics features, that is a meaningful trust-boundary violation. Users may invoke the skill expecting external public data retrieval, while it actually accesses local state and undisclosed functionality, which can leak internal data or enable unintended reconnaissance within the agent environment.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/douyin.js hot

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/douyin.js hot

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/douyin.js hot

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/douyin.js hot

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
81% confidence
Finding

The skill metadata does not declare any tool restrictions even though the skill references executable behavior requiring shell, network, and possibly file-write capabilities. In an agent ecosystem, missing scope declarations can cause the runtime or reviewers to underestimate what the skill may do, increasing the chance of over-privileged execution or unintended access.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This is a real client-side injection/XSS risk. Database-derived fields such as title, label, and especially link are inserted into HTML markup using template strings and then assigned via innerHTML, so attacker-controlled content can become active DOM/JavaScript; a crafted title/label can inject tags or event handlers, and a crafted link such as javascript:... can execute code when clicked. In this skill’s context, the data comes from external trending content, which is untrusted input, making the report generator more dangerous than a purely local/static viewer.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains natural-language strings and docstrings exclusively in Chinese, including the title, description, and operational status messages. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint 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
95% confidence
Finding

The manifest describes a fetcher that outputs titles, heat values, and links, which suggests retrieval/display behavior. In this file, the code goes beyond output by creating/initializing a SQLite database and saving fetched items plus fetch logs, which is a broader data-persistence behavior not stated in the manifest.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest frames the skill as a Douyin hot list fetcher that returns trending data. Spawning an external runtime via subprocess is a materially broader execution capability than simple fetching/output and is not disclosed by the stated purpose.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/save_to_db.py (reported line 25)May include surrounding context.

python
try:
        # 调用Node.js脚本获取数据
        result = subprocess.run(
            ['node', str(node_script), str(limit)],
            capture_output=True,
            text=True,

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The HTML document declares lang="zh-CN", which sets a fixed Chinese locale for the page. Under the policy criteria, forcing a specific language or locale without user opt-in or documented justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This file includes natural-language descriptions in both English and Chinese, but key function docstrings throughout the module are Chinese-only, indicating a language-specific presentation without user opt-in. Under the policy rule, forcing a specific language or locale without choice can be a natural-language policy concern unless clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The request sets Accept-Language to zh-CN,zh;q=0.9,en;q=0.8, which imposes a specific language/locale preference in behavior visible to the remote service. Under the policy, forcing a locale without user opt-in or clear region-specific justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The request hard-codes Accept-Language: zh-CN,zh;q=0.9,en;q=0.8, which imposes a locale preference rather than letting the user choose or documenting why this locale is required. Under the policy, locale constraints should be opt-in or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The generated page hard-codes a Chinese locale via lang="zh-CN" and presents the title/content in Chinese, with no indication that users can choose another language. The policy calls for flagging language or locale constraints when they are forced without opt-in or clear region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file-level description is bilingual, but all user-facing docstrings and console output throughout the script are in Chinese, indicating a fixed locale behavior. This can violate language/locale policy when the skill does not offer a user choice or explain that it is intentionally region-specific.

Content

No source excerpt is available for this finding.