Back to skill

Security audit

Markdown2pdf

Security checks for vulnerabilities and agentic risk

Overview

The skill converts Markdown as advertised, but it needs Review because it renders unsanitized HTML through wkhtmltopdf and accepts output paths that can escape the intended folder when used with untrusted input.

Install only if you are comfortable reviewing the converter and its dependencies. Use it for Markdown you trust, keep outputs in a dedicated folder, avoid exposing filename or Markdown content to untrusted users, and prefer a sandboxed environment for wkhtmltopdf until HTML sanitization and output-path validation are added.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
src/converter.py:387
Finding

Unsanitized HTML and Title Injection into the wkhtmltopdf Rendering Context

Content
View full analysis
str: """ Convert markdown to HTML. Args: markdown_text: Markdown text to convert. title: Document title. Returns: HTML string. """ # Replace emoji with PDF-compatible colored text labels markdown_text = replace_emoji_for_pdf(markdown_text, use_color=True) # Convert markdown to HTML with extensions html = markdown.markdown( markdown_text, extensions=[ 'extra', 'codehilite', 'toc', 'tables', 'fenced_code', 'nl2br' ] ) css = self.generate_css() # Add HTML structure with theme html_template = f""" {title} {css} {html} """ return html_template ``` The resulting HTML is then passed directly to the rendering engine: ```python pdfkit.from_string( html, str(output_path), options={ 'page-size': page_size, 'margin-top': margin, 'margin-right': margin, 'margin-bottom': margin, 'margin-left': margin, 'encoding': 'UTF-8', 'no-outline': None, 'print-media-type': None } ) ``` ```python imgkit.from_string( html, str(output_path), options={ 'width': width, 'format': 'png', 'quality': quality } ) ``` ### Technical Analysis The Markdown input is converted to HTML without an HTML sanitization stage. Python Markdown can preserve raw HTML ...[truncated 3033 chars]
Remediation
View remediation
`, ``, remote images, loopback URLs, internal addresses, `file:` URLs, event-handler attributes, and title-element breakout attempts. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
src/converter.py:445
Finding

Unrestricted Output Filename Allows Path Traversal and Arbitrary File Overwrite

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
install.sh:28
Finding

Unpinned and Inconsistently Installed Third-Party Dependencies

Content
View full analysis
=3.5.0 pdfkit>=1.0.0 imgkit>=1.2.3 wkhtmltopdf>=0.2.0 ``` Equivalent unconstrained installation commands also appear in `README.md`, `INSTALL.md`, `SKILL.md`, and `output/install_guide.md`. ### Technical Analysis The installer does not use `requirements.txt`; instead, it asks `pip` to install the latest versions satisfying no explicit version constraints. The requirements file itself uses open-ended lower bounds, allowing future versions to be selected without any change to the audited project. No package hashes are supplied to authenticate the exact artifacts expected by the project. As a result, installations are not reproducible. The code reviewed during this audit may execute with dependency versions materially different from those used during development or testing. This increases exposure to compromised upstream releases, unexpected behavioral changes, and newly introduced vulnerabilities. No evidence of an intentional dependency-confusion package, typosquatted package, or malicious package source was found. The risk arises from unsafe dependency-management practices rather than a confirmed malicious dependency. ### Attack Path 1. A user runs `install.sh` or follows the documented `pip3 install markdown pdfkit imgkit` command. 2. `pip` resolves package versions from its configured index at installation time. 3. A later release, compromised upstream artifact, or dependency-chain change is selected because exact ver ...[truncated 797 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (31)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · INSTALL.md (reported line 24)May include surrounding context.

md
brew install wkhtmltopdf

# Ubuntu/Debian
sudo apt-get install wkhtmltopdf

# CentOS/RHEL
sudo yum install wkhtmltopdf

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · INSTALL.md (reported line 205)May include surrounding context.

md
brew install wkhtmltopdf

# Ubuntu/Debian
sudo apt-get install wkhtmltopdf

# CentOS/RHEL
sudo yum install wkhtmltopdf

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 40)May include surrounding context.

md
brew install wkhtmltopdf

# Ubuntu/Debian
sudo apt-get install wkhtmltopdf

# CentOS/RHEL
sudo yum install wkhtmltopdf

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · install.sh (reported line 42)May include surrounding context.

sh
brew install wkhtmltopdf

# Ubuntu/Debian
sudo apt-get install wkhtmltopdf

