Back to skill

Security audit

Markdown to HTML Converter

Security checks for vulnerabilities and agentic risk

Overview

This Markdown-to-HTML skill is narrowly scoped, but its converter can carry unsafe HTML or JavaScript from Markdown into generated web pages.

Install only if you will convert Markdown you trust or can review before publishing. Do not use this converter for user-submitted or third-party Markdown on a trusted website unless the output is sanitized or the converter is fixed to escape text, encode attributes, and restrict URL schemes.

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/convert.mjs:18
Finding

Stored HTML and JavaScript Injection in Generated Documents

Content
View full analysis
$1'); // Bold text = text.replace(/\*\*(.+?)\*\*/g, "$1"); // Italic text = text.replace(/\*(.+?)\*/g, "$1"); // Links [text](url) text = text.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '$1'); // Images ![alt](url) text = text.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, '$1'); // Strikethrough text = text.replace(/~~(.+?)~~/g, "$1"); return text; } ``` Representative output sinks include: ```js tableRows[0].forEach((cell) => { html.push(`${parseInline(cell)}`); }); ``` ```js const text = headingMatch[2]; const id = `sec-${idCounter++}`; html.push(`${parseInline(text)}`); ``` ```js html.push(`
  • ${parseInline(ulMatch[1])}
  • `); ``` The generated body is subsequently embedded directly into the standalone HTML document: ```js ${tocHtml} ${body} ``` ### Technical Analysis The converter treats Markdown input as untrusted source material but does not HTML-escape ordinary text before applying inline formatting. Captured values are inserted directly into HTML element bodies and attributes. In particular: - Link URLs are interpolated directly into `href="$2"` without attribute escaping. - Image URLs and alternative text are interpolated into attributes without escaping. - Inline-code contents and formatting captures are inserted into element bodies without HTML escaping. - Raw HTML in ordinary Markdown text is preserved and emitted into ...[truncated 2462 chars]
    Remediation
    View remediation
    ` elements. - Inline event handlers such as `onclick` and `onerror`. - Dangerous URL schemes. - Unexpected active elements and attributes. 5. Avoid constructing HTML attributes with direct string interpolation. Use a reviewed Markdown parser and sanitizer, or dedicated encoding functions for each output context. 6. Add regression tests covering at least: ```md [click](x" onclick="alert(1)) [click](javascript:alert(1)) `` ``` 7. Consider applying a restrictive Content Security Policy when generated files are hosted. This is defense in depth and must not replace correct escaping and sanitization. ]]>
    Vulnerability Patterns
    • 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
    • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
    Findings (4)

    Ae1

    High
    Category
    analysis-evasion
    Confidence
    100% confidence
    Finding

    Referenced artifact was not completely inspected

    Content

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

    md
    node scripts/convert.mjs input.md -o output.html
    

    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/convert.mjs input.md -o output.html
    

    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/convert.mjs input.md -o output.html
    

    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/convert.mjs input.md -o output.html
    

    Static analysis

    No suspicious patterns detected.