Back to skill

Security audit

Markdown Converter

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Markdown conversion skill, but users should avoid converting untrusted Markdown to HTML without sanitization.

Install only in a normal user environment or virtual environment, prefer pinned dependency versions if you maintain this skill, and do not use the HTML converter on Markdown from untrusted sources unless you sanitize the output or disable raw HTML/script content.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/md_to_html.py:166
Finding

Stored HTML Injection in Generated Documents

Content
View full analysis
', text) # links text = re.sub(r'\[([^\]]+)\]\(([^)]+)\)', r'\1', text) # bold text = re.sub(r'\*\*(.+?)\*\*', r'\1', text) # italic text = re.sub(r'\*(.+?)\*', r'\1', text) # inline code text = re.sub(r'`([^`]+)`', r'\1', text) return text ``` The unescaped result is inserted into tables and document content: ```python for cell in table_rows[0]: html.append(f'{parse_inline(cell)}') for row in table_rows[1:]: html.append('') for cell in row: html.append(f'{parse_inline(cell)}') html.append('') ``` ```python output.append(f'

{parse_inline(line.strip())}

') ``` The Markdown title is also inserted into multiple HTML contexts without escaping: ```python title_match = re.search(r'^#\s+(.+)$', md_text, re.MULTILINE) title = title_match.group(1) if title_match else os.path.splitext(os.path.basename(input_path))[0] body = convert_md_to_html(md_text) html = HTML_TEMPLATE.format(title=title, content=body) ``` ### Technical Analysis The converter treats attacker-controlled Markdown as trusted HTML. `parse_inline()` performs regular-expression substitutions but never HTML-escapes ordinary text before returning it. As a result, raw HTML elements and event-handler attributes supplied in headings, paragraphs, list items, blockquotes, or table cells remain active in the generated document. Link destinations and image sour ...[truncated 2031 chars]
Remediation
View remediation
` and `

`. 4. Validate link and image URL schemes using a URL parser. Permit only explicitly required schemes, such as `https`, `http`, and optionally `mailto`. Reject `javascript:`, unexpected `data:` URLs, embedded control characters, and obfuscated variants. 5. If limited raw HTML support is required, sanitize the rendered output with an allowlist-based HTML sanitizer. Permit only necessary elements and attributes, and remove scripts, event handlers, dangerous URLs, embedded frames, and active content. 6. Add automated regression tests covering: - Raw `

T08 · Insecure Dependencies

Warning
Location
SKILL.md:22
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation
reportlab== ``` 2. Generate and verify cryptographic hashes for every permitted distribution. Install with hash enforcement: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 3. Use a lock file or reproducible dependency-management workflow so transitive dependencies are also pinned. 4. Document the trusted package index explicitly and warn against untrusted mirrors or unnecessary extra indexes. 5. Regularly scan pinned dependencies for known vulnerabilities and update them through a controlled review process. 6. Prefer installation in an isolated virtual environment with ordinary user privileges rather than a system-wide or privileged Python environment. ]]>
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The code’s primary behavior is Markdown-to-DOCX conversion only. It does not contain any logic for producing PDF or HTML outputs, nor any orchestration for generating multiple formats from one input. The Chinese font support portion of the description is consistent with the code, since it sets East Asian fonts (PingFang SC). There are no obvious unrelated or dangerous extra capabilities, but the declared description materially overstates the conversion formats and workflow supported.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a multi-format document conversion tool that outputs DOCX, PDF, and HTML. However, the provided script is solely an HTML converter: its usage, output path default, template, parsing logic, and final write operation all target HTML only. There is no code for DOCX creation, PDF rendering, external converters, or multi-output orchestration. While the script does include styled HTML and some CJK-friendly font settings, that is only a partial match to the description. Therefore the description materially overstates the skill's actual capabilities and primary behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The description advertises a multi-target document conversion skill producing DOCX, PDF, and styled HTML from Markdown. However, the provided code chunk is a single script explicitly named and documented as md_to_pdf.py, and its behavior is limited to generating a PDF from a Markdown input file. It parses headings, lists, tables, code blocks, and inline formatting, then builds a PDF with reportlab. The Chinese font support in the description is consistent with the code, but the core declared functionality is materially overstated: there is no code for Word export, no code for HTML export, and no orchestration for producing all formats together. Therefore the description does not accurately represent the actual behavior.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'file_read' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'file_write' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

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/convert_all.py (reported line 22)May include surrounding context.

python
script_path = os.path.join(SCRIPT_DIR, script_name)
    cmd = [sys.executable, script_path] + list(args)
    print(f'  Running: {" ".join(cmd)}')
    result = subprocess.run(cmd, capture_output=True, text=True)
    if result.returncode != 0:
        print(f'  ERROR: {result.stderr.strip()}')
        return False

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a skill that converts Markdown to Word, PDF, and styled HTML in one shot, but this script exclusively implements DOCX generation via python-docx. There is no code for PDF rendering or HTML output, so the implemented behavior is materially narrower than the advertised capability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The generated HTML hard-codes lang="zh-CN", which imposes a specific language/locale on all output regardless of the input document or user preference. This is a natural-language locale policy issue because the script does not offer any language choice or document that the tool is intentionally region-specific.

Content

No source excerpt is available for this finding.