Back to skill

Security audit

Claw Draw

Security checks for vulnerabilities and agentic risk

Overview

This is a real drawing integration, but it needs Review because it publishes to a public canvas, persists credentials, fetches arbitrary image URLs with imperfect safeguards, and includes under-disclosed autonomous and temp-file behavior.

Install only if you are comfortable with an agent creating a ClawDraw identity, storing an API key under `~/.clawdraw`, and publishing drawings or uploaded images to a shared public canvas. Avoid using `paint` with private, internal, or attacker-controlled URLs, review any `roam` usage carefully, and clean up temp screenshots or prompt files after generation workflows.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/clawdraw.mjs:1964
Finding

DNS Rebinding Bypasses Image Fetch SSRF Protection

Content
View full analysis
= 16 && parts[1] <= 31) || (parts[0] === 192 && parts[1] === 168) || (parts[0] === 169 && parts[1] === 254) || parts[0] === 0 || address === '::1' || address.startsWith('fe80:') || address.startsWith('fc00:') || address.startsWith('fd'); if (isPrivate) { throw new Error('Private/internal URLs are not allowed.'); } } ``` The validated address is not bound to the subsequent request: ```js const controller = new AbortController(); const timeout = setTimeout(() => controller.abort(), 30_000); let res; try { res = await fetch(url, { redirect: 'manual', signal: controller.signal, }); } finally { clearTimeout(timeout); } ``` ### Technical Analysis The code resolves the supplied hostname with `lookup()` and verifies that the returned address is not within selected private, loopback, or link-local ranges. The later `fetch()` call independently resolves the hostname again. This creates a time-of-check/time-of-use discrepancy. An attacker wh ...[truncated 2439 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/clawdraw.mjs:2785
Finding

Predictable Temporary Files Permit Local Disclosure and Symlink Attacks

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/auth.mjs:50
Finding

Credential Storage Does Not Repair Pre-Existing Insecure Permissions

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (44)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README states that setup automatically creates an agent account and saves an API key with no browser, website, or manual key entry, but does not clearly warn users that credentials will be created and persisted locally. Silent credential creation and storage can surprise users, expand the trusted footprint of the system, and leave long-lived secrets on disk without informed consent or guidance on storage location and revocation.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
files: ["scripts/clawdraw.mjs","scripts/auth.mjs","scripts/connection.mjs","scripts/snapshot.mjs","scripts/symmetry.mjs","scripts/roam.mjs","primitives/","lib/"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
files: ["scripts/clawdraw.mjs","scripts/auth.mjs","scripts/connection.mjs","scripts/snapshot.mjs","scripts/symmetry.mjs","scripts/roam.mjs","primitives/","lib/"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
files: ["scripts/clawdraw.mjs","scripts/auth.mjs","scripts/connection.mjs","scripts/snapshot.mjs","scripts/symmetry.mjs","scripts/roam.mjs","primitives/","lib/"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
awdraw.mjs","scripts/auth.mjs","scripts/connection.mjs","scripts/snapshot.mjs","scripts/symmetry.mjs","scripts/roam.mjs","primitives/","lib/","templates/","comm

Cloud Metadata Access

High
Category
Server-Side Request Forgery
Confidence
90% confidence
Finding

Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.

Content

Scanner excerpt · references/SECURITY.md (reported line 107)May include surrounding context.

md
The paint command fetches an image from a user-provided URL, processes it with `sharp` (libvips), and converts it to strokes:

- **URL validation** — Only HTTP/HTTPS protocols are allowed. Private and internal IP ranges (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, IPv6 loopback, link-local `fe80:`, unique local `fc00:`/`fd`) are blocked via DNS resolution to prevent SSRF.
- **Redirect SSRF protection** — Fetch uses `redirect: 'manual'` to prevent attackers from bypassing DNS validation with a public URL that 301-redirects to a private IP (e.g. `169.254.169.254`). Redirect targets are re-validated through `validateImageUrl()` before following. Maximum 1 redirect hop.
- **30s fetch timeout** — `AbortController` enforces a 30-second timeout to prevent slow-server DoS.
- **Content-Type validation** — Only `image/*` MIME types are accepted. Non-image responses are rejected before being passed to `sharp`.
- **Format whitelist** — Only `image/jpeg`, `image/png`, `image/webp`, `image/gif`, `image/tiff`, and `image/avif` are allowed. Other image formats (and all non-image decoders in libvips) are never reached.

Session Persistence

Medium
Category
Rogue Agent
Confidence
81% confidence
Finding

The documented behavior implies persistent external state: generated strokes are sent to a shared canvas in real time and the feature list also references local history for undo. In skill context this is more dangerous because actions are not purely local or ephemeral; agent output can persist remotely and locally, creating audit, privacy, and unintended-action risks if the skill is invoked accidentally.

Content

Scanner excerpt · README.md (reported line 7)May include surrounding context.

md
## What it does

Gives AI agents the ability to draw on a shared infinite canvas alongside humans and other agents. Agents create stroke data (parametric curves, fractals, flow fields, etc.) and send the resulting strokes to the canvas in real time.

## Features

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README explains that agents send generated strokes in real time to a shared infinite multiplayer canvas, but it does not prominently warn that outputs are transmitted to and visible within a shared external service. Without a user-facing disclosure, users may unknowingly send sensitive prompts, derived content, or identifying artistic output to a public or semi-public environment.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README says users can simply ask the agent to draw and 'it knows what to do,' which is broad invocation guidance without clear boundaries, confirmation requirements, or exclusions. In an agent environment, this can cause the skill to trigger on ordinary drawing-related requests and perform external actions on a shared canvas without sufficiently explicit user intent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares network and environment-backed behavior (CLAWDRAW_API_KEY, HTTPS/WSS endpoints, fetching image URLs) but does not declare an explicit tool scope such as permissions or allowed-tools. That makes the effective authority broader and less auditable, increasing the risk that an agent can use network/env capabilities without clear policy boundaries.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
---
name: clawdraw
version: 0.9.20
description: "Create algorithmic art on ClawDraw's infinite multiplayer canvas. Use when asked to draw, paint, create visual art, generate patterns, or make algorithmic artwork. Supports custom stroke generators, 75 primitives (fractals, flow fields, L-systems, spirographs, noise, simulation, 3D), 25 collaborator behaviors (extend, branch, contour, morph, etc.), SVG templates, stigmergic markers, symmetry transforms, composition, image upload and placement (PNG/JPEG/WebP/GIF, 5MB max), image painting (5 artistic modes: pointillist, sketch, vangogh, slimemold, freestyle), and canvas vision snapshots."
user-invocable: true
homepage: https://clawdraw.ai
emoji: 🎨

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
- **Report what you spent.** After drawing, tell the user approximately how many strokes you sent and how much INQ it cost.
- **Share the waypoint link, not a follow link.** Every draw/paint command automatically creates a waypoint and prints a `Waypoint: https://clawdraw.ai/?wp=...` URL. Present this URL to the user so they can watch the drawing in real time. **Never** generate or share `?follow=` URLs — follow mode is a web-only feature and agents must not use it.
- **Run setup before drawing.** Before any draw command, if you have not already confirmed authentication, run `clawdraw setup` first. There is no API key available on the ClawDraw website — `clawdraw setup` is the only way to create agent credentials. It takes 5 seconds and requires no user input.
- **Handle auth errors with setup.** If any command fails with "Agent auth failed (401)" or "Invalid or revoked API key", run `clawdraw setup` immediately. Do not ask the user to find an API key on a website — none exists there.
- **One tab per request.** The first draw/paint/compose command in a request opens the waypoint and browser tab automatically. Every subsequent command in the same request MUST use `--no-waypoint` — otherwise a new tab opens for each command.

## Installation

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

md
### Claude Code

`npm install -g @clawdraw/skill` auto-registers the skill at `~/.claude/skills/clawdraw/SKILL.md`.
Start a new Claude Code session — `/clawdraw` is immediately available.

**First-time setup (required before drawing):**

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill encourages fetching arbitrary user-supplied image URLs for paint, but the warning about external network access and privacy implications is only buried later in the document rather than presented at the point of use. This can lead agents to retrieve attacker-controlled or sensitive internal URLs, enabling SSRF-like behavior or unintended disclosure of browsing targets/metadata.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
## Model Invocation Notice

This skill is invoked only when the user explicitly asks to draw, paint, or create art. It does not auto-execute on startup, run on a schedule, or monitor background events. The `always: false` metadata flag confirms this is an opt-in skill.

## Trust Statement

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
## Model Invocation Notice

This skill is invoked only when the user explicitly asks to draw, paint, or create art. It does not auto-execute on startup, run on a schedule, or monitor background events. The `always: false` metadata flag confirms this is an opt-in skill.

## Trust Statement

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs the agent to blindly set environment variables from an untrusted task object before running shell-accessed commands. Because environment variables can alter execution behavior, redirect config/auth paths, inject options into subprocesses, or influence shell-invoked tooling, this creates a command/context injection surface and can also expose or misuse sensitive credentials supplied by the task.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file documents an HTTP image upload endpoint using a bearer token and base64-encoded image payload, which affects user data and privacy. The section provides usage details and limits but does not include any warning or disclosure that image contents and authentication credentials are being sent to a remote service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/WEBSOCKET.md (reported line 65)May include surrounding context.

Upload image (HTTP)

POST https://api.clawdraw.ai/api/agents/images with Authorization: Bearer <jwt>.

json
{ "base64": "<base64-encoded-image>", "x": 5000, "y": 5000, "width": 300, "height": 300 }

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The manifest describes art creation, collaboration behaviors, image handling, and vision snapshots, but not autonomous roaming. This file imports and routes a roam command as 'Autonomous free-roam mode', adding agent autonomy outside the declared scope.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/clawdraw.mjs (reported line 117)May include surrounding context.

js
const state = readState();
  if (!state.hasCustomAlgorithm) {
    console.log('');
    console.log('Create your own algorithm first!');
    console.log('');
    console.log('Use `clawdraw stroke --stdin` or `clawdraw stroke --file` to send custom strokes,');
    console.log('then you can mix in built-in primitives with `clawdraw draw`.');

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

The create and setup flows display or persist newly issued API keys locally, including writing them to ~/.clawdraw/apikey.json, but no file-permission hardening is shown in this file. On multi-user systems or lax umask settings, this can expose long-lived credentials to other local users or processes, enabling unauthorized account access and spending actions.

Content

Scanner excerpt · scripts/clawdraw.mjs (reported line 376)May include surrounding context.

js
async function cmdCreate(name) {
  if (!name) {
    console.error('Usage: clawdraw create <agent-name>');
    process.exit(1);
  }
  try {

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest frames this skill as creating algorithmic art on ClawDraw's canvas, but the code also redeems web-account link codes and creates Stripe checkout sessions for purchasing INQ. Those are account and billing workflows rather than drawing or canvas-manipulation behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest mentions image upload/placement and image painting modes, but not proposing generation areas, acquiring generation locks, capturing screenshots for generation, or preparing prompts for external image generation workflows. The propose-pgs and generate commands add a separate image-generation orchestration capability.

Content

No source excerpt is available for this finding.

Scope Creep

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The security manifest explicitly claims files: none, but the code reads and writes a marker file in the system temp directory to implement browser-tab cooldown behavior. This is a real capability mismatch: agents or users relying on the manifest for sandboxing/trust decisions would be misled about local filesystem side effects, and hidden file writes are especially sensitive in agent skill ecosystems.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/clawdraw.mjs:75