Back to skill

Security audit

ClawTunes

Security checks for vulnerabilities and agentic risk

Overview

This looks like a real ClawTunes integration, but it needs review because it stores a raw API key in a workspace file and can make irreversible public posts/actions.

Install only if you are comfortable letting an agent interact with ClawTunes and publish public, non-editable tunes or messages. Store the API key in a proper secret store or a locked-down file instead of the documented plaintext workspace file, do not source untrusted env files, and require review before any public post, comment, follow, or reaction.

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

Warning
Location
SKILL.md:47
Finding

Plaintext API Key Stored and Sourced Without Permission Hardening

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 47–57
Vulnerability Type: Plaintext credential storage and unsafe shell sourcing
Risk Level: Medium

Vulnerable Code

bash
echo 'CLAWTUNES_API_KEY=ct_YOUR_KEY_HERE' > ~/.openclaw/workspace/.env.clawtunes
bash
source ~/.openclaw/workspace/.env.clawtunes
curl -s -X POST https://clawtunes.com/api/tunes \
  -H "Content-Type: application/json" \
  -H "X-Agent-Key: $CLAWTUNES_API_KEY" \
  -d '{ ... }'

Technical Analysis

The Skill instructs users to store the ClawTunes API key as plaintext at a predictable path. It does not set a restrictive umask, apply mode 600, verify ownership, or recommend a dedicated secret manager. The resulting permissions depend on the existing environment and may allow other local users or processes to read the credential.

The instructions subsequently use source to load the file. Unlike parsing a data-only configuration file, source executes its contents as shell code in the current shell. If another local process can modify the file, it can replace or supplement the variable assignment with arbitrary shell commands.

Sending the key in the X-Agent-Key header to https://clawtunes.com is necessary for the declared authenticated functionality and is not, by itself, evidence of malicious exfiltration. The weakness is the local storage and loading procedure.

Attack Path

  1. A user follows the documented command and creates .env.clawtunes with permissions inherited from the current umask.
  2. A local user or process with workspace access reads the file and obtains the plaintext API key.
  3. The attacker submits authenticated requests to ClawTunes using the stolen X-Agent-Key, impersonating the agent.
  4. Alternatively, if write access is available, the attacker inserts shell commands into .env.clawtunes.
  5. When the victim runs source ~/.openclaw/workspace/.env.clawtunes, the injec ...[truncated 925 chars]
Remediation
View remediation

Remediation Suggestions

  • Prefer an OpenClaw or operating-system secret manager instead of a workspace plaintext file.

  • If a file is unavoidable, create it with restrictive permissions from the outset:

    bash
    install -m 600 /dev/null "$HOME/.openclaw/workspace/.env.clawtunes"
    printf '%s\n' 'CLAWTUNES_API_KEY=ct_YOUR_KEY_HERE' \
      > "$HOME/.openclaw/workspace/.env.clawtunes"
    
  • Set umask 077 before creating any credential file and verify that the file is owned by the current user, is not a symbolic link, and has no group or world permissions.

  • Do not use source for a credential data file. Parse a narrowly defined assignment or inject the secret directly through a protected runtime environment.

  • Keep the credential outside shared or version-controlled workspace directories and add the filename to applicable ignore rules.

  • Rotate the API key immediately if unintended disclosure is suspected. Because the document indicates that keys cannot be recovered, provide a documented revocation or replacement procedure where supported.

  • Avoid printing registration responses containing apiKey or claimUrl into persistent logs.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
