T09 · Insecure Skill Coding Practices
- Location
scripts/make_harvard_paper.sh:92- Finding
Untrusted Markdown May Cause Pandoc to Access Local or Remote Resources
- Content
View full analysis
> "$TMP_MD" pandoc "$TMP_MD" \ -o "$OUT_DOCX" \ --toc \ --number-sections \ -V papersize:a4 \ -V fontsize=12pt \ -V geometry:margin=2.54cm ``` ### Technical Analysis The script appends the supplied source file directly to a temporary Markdown document and processes it with Pandoc without validating embedded resource references or restricting Pandoc's filesystem and network access. Markdown can contain image and other resource references. Depending on the installed Pandoc version, document content, and supported URI schemes, Pandoc may resolve these references by reading local resources or requesting remote URLs during DOCX generation. No sandbox, network isolation, resource allowlist, or input filtering is applied. This creates a potential local-file disclosure or server-side request forgery condition when an attacker can control the source document and subsequently obtain the generated DOCX. The behavior occurs with the privileges and network access of the process running the script. ### Attack Path 1. An attacker supplies a Markdown source file containing a crafted resource reference, such as an image pointing to a sensitive local path or an internal HTTP endpoint. 2. The script appends the attacker's Markdown unchanged to the temporary document. 3. Pandoc parses the document and attempts to resolve the referenced resource. 4. A remote reference may cause a request from the host running the skill, including requests to services not directly reachable by the attacker. 5. A readable local or remote resource may be embedded in the generated DOCX. 6. If the generated document is returned to the attacker, the attacker can inspect it for disclosed content or use request side effects to probe internal ser ...[truncated 783 chars]- Remediation
View remediation
