Back to skill

Security audit

OpenClaw每日资讯汇总

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed Chinese-language OpenClaw news-reporting helper; its main risk is that web-sourced text is rendered into Markdown without escaping, so reports should be treated as untrusted summaries.

Install only if you are comfortable with a Chinese-language OpenClaw news-summary workflow. Treat generated reports as untrusted public-web summaries, verify important claims and links independently, and avoid feeding generated Markdown into another agent as trusted instructions without sanitization.

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
scripts/search_openclaw_news.py:305
Finding
Unsanitized search-result fields allow Markdown and HTML content injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/search_openclaw_news.py:305-310` **Vulnerability Type**: Untrusted content injection into generated Markdown **Risk Level**: Medium ### Vulnerable Code ```python report += f"{i}. **{item['title']}**\n" report += f" - **来源**:{item['source']}\n" report += f" - **风险等级**:{risk_level}\n" report += f" - **摘要**:{item['content']}\n" if item.get('url'): report += f" - **链接**:{item['url']}\n" ``` ### Technical Analysis The report generator inserts the `title`, `source`, `content`, and `url` fields directly into Markdown without escaping Markdown metacharacters, removing raw HTML, validating URL schemes, or filtering control characters. These fields originate from externally supplied search results. An attacker who controls indexed web content can place crafted Markdown or HTML in an article title, source name, summary, or URL. The injected content can terminate the intended formatting and introduce forged headings, links, images, recommendations, or raw HTML elements. Content length truncation performed earlier in the processing pipeline does not provide sanitization. It does not prevent malicious syntax from appearing within the retained portion. ### Attack Path 1. An attacker publishes content designed to appear in OpenClaw-related search results. 2. The attacker places crafted Markdown or HTML in the page title or summary, such as a deceptive security alert or phishing link. 3. The host agent retrieves the page and supplies its fields to `format_search_results()`. 4. The resulting item is passed to `generate_daily_report_content()`. 5. Lines 305-310 interpolate the attacker-controlled fields directly into the report. 6. The report is displayed in a Markdown-capable conversation interface. 7. The malicious content alters the report presentation or directs the user to an attacker-controlled destination. If the consuming renderer permits unsafe HTML or URL schemes, the effect may extend to ...[truncated 723 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Escape Markdown metacharacters in all untrusted text fields, including backslashes, brackets, parentheses, asterisks, underscores, backticks, hash characters, and angle brackets. 2. Remove or encode raw HTML before constructing the report. 3. Parse URLs with a standard URL parser and allow only explicitly approved schemes, preferably `https` and, if required, `http`. 4. Reject dangerous or ambiguous schemes such as `javascript`, `data`, `file`, and custom application schemes. 5. Build links through a dedicated safe-link function instead of inserting raw URL strings. 6. Remove control characters and normalize Unicode before rendering. 7. Apply strict length limits to titles, sources, summaries, and URLs. 8. Label retrieved material as untrusted external content and ensure that it is never interpreted as agent instructions. 9. Add tests using malicious titles, summaries, and URLs containing Markdown links, headings, raw HTML, multiline text, and dangerous URL schemes. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_report_content.py:228
Finding
Report structure accepts and renders untrusted news items without output encoding<![CDATA[ ## Vulnerability Details **File Location**: `scripts/generate_report_content.py:228-244` **Vulnerability Type**: Untrusted content injection into generated Markdown **Risk Level**: Medium ### Vulnerable Code ```python for i, item in enumerate(items, 1): markdown += f"{i}. **{item.get('title', '无标题')}**\n" if item.get('source'): markdown += f" - **来源**:{item['source']}\n" if item.get('risk_level'): risk_text = {"high": "高", "medium": "中", "low": "低"}[item['risk_level']] markdown += f" - **风险等级**:{risk_text}\n" if item.get('content'): content = item['content'] if len(content) > 150: content = content[:150] + "..." markdown += f" - **摘要**:{content}\n" if item.get('url'): markdown += f" - **链接**:{item['url']}\n" ``` ### Technical Analysis `add_item_to_structure()` accepts caller-supplied news dictionaries, and `generate_markdown_content()` subsequently inserts their text fields directly into Markdown. No trust boundary is enforced between retrieved news content and the generated conversation output. The 150-character summary limit only restricts size. It does not neutralize Markdown, raw HTML, embedded images, deceptive links, multiline formatting, or control characters. The title, source, and URL fields are not length-limited in this function. Because the function is documented as producing content for direct conversation output, injected formatting reaches the user-facing rendering layer. ### Attack Path 1. An attacker controls or influences a news item supplied to `add_item_to_structure()`. 2. The item contains crafted Markdown or HTML in `title`, `source`, `content`, or `url`. 3. The item is stored unchanged in a report risk group. 4. `generate_markdown_content()` retrieves the item. 5. Lines 228-244 concatenate the malicious fields into the Markdown report without encoding or URL validation. 6. The calling agent returns the gene ...[truncated 867 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Introduce a centralized output-encoding function and apply it to every untrusted text field before Markdown generation. 2. Strip or encode raw HTML, including tags, comments, and event-handler attributes. 3. Validate URLs using structured parsing and an allowlist of acceptable schemes. 4. Render validated URLs with safe Markdown link construction rather than emitting arbitrary raw values. 5. Normalize line endings and reject unexpected control characters or bidirectional text controls. 6. Enforce conservative maximum lengths for every news-item field. 7. Validate incoming news dictionaries against a strict schema before adding them to the report structure. 8. Keep external news content explicitly separated from generated analysis and agent instructions. 9. Configure the consuming Markdown renderer to disable raw HTML and unsafe protocols as a defense-in-depth measure. 10. Add regression tests covering headings, code fences, nested links, images, HTML, multiline injection, Unicode controls, and dangerous URL schemes. ]]>
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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
Findings (5)

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This markdown file presents the skill label, description, workflow, and usage guidance entirely in Chinese, which effectively forces a specific language/locale for users. The policy allows locale constraints only when users are given a choice or the restriction is clearly justified, neither of which appears here.

Natural-Language Policy Violations

Medium
Confidence
87% confidence
Finding
This manifest uses Chinese-only user-facing metadata such as the label and description, indicating a fixed language choice for the skill. Under the policy rule, forcing a specific language without offering user opt-in or documenting a justified locale restriction is a natural-language policy concern.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This file is a natural-language usage guide and all instructions, examples, and headings are presented only in Chinese. Under the policy, forcing a specific language without user opt-in or a documented justification is a locale/language policy violation.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The module docstring and all generated report section titles indicate the skill is designed to produce reports in Chinese by default, with no user opt-in or configurable language selection. This is a natural-language locale policy concern because the skill effectively forces a specific language across its output behavior.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The module docstring and later report-generation strings indicate the script is specifically designed to produce Chinese-language queries and reports. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless a justified locale constraint is documented, which is not present here.

Static analysis

No suspicious patterns detected.