T09 · Insecure Skill Coding Practices
- Location
advanced.md:115- Finding
Unvalidated Output Path Permits Arbitrary File Writes
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a documentation-only PDF generation skill with expected local file-output examples, but users should treat the sample paths and HTML templating as unsafe for untrusted input without hardening.
Safe to install as reference material. Before using the snippets in real applications, write outputs only to chosen directories, avoid overwriting important files, sanitize filenames, escape or template untrusted HTML data, and restrict WeasyPrint resource fetching if inputs can come from other users.
advanced.md:115Unvalidated Output Path Permits Arbitrary File Writes
templates.md:9Invoice Identifier Is Embedded in the Output Filename Without Sanitization
Invoice #: {data['invoice']['number']}
Date: {data['invoice']['date']}
Due: {data['invoice']['due_date']}
{data['client']['name']}
{data['client']['address']}
| Description | Qty | Rate | Amount |
|---|---|---|---|
| {item['desc']} | {item['qty']} | ${item['rate']} | ${item['qty'] * item['rate']} |
Total: ${sum(item['qty'] * item['rate'] for item in data['items'])}
""" HTML(string=html).write_pdf(f"invoice-{data['invoice']['number']}.pdf") ``` ### Technical Analysis The invoice number is incorporated directly into the destination filename. No character allowlist, ...[truncated 1411 chars]templates.md:9Unescaped Template Data Enables HTML Injection and External Resource Resolution
Invoice #: {data['invoice']['number']}
Date: {data['invoice']['date']}
Due: {data['invoice']['due_date']}
{data['client']['name']}
{data['client']['address']}
| Description | Qty | Rate | Amount |
|---|---|---|---|
| {item['desc']} | {item['qty']} | ${item['rate']} | ${item['qty'] * item['rate']} |
Total: ${sum(item['qty'] * item['rate'] ...[truncated 2329 chars]
This markdown skill describes multiple operations that create or modify PDF files on disk, including merge, split, fill, watermark, bookmark, rotate, and batch generation. The document provides code examples but does not include any warning that these actions write files, may overwrite paths, or alter document contents.
This markdown file embeds code that writes an invoice PDF to the local filesystem, which is a file-creation operation affecting user data and system state. The snippet provides no warning, confirmation, or explanatory note to the user about creating the file.
The embedded code saves a report PDF to report.pdf, but the surrounding markdown does not warn that running the example creates or overwrites a local file. For markdown and code examples, safety-relevant file write behavior should be disclosed to users.
This example performs a filesystem write by creating contract.pdf, yet there is no visible warning or note in the markdown describing that side effect. Users should be informed when examples create files on disk.
The snippet writes certificate.pdf to disk, which is a safety-relevant side effect for a documentation example. The markdown does not currently warn users that executing the code will create a local file.
The example saves resume.pdf to the filesystem, but the markdown provides no disclosure that running it creates a file. Missing side-effect warnings in example documentation can surprise users and affect local data.
This markdown file includes multiple examples that create output files such as output.pdf, merged.pdf, and page_*.pdf, but it does not include any warning that these commands will write files to disk or may overwrite existing files. For markdown files, missing disclosure about actions affecting user data or filesystem state should be flagged when the description omits such warnings.
No suspicious patterns detected.