Back to skill

Security audit

draw-paper

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate diagram-generation purpose, but it should be reviewed because it can send local file content to Gemini and write fixed-path files without enough filename validation or user confirmation.

Install only if you are comfortable with prompts from local paper-analysis files being sent to Gemini and images being written under the hard-coded desktop images path. Use simple trusted .txt basenames only, avoid sensitive or unpublished content unless approved for third-party processing, and check for existing output files before running.

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:10
Finding
Path Traversal Through Unvalidated Filename Parameter## Vulnerability Details **File Location**: `SKILL.md`, lines 10, 29, 45, and 108 **Vulnerability Type**: Path traversal and unintended local file disclosure **Risk Level**: High The skill accepts a caller-controlled `filename` and directly interpolates it into input and output paths: ```text - filename: 文件名(例如:xxx.txt) {input_dir}/{filename} {output_dir}/{filename_去掉扩展名} {output_dir}/{filename_去掉扩展名}/figure_{index}.png ``` ### Technical Analysis The instructions do not require the agent to validate that `filename` is a simple file name. There is no rejection of absolute paths, path separators, `..` traversal segments, symbolic links, unexpected extensions, or resolved paths outside the configured directories. Although the skill describes the input and output directories as fixed, direct path interpolation does not enforce that boundary. A value containing traversal components could resolve outside `/home/xie/桌面/analysis`. The resulting content would be parsed as image prompts and sent to Gemini, creating a potential external disclosure channel for unintended local files. The same unvalidated value is used to derive an output directory beneath `/home/xie/桌面/images`. Traversal components could therefore redirect directory creation and predictable `figure_{index}.png` writes outside the intended output tree, subject to the agent's filesystem permissions. ### Attack Path 1. An attacker or untrusted caller supplies a `filename` containing traversal components instead of a simple `.txt` basename. 2. The agent concatenates that value with the configured input directory without canonicalization or containment validation. 3. The resulting path resolves to a readable file outside the intended analysis directory. 4. The agent reads and parses the unintended file. 5. Parsed content is submitted to Gemini as image-generation prompts, potentially disclosing local information to an external service. 6. The agent derives the ...[truncated 850 chars]
Remediation
## Remediation Suggestions 1. Require `filename` to be a basename rather than a path. 2. Apply a strict allowlist, such as `^[A-Za-z0-9._-]+\.txt$`. 3. Reject absolute paths, path separators, null bytes, and `..` components. 4. Resolve the candidate input path to its canonical form and verify that it remains beneath `/home/xie/桌面/analysis`. 5. Derive the output directory only from a sanitized basename with the extension removed. 6. Canonicalize the output parent and verify containment beneath `/home/xie/桌面/images` before creating directories or writing files. 7. Refuse symbolic-link input files and symbolic-link output directories unless they have been explicitly approved. 8. Use non-overwriting file creation or require confirmation before replacing existing output files. 9. Confirm the selected input file and external disclosure scope with the user before submitting its content to Gemini. 10. Stop with an explicit error state whenever validation or containment checks fail.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Vague Triggers

Medium
Confidence
92% confidence
Finding
The skill manifest describes a broadly scoped capability to parse paper-derived files, generate images, and save them locally, but it does not define clear trigger constraints, input validation expectations, or safety boundaries. In practice, this increases the chance of unintended invocation on sensitive files or use in contexts where users do not understand that local file access and external service interaction will occur.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs the agent to create directories and save files to a fixed local path without warning the user or requiring confirmation. This can cause unexpected filesystem side effects, overwrite concerns, and privacy issues, especially because the destination is predetermined rather than user-approved at runtime.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill directs transmission of extracted prompts to Gemini, an external service, without any notice that local file content will leave the system. If the parsed paper file contains unpublished research, proprietary diagrams, or sensitive text, this creates an avoidable data exposure risk through third-party processing.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The skill content is written as a Chinese-only operational specification, while only the initialization prompt to Gemini is in English, and there is no indication that the user can choose language or locale. This may violate language/locale policy where user opt-in or explicit choice is required.

Static analysis

No suspicious patterns detected.