T09 · Insecure Skill Coding Practices
- Location
drawing_tool.py:142- Finding
Caller-Controlled Output Path Allows Arbitrary File Overwrite in drawing_tool.py
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a real scientific drawing skill, but its Python helpers can write generated images to fixed or caller-controlled filesystem paths without enough containment.
Install only if you are comfortable with a drawing helper that writes local files. Prefer running it in a workspace or sandbox, and avoid passing paths or filenames from untrusted text until output paths are validated and made configurable.
drawing_tool.py:142Caller-Controlled Output Path Allows Arbitrary File Overwrite in drawing_tool.py
drawing_tool_v2.py:128Caller-Controlled Output Path Allows Arbitrary File Overwrite in drawing_tool_v2.py
This is a true security-relevant mismatch because the skill claims benign drawing behavior while implicitly directing writes to a fixed absolute path on the host. Even if the rest of the discrepancy is primarily quality-related, undocumented local file writes expand the skill's effective privileges and can cause unauthorized persistence, overwrite risk, or execution failures in different environments.
This is a true security-relevant mismatch because the skill claims benign drawing behavior while implicitly directing writes to a fixed absolute path on the host. Even if the rest of the discrepancy is primarily quality-related, undocumented local file writes expand the skill's effective privileges and can cause unauthorized persistence, overwrite risk, or execution failures in different environments.
The manifest description is entirely in Chinese and presents the skill as a Chinese-language tool, without indicating that other languages are supported or that the user can choose a locale. This matches the policy concern for language or locale constraints imposed without user opt-in.
The usage instructions tell users to interact with the skill using Chinese prompts and do not offer any alternative language or opt-in mechanism. Because the file repeatedly frames operation in a single language without documenting choice or necessity, it creates a natural-language locale policy issue.
The code hard-codes OUTPUT_DIR to a specific personal Windows path and creates it automatically at import time. This causes unprompted writes to a fixed filesystem location outside the current working directory, which is unsafe for a reusable skill because it can overwrite files, leak artifacts into unintended locations, and break isolation assumptions in shared or sandboxed environments.
The code writes outputs to a hard-coded personal filesystem path (D:/Personal/OpenClaw/figures) instead of using a caller-supplied or sandboxed location. In an agent/skill context, this can cause unintended file writes, overwrite data, leak environment details, and break containment assumptions when the skill is executed on a host with broader filesystem access.
The module description is written in Chinese and the code explicitly configures Chinese fonts, which signals a language-specific experience. There is no indication that users may opt into another language or that the locale restriction is documented as intentional and justified.
The script silently creates a directory and writes image files to a fixed path without user confirmation or any visibility into where data is being stored. In an agent or automation context, this can produce unexpected persistence on the host filesystem and may expose generated content to other local users or processes.
The module docstring and comments present the tool as Chinese-language only, but the file does not indicate that language choice is optional or that the skill is intentionally limited to a Chinese-speaking context. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.
The embedded demo runner automatically creates multiple files when the script is executed directly, which introduces side effects beyond the core drawing API. In a skill environment, unexpected file generation increases the risk of unrequested writes, resource consumption, and misuse if the file is invoked as an executable rather than imported as a library.