Back to skill

Security audit

markdown-bundle-browser

Security checks for vulnerabilities and agentic risk

Overview

The skill largely does what it says, but the HTML it generates can preserve unsafe Markdown links that may run script when opened or clicked, and it packages all selected Markdown into one shareable file.

Review before installing. Use this only on Markdown directories you trust, avoid bundling secrets or private notes, and treat the generated HTML as containing the full source document set. Do not share or open generated HTML from untrusted Markdown until link and image URL sanitization is fixed.

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/bundle.py:267
Finding

Unsafe Markdown Link Schemes Allow JavaScript Execution

Content
View full analysis
$1"); t=t.replace(/\*\*([^*]+)\*\*/g,"$1"); t=t.replace(/\*([^*\n]+)\*/g,"$1"); t=t.replace(/!\[([^\]]*)\]\(([^)\s]+)(?:\s+["']([^"']*)["'])?\)/g,"\"$1\""); t=t.replace(/\[([^\]]+)\]\(([^)\s]+)(?:\s+["']([^"']*)["'])?\)/g,"$1"); return t; } function renderLinks(el){ el.querySelectorAll("a[data-href]").forEach(a=>{ let h=a.getAttribute("data-href"); if(/^\.md$|^[\w\-/.]+(?:\.md)(?:#.*)?$/.test(h)||h.endsWith(".md")){ a.addEventListener("click",()=>openMd(h)); a.title="内部文档链接"; }else if(/^https?:\/\//.test(h)){ a.href=h;a.target="_blank"; }else{a.href=h;} }); } ``` ### Technical Analysis Markdown content is treated as untrusted input and embedded in the generated HTML. The custom Markdown renderer converts every Markdown link destination into a `data-href` attribute. The `renderLinks` function subsequently assigns that value to the link element's `href` property. Only HTTP and HTTPS URLs receive special handling. All other non-Markdown destinations are assigned directly through the following branch: ```javascript else{a.href=h;} ``` There is no allowlist that rejects active or dangerous schemes such as `javascript:`, `data:`, or `vbscript:`. Consequently, Markdown such as: ```markdown [Open document](javascript:alert(document.domain)) ``` is converted into a clickable link with a `javascript:` URL. Clicking it executes attacker-controlled JavaScript in the context of the generated document. The escaping function used before link conversion only escapes ampersands and angle brackets. It does not escape quotation marks, making string-based HTML a ...[truncated 1719 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (9)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/bundle.py <directory> [--output index.html] [--title "My Title"]

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/bundle.py (reported line 92)May include surrounding context.

python
for rule in config.get("group_rules", []):
        match = rule.get("match", "")
        if match and match in rel_path:
            return rule.get("group", "其他"), rule.get("icon", "📄")
    return None

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This is a markdown file, so missing user-facing warnings about behaviors affecting data privacy should be flagged. The workflow explicitly tells users to share the generated single HTML, but the README does not caution that bundling consolidates potentially sensitive Markdown content into one portable file that may be easy to distribute unintentionally.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill instructs the agent to read files from a user-specified directory and generate a new HTML artifact, but it declares no explicit tool scope or permission boundaries. That mismatch can cause the agent to access or write files more broadly than users expect, increasing the risk of over-collection of local markdown content or unintended file creation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill description emphasizes offline browsing benefits but does not clearly warn that it will recursively read markdown files from a directory and embed their full contents into a single self-contained HTML file. This is dangerous because the output becomes a convenient exfiltration and aggregation artifact, making accidental disclosure of internal notes, credentials in docs, or sensitive project materials more likely.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger conditions are broad enough that the skill may activate in many generic documentation or browsing situations, including cases where the user did not intend bulk collection and repackaging of files. In context, automatic invocation is risky because the skill recursively reads and embeds multiple documents into a portable HTML file, which can aggregate sensitive content unexpectedly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script hard-codes Chinese-language group names, and the generated HTML also declares a Chinese locale and Chinese UI text elsewhere in the file. This imposes a specific language/locale by default rather than offering user opt-in or a documented regional justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The HTML output is hard-coded with lang="zh-CN", which enforces a specific locale on all generated documents. Under the policy, locale constraints should be optional, user-selectable, or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
73% confidence
Finding

The manifest description and defaults include Chinese-language text and a Chinese default title ("文档浏览") without indicating that the language can be selected based on user preference. This may violate locale-choice policy when used in broader contexts where the user has not opted into Chinese.

Content

No source excerpt is available for this finding.