# CentOS/RHEL
sudo yum install wkhtmltopdf

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · install.sh (reported line 43)May include surrounding context.

sh
brew install wkhtmltopdf

# Ubuntu/Debian
sudo apt-get install wkhtmltopdf

# CentOS/RHEL
sudo yum install wkhtmltopdf

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · output/install_guide.md (reported line 51)May include surrounding context.

md
brew install wkhtmltopdf

# Ubuntu/Debian
sudo apt-get install wkhtmltopdf

# CentOS/RHEL
sudo yum install wkhtmltopdf

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · INSTALL.md (reported line 27)May include surrounding context.

sudo apt-get install wkhtmltopdf

CentOS/RHEL

sudo yum install wkhtmltopdf

text

---

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 43)May include surrounding context.

sudo apt-get install wkhtmltopdf

CentOS/RHEL

sudo yum install wkhtmltopdf

text

---

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 350)May include surrounding context.

sudo apt-get install wkhtmltopdf

CentOS/RHEL

sudo yum install wkhtmltopdf

text

---

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

sudo apt-get install wkhtmltopdf

CentOS/RHEL

sudo yum install wkhtmltopdf

text

---

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 274)May include surrounding context.

md
## 🤝 Contributing

1. Fork the project
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The report content, headings, analysis, and disclaimer are all presented in Chinese, and there is no indication that the user opted into this language or that the skill is restricted to a Chinese-language or region-specific audience. Under the policy rule, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document states that it is 'for reference only' and not investment advice, yet elsewhere provides concrete portfolio allocations, buy/sell triggers, stop-loss levels, and timing guidance. This mismatch can mislead users into treating the content as de facto financial advice while reducing perceived accountability, creating legal, compliance, and user-harm risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file instructs users to install Python packages, install wkhtmltopdf via system package managers, and execute ./install.sh, all of which can change the user's environment or system state. The guide does not include any disclosure or warning about these effects, prerequisites, or the need to review the script before running it.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The markdown gives explicit trading instructions such as entry ranges, add-on triggers, stop-loss levels, and profit-taking points before a later disclaimer says the report is not investment advice. In this context, the skill is more dangerous because it is framed as a professional-looking investment analysis report, which increases the likelihood that users will rely on the recommendations and suffer financial loss.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document presents concrete trading actions elsewhere in the report, including suggested position sizing, buy ranges, add-on conditions, stop-losses, and price targets, while the disclaimer claims it is not investment advice. This contradiction can mislead readers into treating the content as actionable guidance without appropriately salient risk framing, creating compliance and consumer-harm risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. This markdown file presents all user-facing content only in Chinese and does not indicate that the user opted into Chinese or that the skill is restricted to a Chinese-language/regional context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code replaces many emoji with Chinese text labels such as "[数据]", "[文档]", and "[全球]" in both colored and plain-text modes. Because the conversion behavior is built into the skill and no option is provided for language choice, it enforces a specific locale on all generated output, which violates the language/locale policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code file contains natural-language descriptions and user-facing strings exclusively in Chinese, including the module docstring and function docstring. Under the stated policy, forcing a specific language without user opt-in is a language/locale policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file documents behavior that affects user data and the filesystem by automatically converting content and saving outputs to an output directory. Under the markdown-specific SQP-2 criteria, the description should warn users that files will be created or overwritten so the behavior is clear before use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This file explicitly offers both English and Chinese sections, which provides user language choice rather than imposing a single required language or locale. Under the stated policy, this is not a violation and should not be flagged.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The markdown describes document conversion features and usage examples, but it does not explicitly warn users that running the tool will write generated PDF/PNG files to the filesystem. Because this is a markdown skill description and file creation can affect user data or workspace contents, a brief disclosure would improve user awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This shell script presents all user-facing messages in Chinese, including installation status, errors, and usage instructions. The file does not offer a language option or explain that it is intentionally limited to a Chinese-speaking audience, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

All user-facing instructional text in the file is Chinese, and there is no indication that the user can choose another language or that the locale restriction is justified. This can violate a language/locale policy when a skill implicitly forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency is specified with a lower-bound version only, which allows newer unreviewed releases to be installed. This weakens build reproducibility and can unintentionally introduce vulnerable or breaking versions through normal dependency resolution.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
markdown>=3.5.0
pdfkit>=1.0.0
imgkit>=1.2.3
wkhtmltopdf>=0.2.0