Back to skill

Security audit

Markdown 排版工具箱

Security checks for vulnerabilities and agentic risk

Overview

This Markdown toolkit is mostly purpose-aligned, but its HTML conversion can preserve unsafe markup from untrusted Markdown without warning.

Install only if you want a Chinese-focused Markdown formatter. Use the HTML/WeChat conversion only on Markdown you trust, and review or sanitize generated HTML before opening it in a browser or publishing environment. Be aware that generated output files may overwrite prior generated files with the same derived name.

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

Error
Location
scripts/format_md.py:123
Finding

Unescaped Markdown Content Enables HTML and Script Injection

Content
View full analysis
{_inline_format(line)}') ``` ```python def _inline_format(text: str) -> str: """行内格式化: 加粗、斜体、链接、行内代码""" # 加粗 **text** text = re.sub(r'\*\*(.+?)\*\*', r'\1', text) # 斜体 *text* text = re.sub(r'(?\1', text) # 行内代码 `code` text = re.sub(r'`([^`]+)`', r'\1', text) # 链接 [text](url) text = re.sub( r'\[([^\]]+)\]\(([^)]+)\)', r'\1', text ) return text ``` ### Technical Analysis The Markdown-to-HTML conversion passes ordinary Markdown content directly into generated HTML without first applying HTML escaping. The `_inline_format` function performs regular-expression substitutions but does not encode security-sensitive characters such as `<`, `>`, `"`, `'`, and `&`. Consequently, raw HTML supplied through a Markdown paragraph can survive conversion. For example: ```markdown ``` The generated output includes this element inside a paragraph, preserving its event handler. Markdown link destinations are also interpolated directly into a double-quoted `href` attribute. An attacker can therefore: 1. Supply a dangerous URL scheme such as `javascript:`. 2. Inject quotation marks into the destination to terminate the `href` value and add another HTML attribute. 3. Place malicious HTML in link labels or other inline-formatted content. The code properly escapes fenced code-block content in `_format_code_block`, but equivalent protection is not applied to ...[truncated 1629 chars]
Remediation
View remediation
` and `` input. - Quotes embedded in link destinations. - `javascript:` and `data:` links. - HTML embedded in headings, quotations, link labels, and inline code. 8. Document that generated files must not be treated as trusted HTML unless sanitization is enforced. ]]>
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented purpose does not accurately match the described behaviors: some capabilities are undeclared, while some advertised features appear unimplemented. This mismatch can mislead the invoking agent or user about what the skill will actually do, which undermines trust and can lead to inappropriate activation, unexpected file transformations, or missed safety review for unlisted functionality.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises file-processing behavior and references scripts that read and write files, but it does not declare an explicit tool scope or permissions boundary. This can cause the agent to invoke the skill in a broader context than intended, increasing the risk of unintended file access or modification if the runtime grants ambient filesystem capabilities.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The activation description is broad enough to match many ordinary formatting or editing requests, which increases the chance the skill is invoked outside a narrowly intended use case. Over-broad triggering is dangerous because this skill performs file read/write transformations, so accidental activation could modify documents when the user did not explicitly request this specific tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The description centers the skill on Chinese typography and Chinese-platform conversions without indicating that language-specific behavior is optional or user-selectable. This can violate language/locale policy when applied automatically to Markdown content from users who did not opt into Chinese-specific formatting.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The invocation guidance uses open-ended natural-language examples without guardrails, making it easy for a planner to activate the skill on loosely related user requests. In context, this matters because the skill can alter files and convert content formats, so permissive trigger language raises the likelihood of unintended side effects from ambiguous prompts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file is a natural-language formatting policy titled and written as a Chinese-only markdown style guide, prescribing Chinese punctuation and mixed Chinese-English formatting throughout. Because it imposes a specific language/locale convention without any opt-in or indication that the skill is region-specific, it matches the language/locale policy violation category.

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 entirely in Chinese in the module docstring and later user-facing CLI messages. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly 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
96% confidence
Finding

The manifest describes the skill as being able to '检查链接和标题层级', which implies validation or analysis of links and heading structure. In this file, check-links merely extracts Markdown links and prints them, and there is no implementation that checks heading hierarchy at all.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.