Back to skill

Security audit

Markdown Toolkit

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Markdown utility skill, but its HTML examples should be used carefully with untrusted content and remote stylesheets.

Install/use this as a convenience toolkit for your own Markdown, but do not treat its HTML conversion or stripping snippets as sanitizers for untrusted documents. Prefer pandoc or a maintained sanitizer for hostile input, avoid the CDN stylesheet when privacy/offline behavior matters, and run in-place cleanup commands only on files you can restore.

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

Error
Location
SKILL.md:61
Finding

Markdown-to-HTML Conversion Permits Script Injection

Content
View full analysis
{m.group(2)}' return k md = re.sub(r'```(\w*)\n(.*?)```', save, md, flags=re.DOTALL) md = re.sub(r'`(.+?)`', r'\1', md) for i in range(4, 0, -1): md = re.sub(rf'^{"#"*i}\s+(.+)$', rf'\1', md, flags=re.M) md = re.sub(r'\*\*(.+?)\*\*', r'\1', md) md = re.sub(r'\*(.+?)\*', r'\1', md) md = re.sub(r'\[(.+?)\]\((.+?)\)', r'\1', md) for k, v in blocks.items(): md = md.replace(k, v) print(f'{md}') ``` ### Technical Analysis The converter builds HTML by directly interpolating attacker-controlled Markdown content. It does not HTML-escape code-block contents, headings, link labels, or other text before inserting them into the output document. Existing raw HTML in the Markdown is also left intact. Markdown link destinations are copied directly into `href` attributes without validating their URI scheme or encoding attribute delimiters. A link such as `[open](javascript:alert(document.domain))` therefore produces a dangerous `javascript:` URL. Raw HTML such as `` can remain executable in the generated page. Code-block content is similarly placed inside `
text
` without escaping HTML metacharacters. An attacker can include closing tags and active HTML to escape the intended code element.

### Attack Path

1. An attacker supplies or modifies a Markdown document processed by the documented converter.
2. The document contains an active HTML payload, a `javascript:` Markdown link, or code-block content that closes the generated `` 
...[truncated 873 chars]
Remediation
View remediation
` elements, event attributes, attribute-breaking input, dangerous URI schemes, and code-block escape payloads. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:96
Finding

Regex-Based HTML Stripping Retains Dangerous Attributes and URLs

Content
View full analysis
]+>', '', t) ``` ### Technical Analysis The routine treats selected HTML tag names as safe but performs no validation of their attributes or URL values. Consequently, allowed elements retain event-handler attributes such as `onerror`, `onload`, and `onclick`. Link and image attributes can also retain dangerous or attacker-controlled URI schemes. For example, `` is preserved because `img` is in the allowlist. Likewise, `open` remains present because `a` is allowed. Regular expressions are not a reliable mechanism for parsing and sanitizing hostile HTML. Browser HTML parsing behavior, malformed markup, attribute quoting variations, character references, and namespace handling create additional bypass opportunities. ### Attack Path 1. An attacker places malicious HTML in content presented as a Google Docs paste or another document requiring cleanup. 2. A victim runs the documented “Strip HTML” command on that content. 3. The regular expression preserves the malicious element because its tag name appears in the `safe` list. 4. The dangerous event attribute or URL remains in the output. 5. The sanitized-looking output is converted to HTML, embedded in a page, or rendered by an HTML-capable viewer. 6. The attacker's JavaScript executes automatically through an event handler or after user interaction with a dangerous link. ### Impact Assessment The routine creates a false expectation that unsafe HTML has been removed. If its output is later rendered as HTML, an attacker can execute JavaScript in the rendering document's browser context. This may enable content spoofing, phishing, unautho ...[truncated 226 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (3)

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The pandoc example adds a remote stylesheet URL, which causes generated HTML to depend on external network access and leaks viewer metadata when the HTML is opened. For a local Markdown toolkit, that behavior is not necessary to accomplish the stated task and expands the trust boundary to a third-party CDN.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The pure-Python HTML generator hardcodes a CDN stylesheet into the output HTML, so any opened document will attempt a network fetch. This introduces unnecessary external dependency, privacy leakage, and availability risk despite the tool being presented as a local conversion utility.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The skill description provides a sed -i command that modifies doc.md in place, which affects user data on disk. While the operation is visible in the command itself, the surrounding markdown does not explicitly warn users that the file will be changed directly or suggest making a backup first.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.