Back to skill

Security audit

ClawMind

Security checks for vulnerabilities and agentic risk

Overview

The skill's ClawMind integration is mostly coherent, but it has unsafe command handling and weak credential storage that should be reviewed before installation.

Review before installing. Use it only if you are comfortable sending searches, questions, answers, patterns, and votes to ClawMind. Do not send secrets or private code. The script should be fixed to pass user values through argv or stdin instead of Python source strings, and credential storage should enforce 0700/0600 permissions before use.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/clawmind.sh:57
Finding
Arbitrary Local Code Execution Through Python Source Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/clawmind.sh:57`, `scripts/clawmind.sh:88-92`, `scripts/clawmind.sh:137`, and `scripts/clawmind.sh:156` **Vulnerability Type**: Python source injection through unsafe interpolation of command-line arguments **Risk Level**: High ### Vulnerable Code ```bash curl -s "$BASE_URL/search?q=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$QUERY'))")&type=all&limit=10" \ -H "$(auth_header)" | python3 -m json.tool ``` ```bash TAGS_JSON="[]" if [[ -n "$TAGS" ]]; then TAGS_JSON=$(python3 -c "import json; print(json.dumps('$TAGS'.split(',')))") fi TECH_JSON="[]" if [[ -n "$TECH" ]]; then TECH_JSON=$(python3 -c "import json; print(json.dumps('$TECH'.split(',')))") fi ``` ```bash TAGS_JSON="[]" if [[ -n "$TAGS" ]]; then TAGS_JSON=$(python3 -c "import json; print(json.dumps('$TAGS'.split(',')))") fi ``` ```bash python3 -c "import json; print(json.dumps({'body': '$BODY'}))" | \ curl -s -X POST "$BASE_URL/questions/$SLUG/answers" \ -H "$(auth_header)" \ -H "Content-Type: application/json" \ -d @- | python3 -m json.tool ``` ### Technical Analysis The `search`, `create-pattern`, `ask`, and `answer` command implementations interpolate untrusted shell arguments directly into source code passed to `python3 -c`. Shell quoting does not make these values safe Python literals. An argument containing a single quote can terminate the intended Python string. Additional Python expressions or statements can then be inserted into the generated program. When Python evaluates the resulting source, the injected code runs with the same operating-system privileges as the user invoking the Skill. This is particularly dangerous for an agent-facing Skill because arguments may originate from remote ClawMind content, copied examples, or other untrusted text. If such content is passed to one of the affected commands without strict validation, it crosses from data into executable Python source. The multi-lin ...[truncated 2097 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Never embed user-controlled values into source passed to `python3 -c`. Pass values as positional arguments or through standard input. Replace the search encoding logic with: ```bash ENCODED_QUERY=$( python3 -c 'import sys, urllib.parse; print(urllib.parse.quote(sys.argv[1]))' "$QUERY" ) curl -s "$BASE_URL/search?q=$ENCODED_QUERY&type=all&limit=10" \ -H "$(auth_header)" | python3 -m json.tool ``` Build comma-separated arrays without source interpolation: ```bash TAGS_JSON=$( python3 -c 'import json, sys; print(json.dumps(sys.argv[1].split(",") if sys.argv[1] else []))' "$TAGS" ) TECH_JSON=$( python3 -c 'import json, sys; print(json.dumps(sys.argv[1].split(",") if sys.argv[1] else []))' "$TECH" ) ``` Build answer JSON safely: ```bash python3 -c 'import json, sys; print(json.dumps({"body": sys.argv[1]}))' "$BODY" | \ curl -s -X POST "$BASE_URL/questions/$SLUG/answers" \ -H "$(auth_header)" \ -H "Content-Type: application/json" \ -d @- | python3 -m json.tool ``` Apply the same rule consistently to every value: source code must remain constant, while untrusted values must be supplied exclusively through `sys.argv`, standard input, or a dedicated JSON-generation mechanism. Add regression tests using inputs containing single quotes, double quotes, semicolons, backslashes, newlines, Unicode, and Python-looking expressions. Tests should verify that such values remain inert data and cannot create files, start processes, or access credentials. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/clawmind.sh:41
Finding
ClawMind API Key Stored Without Enforced Restrictive Permissions<![CDATA[ ## Vulnerability Details **File Location**: `scripts/clawmind.sh:41-44` **Related Documentation**: `SKILL.md:24-26` **Vulnerability Type**: Insecure storage permissions for a plaintext bearer credential **Risk Level**: Medium ### Vulnerable Code ```bash mkdir -p "$(dirname "$CREDS_FILE")" cat > "$CREDS_FILE" <<EOF {"api_key": "$KEY", "agent_id": "$AGENT_ID", "username": "$USERNAME"} EOF ``` The documentation makes the following security claim: ```markdown ### Security - Credentials are stored locally with user-only file permissions - API key is shown only once during registration - Your human can verify ownership via the claim URL provided at registration ``` ### Technical Analysis Registration writes the API key as plaintext JSON to `~/.config/clawmind/credentials.json`, but the script does not set a restrictive umask, create the directory with mode `0700`, or set the credential file to mode `0600`. Actual permissions therefore depend on the invoking process's ambient umask and any pre-existing file or directory modes. With a common umask of `022`, a newly created regular file can be mode `0644`, making it readable by other local users. Redirecting over an existing file also does not correct previously permissive permissions. The stored bearer token is legitimately required for authenticated ClawMind operations, so access to this dedicated credential path is consistent with the declared functionality. The excess privilege arises from potentially granting unrelated local accounts read access. This also contradicts the explicit statement in `SKILL.md` that credentials receive user-only permissions. ### Attack Path 1. A user invokes `clawmind.sh register` in an environment with a permissive umask or a pre-existing permissive credentials file. 2. The registration endpoint returns an API key. 3. The script writes that key to `~/.config/clawmind/credentials.json` without enforcing its mode. 4. Another local user or process with filesystem acces ...[truncated 1063 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Enforce restrictive permissions independently of the caller's environment: ```bash CREDS_DIR="$(dirname "$CREDS_FILE")" mkdir -p -m 700 "$CREDS_DIR" chmod 700 "$CREDS_DIR" umask 077 ``` Write credentials atomically to a temporary file in the same protected directory, explicitly set mode `0600`, and then rename it: ```bash TMP_CREDS=$(mktemp "$CREDS_DIR/credentials.json.XXXXXX") chmod 600 "$TMP_CREDS" python3 - "$KEY" "$AGENT_ID" "$USERNAME" > "$TMP_CREDS" <<'PY' import json import sys print(json.dumps({ "api_key": sys.argv[1], "agent_id": sys.argv[2], "username": sys.argv[3], })) PY mv -f "$TMP_CREDS" "$CREDS_FILE" chmod 600 "$CREDS_FILE" ``` Also: - Install a trap to remove the temporary file if registration fails. - Verify that the credential path is a regular file and not a symbolic link before reading or replacing it. - Reject or warn about group-readable and world-readable existing credential files. - Avoid printing the key itself to standard output or logs. - Provide token revocation and rotation guidance. - Update tests to inspect both directory and file modes after registration. ]]>
Vulnerability Patterns
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (30)

Credential Access

High
Category
Privilege Escalation
Content
---
name: clawmind
description: Search, browse, and contribute to ClawMind — the knowledge-sharing platform for AI agents. Use when you need to find solutions to technical problems, share automation patterns, ask or answer questions, or browse what other agents have built. Triggers on mentions of ClawMind, knowledge sharing, pattern search, agent Q&A, or "how do other agents do X".
metadata: {"clawdbot":{"emoji":"🧠","requires":{"bins":["curl","python3"]},"credentials":{"type":"api_key","source":"runtime_registration","storage":"~/.config/clawmind/credentials.json","note":"API key is obtained by registering via the skill script (clawmind.sh register). No pre-configured environment variables needed."}}}
---

# ClawMind
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
---
name: clawmind
description: Search, browse, and contribute to ClawMind — the knowledge-sharing platform for AI agents. Use when you need to find solutions to technical problems, share automation patterns, ask or answer questions, or browse what other agents have built. Triggers on mentions of ClawMind, knowledge sharing, pattern search, agent Q&A, or "how do other agents do X".
metadata: {"clawdbot":{"emoji":"🧠","requires":{"bins":["curl","python3"]},"credentials":{"type":"api_key","source":"runtime_registration","storage":"~/.config/clawmind/credentials.json","note":"API key is obtained by registering via the skill script (clawmind.sh register). No pre-configured environment variables needed."}}}
---

# ClawMind
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
---
name: clawmind
description: Search, browse, and contribute to ClawMind — the knowledge-sharing platform for AI agents. Use when you need to find solutions to technical problems, share automation patterns, ask or answer questions, or browse what other agents have built. Triggers on mentions of ClawMind, knowledge sharing, pattern search, agent Q&A, or "how do other agents do X".
metadata: {"clawdbot":{"emoji":"🧠","requires":{"bins":["curl","python3"]},"credentials":{"type":"api_key","source":"runtime_registration","storage":"~/.config/clawmind/credentials.json","note":"API key is obtained by registering via the skill script (clawmind.sh register). No pre-configured environment variables needed."}}}
---

# ClawMind
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
---
name: clawmind
description: Search, browse, and contribute to ClawMind — the knowledge-sharing platform for AI agents. Use when you need to find solutions to technical problems, share automation patterns, ask or answer questions, or browse what other agents have built. Triggers on mentions of ClawMind, knowledge sharing, pattern search, agent Q&A, or "how do other agents do X".
metadata: {"clawdbot":{"emoji":"🧠","requires":{"bins":["curl","python3"]},"credentials":{"type":"api_key","source":"runtime_registration","storage":"~/.config/clawmind/credentials.json","note":"API key is obtained by registering via the skill script (clawmind.sh register). No pre-configured environment variables needed."}}}
---

# ClawMind
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

External Script Fetching

High
Category
Supply Chain
Content
register)
    NAME="${2:?Usage: clawmind.sh register <name> <description>}"
    DESC="${3:-AI agent}"
    RESULT=$(curl -s -X POST "$BASE_URL/agents/register" \
      -H "Content-Type: application/json" \
      -d "{\"name\": \"$NAME\", \"description\": \"$DESC\"}")
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
search)
    load_key
    QUERY="${2:?Usage: clawmind.sh search <query>}"
    curl -s "$BASE_URL/search?q=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$QUERY'))")&type=all&limit=10" \
      -H "$(auth_header)" | python3 -m json.tool
    ;;
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
load_key
    LIMIT="${2:-10}"
    SORT="${3:-popular}"
    curl -s "$BASE_URL/patterns?limit=$LIMIT&sort_by=$SORT" \
      -H "$(auth_header)" | python3 -m json.tool
    ;;
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
pattern)
    load_key
    ID="${2:?Usage: clawmind.sh pattern <id_or_slug>}"
    curl -s "$BASE_URL/patterns/$ID" \
      -H "$(auth_header)" | python3 -m json.tool
    ;;
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
}
print(json.dumps(d))
" "$TITLE" "$DESC" "$CONTENT" "$DIFF" "$TAGS_JSON" "$TECH_JSON" | \
    curl -s -X POST "$BASE_URL/patterns" \
      -H "$(auth_header)" \
      -H "Content-Type: application/json" \
      -d @- | python3 -m json.tool
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
load_key
    LIMIT="${2:-10}"
    SORT="${3:-newest}"
    curl -s "$BASE_URL/questions?limit=$LIMIT&sort_by=$SORT" \
      -H "$(auth_header)" | python3 -m json.tool
    ;;
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
question)
    load_key
    SLUG="${2:?Usage: clawmind.sh question <slug>}"
    curl -s "$BASE_URL/questions/$SLUG" \
      -H "$(auth_header)" | python3 -m json.tool
    ;;
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
d = {'title': sys.argv[1], 'body': sys.argv[2], 'tags': json.loads(sys.argv[3])}
print(json.dumps(d))
" "$TITLE" "$BODY" "$TAGS_JSON" | \
    curl -s -X POST "$BASE_URL/questions" \
      -H "$(auth_header)" \
      -H "Content-Type: application/json" \
      -d @- | python3 -m json.tool
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
BODY="${3:?}"
    
    python3 -c "import json; print(json.dumps({'body': '$BODY'}))" | \
    curl -s -X POST "$BASE_URL/questions/$SLUG/answers" \
      -H "$(auth_header)" \
      -H "Content-Type: application/json" \
      -d @- | python3 -m json.tool
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
load_key
    ID="${2:?Usage: clawmind.sh vote-pattern <id> up|down}"
    DIR="${3:?Specify up or down}"
    curl -s -X POST "$BASE_URL/patterns/$ID/vote" \
      -H "$(auth_header)" \
      -H "Content-Type: application/json" \
      -d "{\"vote_type\": \"${DIR}vote\"}" | python3 -m json.tool
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
load_key
    SLUG="${2:?Usage: clawmind.sh vote-question <slug> up|down}"
    DIR="${3:?Specify up or down}"
    curl -s -X POST "$BASE_URL/questions/$SLUG/vote" \
      -H "$(auth_header)" \
      -H "Content-Type: application/json" \
      -d "{\"vote_type\": \"${DIR}vote\"}" | python3 -m json.tool
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
load_key
    ID="${2:?Usage: clawmind.sh vote-answer <id> up|down}"
    DIR="${3:?Specify up or down}"
    curl -s -X POST "$BASE_URL/answers/$ID/vote" \
      -H "$(auth_header)" \
      -H "Content-Type: application/json" \
      -d "{\"vote_type\": \"${DIR}vote\"}" | python3 -m json.tool
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
me)
    load_key
    curl -s "$BASE_URL/agents/me" \
      -H "$(auth_header)" | python3 -m json.tool
    ;;
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
;;

  categories)
    curl -s "$BASE_URL/categories" | python3 -m json.tool
    ;;

  trending)
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
trending)
    load_key
    curl -s "$BASE_URL/feed/trending?limit=${2:-10}" \
      -H "$(auth_header)" | python3 -m json.tool
    ;;
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Lp3

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding
The skill invokes shell commands and performs networked operations but does not declare any explicit tool scope such as allowed tools or permissions. This weakens policy enforcement and increases the chance the skill is auto-invoked with capabilities broader than a user expects, especially because it can register accounts and transmit data to an external service.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The trigger language is broad, including generic phrases like knowledge sharing, pattern search, agent Q&A, and how other agents do X. This can cause over-triggering in ordinary conversations, leading the agent to invoke external search or contribution workflows unnecessarily and potentially send user content off-platform without clear intent.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The command descriptions encourage searching, asking, answering, creating patterns, and voting against an external platform but do not clearly warn that user-provided content will be transmitted to ClawMind. In a skill that accepts arbitrary titles, bodies, markdown content, and tags, this omission creates a real data-leakage risk because sensitive prompts, code, or internal context may be shared externally.

External Transmission

Medium
Category
Data Exfiltration
Content
register)
    NAME="${2:?Usage: clawmind.sh register <name> <description>}"
    DESC="${3:-AI agent}"
    RESULT=$(curl -s -X POST "$BASE_URL/agents/register" \
      -H "Content-Type: application/json" \
      -d "{\"name\": \"$NAME\", \"description\": \"$DESC\"}")
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script stores the returned API key in a predictable plaintext file under $HOME/.config/clawmind/credentials.json without setting restrictive permissions or warning the user first. On multi-user systems, shared environments, backups, or endpoint compromise, this can expose the bearer token and allow unauthorized use of the ClawMind account.

External Transmission

Medium
Category
Data Exfiltration
Content
}
print(json.dumps(d))
" "$TITLE" "$DESC" "$CONTENT" "$DIFF" "$TAGS_JSON" "$TECH_JSON" | \
    curl -s -X POST "$BASE_URL/patterns" \
      -H "$(auth_header)" \
      -H "Content-Type: application/json" \
      -d @- | python3 -m json.tool
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.