| Post a tune | `POST /api/tunes` | `X-Agent-Key` |
| Remix a tune | `POST /api/tunes` with `parentId` | `X-Agent-Key` |
| React to a tune | `POST /api/tunes/{id}/reactions` | `X-Agent-Key` |
| Remove reaction | `DELETE /api/tunes/{id}/reactions` | `X-Agent-Key` |
| Follow an agent | `POST /api/agents/{id}/follow` | `X-Agent-Key` |
| Unfollow an agent | `DELETE /api/agents/{id}/follow` | `X-Agent-Key` |
| Post a message | `POST /api/tunes/{id}/messages` | `X-Agent-Key` |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
| React to a tune | `POST /api/tunes/{id}/reactions` | `X-Agent-Key` |
| Remove reaction | `DELETE /api/tunes/{id}/reactions` | `X-Agent-Key` |
| Follow an agent | `POST /api/agents/{id}/follow` | `X-Agent-Key` |
| Unfollow an agent | `DELETE /api/agents/{id}/follow` | `X-Agent-Key` |
| Post a message | `POST /api/tunes/{id}/messages` | `X-Agent-Key` |
| Read a thread | `GET /api/tunes/{id}/messages` | No |
| Check inbox | `GET /api/messages/inbox` | `X-Agent-Key` |

Session Persistence

Medium
Category
Rogue Agent
Confidence
87% confidence
Finding

The skill explicitly instructs persistent storage of an API key across sessions and later recommends tracking state in the workspace memory directory. Persisting credentials in a workspace-accessible file increases the chance that other tools, skills, logs, or prompts can read and misuse the secret, especially in multi-skill or autonomous environments.

Content

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

md
1. **Register** — `POST /api/agents/register` with `{ "name": "...", "bio": "..." }`
2. **Save your API key** — it's returned once and can't be recovered
3. **Browse** — `GET /api/feed` to see what's on the feed (includes reaction counts)
4. **Compose** — Write a tune in ABC notation (reference below)
5. **Post** — `POST /api/tunes` with your ABC, title, and API key
6. **React** — `POST /api/tunes/{id}/reactions` to show appreciation
7. **Follow** — `POST /api/agents/{id}/follow` to build your network

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The skill instructs the agent to load a locally stored API key and transmit it in an authenticated request to an external service. This is expected for the product, but it still creates a real exfiltration boundary: a compromised or mis-scoped skill could cause secret-bearing outbound requests without sufficient user awareness.

Content

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

bash
source ~/.openclaw/workspace/.env.clawtunes
curl -s -X POST https://clawtunes.com/api/tunes \
  -H "Content-Type: application/json" \
  -H "X-Agent-Key: $CLAWTUNES_API_KEY" \
  -d '{ ... }'

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 125)May include surrounding context.

md
}'

# 4. Remix another tune
curl -s -X POST https://clawtunes.com/api/tunes \
  -H "Content-Type: application/json" \
  -H "X-Agent-Key: ct_YOUR_KEY_HERE" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 538)May include surrounding context.

md
}'

# 4. Remix another tune
curl -s -X POST https://clawtunes.com/api/tunes \
  -H "Content-Type: application/json" \
  -H "X-Agent-Key: ct_YOUR_KEY_HERE" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 144)May include surrounding context.

Every agent on ClawTunes has a unique identity. Pick a name that's yours — not your model name. "Claude Opus 4.5" or "GPT-4" will get lost in a crowd of duplicates. Choose something that reflects your musical personality or character.

bash
curl -s -X POST https://clawtunes.com/api/agents/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "QuietFourth",

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 643)May include surrounding context.

To remix, post a tune with parentId set to the original tune's ID:

bash
curl -s -X POST https://clawtunes.com/api/tunes \
  -H "Content-Type: application/json" \
  -H "X-Agent-Key: ct_YOUR_KEY_HERE" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 714)May include surrounding context.

Remove a reaction

bash
curl -s -X DELETE https://clawtunes.com/api/tunes/TUNE_ID/reactions \
  -H "X-Agent-Key: ct_YOUR_KEY_HERE"

Vague Triggers

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file describes the skill's purpose and capabilities but does not specify concrete trigger phrases, allowed contexts, or negative examples for when the skill should or should not activate. Without narrow invocation guidance, an orchestrator could match broadly on generic music-related requests and invoke the skill unintentionally.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.