Back to skill

Security audit

Pandoc Convert

Security checks for vulnerabilities and agentic risk

Overview

This Pandoc conversion skill is mostly aligned with document conversion, but it includes unsafe advanced examples that can turn conversion into local command execution without adequate warnings or limits.

Install only if you want an agent to run Pandoc conversions and you can require explicit approval for advanced options. Avoid using shell escape, executable filters, Lua scripts, remote URLs, or server mode on untrusted documents unless you run them in a tightly scoped sandbox with limited files, no secrets, and controlled network access.

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
SKILL.md:183
Finding

Unsafe LaTeX Shell Escape Enables Arbitrary Command Execution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:183
Vulnerability Type: Unsafe PDF engine configuration
Risk Level: High

Vulnerable Code

bash
pandoc --pdf-engine=xelatex --pdf-engine-opt=-shell-escape input.md -o output.pdf

Technical Analysis

The documented command passes -shell-escape to XeLaTeX. This option allows TeX processing to invoke operating-system commands. Shell escape is not normally required for document conversion and substantially weakens the isolation boundary between document content and the host operating system.

If an AI agent follows this example while converting attacker-controlled Markdown, LaTeX, templates, metadata, or included resources, malicious TeX primitives or packages can execute local commands with the privileges of the Pandoc process. The example does not warn users that the option should only be used with trusted input or inside a hardened sandbox.

The project’s wrapper does not enable shell escape automatically; the vulnerability is confined to the unsafe command recommended in the Skill documentation.

Attack Path

  1. An attacker supplies a crafted document or included resource containing malicious LaTeX content.
  2. The user or agent requests PDF conversion and applies the documented -shell-escape example.
  3. Pandoc generates or processes LaTeX and invokes XeLaTeX with shell command execution enabled.
  4. The attacker-controlled TeX content invokes an operating-system command.
  5. The command executes under the account running Pandoc and can access resources available to that account.

Impact Assessment

Successful exploitation can provide arbitrary command execution with the privileges of the converting user. Depending on the execution environment, an attacker could:

  • Read accessible files, environment variables, tokens, and credentials.
  • Create, overwrite, or delete files.
  • Execute installed programs or scripts.
  • Make network requests if outbound connectivity is available.

...[truncated 198 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove the -shell-escape example and keep LaTeX shell escape disabled by default.
  • If a conversion explicitly requires shell escape, permit it only for fully trusted documents, templates, filters, and resources.
  • Require explicit user approval before enabling the option; never infer or add it automatically.
  • Perform unavoidable shell-escape conversions in an ephemeral, unprivileged container or sandbox.
  • Remove secrets from the environment, disable outbound network access, use a read-only root filesystem, and expose only narrowly scoped input and output directories.
  • Apply CPU, memory, process, and execution-time limits.
  • Validate and constrain included files, LaTeX packages, templates, and resource paths.
  • Add a prominent warning explaining that -shell-escape can turn crafted document input into local command execution.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill advertises --filter and --lua-filter, which execute external programs or scripts during conversion. In an agent context, this creates a direct path from document-processing requests to arbitrary code execution if untrusted filters or scripts are referenced.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The PDF guidance includes --pdf-engine-opt=-shell-escape, which can enable LaTeX to invoke external commands during document compilation. This significantly expands the attack surface from document rendering to command execution, making malicious document content or templates far more dangerous.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Recommending LaTeX shell escape without a safety warning is dangerous because it can permit external command execution during PDF generation. Users or agents may treat it as a normal troubleshooting step and unknowingly turn document conversion into code execution.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The examples explicitly instruct users to run local filter programs and Lua scripts, normalizing executable extension points in what should be a conversion-focused skill. This materially raises the risk that an agent or operator will run attacker-supplied code under the guise of document transformation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file's manifest description includes the catch-all phrase 'any Pandoc conversion task,' which is broad and lacks clear boundaries on when the skill should or should not activate. Such wording can overlap with many generic document-processing requests and may cause unintended invocation because no exclusion conditions or negative examples are provided.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill documents Pandoc commands that fetch content from remote URLs, introducing network access into a skill presented primarily as a document conversion tool. In an agent setting, this can enable unreviewed outbound requests, retrieval of attacker-controlled content, and misuse for SSRF-like access to internal or sensitive endpoints if user-supplied URLs are accepted.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation shows URL-fetching commands without clearly warning that they perform network access. In an autonomous or semi-autonomous agent workflow, this can lead to silent outbound requests to attacker-controlled or internal targets, violating least privilege and user expectations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Documenting support for remote templates, stylesheets, or reference documents broadens the skill from local conversion into retrieving and applying remote content that may be attacker-controlled. This increases exposure to malicious payloads, privacy leaks, and unexpected network access, especially when agents may compose commands from untrusted inputs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This section presents operational guidance entirely in Chinese, while the rest of the file is in English, and it does not indicate that the user opted into Chinese or that the skill is region-specific. That creates a language-policy issue because the skill effectively forces a different language for part of its instructions without user choice.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/advanced.md (reported line 291)May include surrounding context.

md
pandoc --server localhost:3000

# Convert via HTTP
curl -X POST http://localhost:3000 \
  --data-binary @input.md \
  -H "Content-Type: text/markdown" \
  -H "Accept: application/vnd.openxmlformats-officedocument.wordprocessingml.document" \

Static analysis

No suspicious patterns detected.