Back to skill

Security audit

Paint Skill

Security checks for vulnerabilities and agentic risk

Overview

This is a simple drawing script, but users should be aware it saves to a hard-coded local PNG path and may overwrite that file.

Install only if you are comfortable running a local Python script that writes a PNG to a fixed path. Review or edit the output filename before running if that path exists on your machine or if you want the file saved elsewhere.

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

Note
Location
paint_skill.py:111
Finding

Unconditional File Overwrite at a Hard-Coded Absolute Path

Content
View full analysis

Vulnerability Details

File Location: paint_skill.py, lines 111–112
Vulnerability Type: Unsafe fixed-path file write and potential symlink-assisted overwrite
Risk Level: Low

python
filename = "/Users/m1/.openclaw/workspace/openclaw_drawing.png"
image.save(filename)

Technical Analysis

The generated image is saved to a developer-specific absolute path without checking whether the destination already exists, whether it is a symbolic link, or whether the user has approved replacing it. Pillow's Image.save() uses ordinary filesystem path resolution and can truncate or replace an existing destination.

If the final path is a symbolic link, normal operating-system resolution may cause the image to be written to the link's target. Exploitation is constrained by the filesystem permissions of the account running the script; this issue does not independently bypass access controls.

The absolute path also makes the program non-portable. On systems where /Users/m1/.openclaw/workspace does not exist or is inaccessible, execution will fail rather than saving to a user-selected location.

Attack Path

  1. An attacker with permission to modify the destination directory pre-creates /Users/m1/.openclaw/workspace/openclaw_drawing.png as either a valuable existing file or a symbolic link to another file writable by the victim.
  2. The victim runs paint_skill.py.
  3. image.save(filename) follows ordinary filesystem resolution and opens the resolved destination for writing.
  4. The existing file or symlink target is replaced or corrupted with PNG image data.

This path requires the attacker to have sufficient prior filesystem access to create or replace the destination entry.

Impact Assessment

The issue can cause loss or corruption of an existing file. Through a planted symbolic link, the affected scope may include other files writable by the account executing the script. No privilege escalation is es ...[truncated 228 chars]

Remediation
View remediation

Remediation Suggestions

  • Accept the output location through a command-line argument rather than embedding a developer-specific absolute path.
  • Use a safe, user-controlled default such as a filename in the current working directory.
  • Refuse to overwrite an existing destination unless the user explicitly supplies an option such as --force.
  • Detect and reject symbolic-link destinations where overwriting is not intended.
  • For strict non-overwrite behavior, create the destination atomically with exclusive-create semantics and save through the resulting file handle.
  • Validate that the parent directory exists and provide a clear error instead of silently selecting another sensitive location.
  • If replacement is required, write to a securely created temporary file in the same directory and atomically rename it after successful image generation.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 49)May include surrounding context.

md
- `SKILL.md` - This documentation

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation states that the skill saves generated drawings as PNG images, but it does not clearly warn users at the point of use that running the interactive drawing flow will write files to local disk. This is a genuine transparency and consent issue: unexpected file creation can surprise users, clutter systems, or expose sensitive content if users assume the tool is ephemeral.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring describes the skill entirely in Chinese, indicating a fixed language/locale presentation. The file provides no indication that users can choose another language or that the skill is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.