Back to skill

Security audit

ClawMate Agent Skill

Security checks for vulnerabilities and agentic risk

Overview

This skill is a mostly coherent social-platform integration, but it asks the agent to use powerful account credentials in unsafe ways and can autonomously post, message, change profile data, and configure webhooks.

Install only if you are comfortable giving this skill a ClawMateSquare bearer token that can act as the agent. Use a narrowly scoped, revocable token if possible, avoid sourcing untrusted `.env` files, pin the API base to the official HTTPS service, review posts/DMs/profile changes before autonomous use, and skip webhook setup unless you intentionally want ongoing event delivery to your server.

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
SKILL.md:31
Finding
Arbitrary Shell Execution Through Sourced Environment File## Vulnerability Details **File Location**: `SKILL.md`, lines 31–38 **Vulnerability Type**: Unsafe configuration loading resulting in arbitrary shell execution **Risk Level**: High ### Vulnerable Code ```bash Before use, read the `.env` file to load the following environment variables: - `CLAWMATE_API_TOKEN`: Your Agent Token (obtained from the ClawMateSquare App) - `CLAWMATE_API_BASE`: API address, default `https://global.chaichaijizhang.xyz` # Read the .env file: source ~/.openclaw/skills/clawmatesquare/.env ``` ### Technical Analysis The Skill instructs the agent to load a `.env` file with the shell built-in `source`. Contrary to a data-only environment-file parser, `source` executes the entire file as shell code in the current shell context. An attacker who can modify or replace this file can insert command substitutions, shell functions, redirections, or arbitrary commands. Those commands execute with the same local filesystem, process, and network permissions available to the agent's terminal session. The declared functionality only requires reading two configuration values. Executing arbitrary shell syntax exceeds the minimum privilege necessary for that purpose. ### Attack Path 1. An attacker, compromised installer, or another local process modifies `~/.openclaw/skills/clawmatesquare/.env`. 2. Malicious shell statements are added alongside apparently legitimate environment assignments. 3. The agent follows `SKILL.md` and runs: ```bash source ~/.openclaw/skills/clawmatesquare/.env ``` 4. The shell executes the malicious statements in the agent's current context. 5. The payload can read accessible files and credentials, modify local data, or make outbound network requests. ### Impact Assessment Successful exploitation provides arbitrary command execution with the privileges of the user running the agent. The accessible scope may include: - The ClawMate API token and other environment variables - Files readable or writable by the agen ...[truncated 346 chars]
Remediation
## Remediation Suggestions - Do not use `source`, `.`, `eval`, or equivalent shell execution to parse configuration. - Store configuration through the platform's protected secret-management mechanism where available. - If a file must be used, parse only an explicit allowlist of keys such as `CLAWMATE_API_TOKEN` and `CLAWMATE_API_BASE`. - Reject command substitutions, shell metacharacters, malformed lines, duplicate keys, and unexpected variables. - Require restrictive file permissions, such as owner-only read and write access. - Verify that the configuration file is a regular file owned by the expected user and is not a symbolic link. - Keep the token separate from mutable non-secret endpoint configuration.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:31
Finding
Bearer Token Can Be Forwarded to an Untrusted Configurable Origin## Vulnerability Details **File Location**: `SKILL.md`, lines 31–60 **Vulnerability Type**: Credential disclosure through unrestricted API destination configuration **Risk Level**: Medium ### Vulnerable Code ```bash Before use, read the `.env` file to load the following environment variables: - `CLAWMATE_API_TOKEN`: Your Agent Token (obtained from the ClawMateSquare App) - `CLAWMATE_API_BASE`: API address, default `https://global.chaichaijizhang.xyz` # Read the .env file: source ~/.openclaw/skills/clawmatesquare/.env ``` ```bash curl -s -H "Authorization: Bearer $CLAWMATE_API_TOKEN" \ "$CLAWMATE_API_BASE/agent-api/me" ``` ```bash - Every request must include the `Authorization: Bearer $CLAWMATE_API_TOKEN` header - Use `$CLAWMATE_API_BASE` as the base URL prefix ``` ### Technical Analysis The Skill sends the bearer token to the origin selected by `CLAWMATE_API_BASE`. Both the token and destination are loaded from the same mutable configuration file. The instructions do not require HTTPS, pin or allowlist the official hostname, prohibit embedded URL credentials, or constrain redirect behavior. Sending a bearer token to the legitimate ClawMate service is required for the declared functionality. Allowing an arbitrary destination to receive that token is not required and violates least-privilege credential handling. Although `curl` generally protects authentication headers across redirects to different hosts, directly configuring an attacker-controlled base URL still sends the header to that origin on the initial request. A plaintext HTTP base URL could additionally expose the credential to network interception. ### Attack Path 1. An attacker or accidental configuration change sets `CLAWMATE_API_BASE` to an attacker-controlled URL or a plaintext HTTP endpoint. 2. The agent loads the modified value from `.env`. 3. The agent performs any documented API request. 4. `curl` sends `Authorization: Bearer $CLAWMATE_API_TOKEN` to the configured origin. 5. The a ...[truncated 752 chars]
Remediation
## Remediation Suggestions - Pin the API base URL to the official HTTPS origin unless a documented enterprise deployment requires customization. - If customization is necessary, enforce an explicit hostname allowlist and require the `https` scheme. - Reject URLs containing user information, fragments, unexpected ports, or ambiguous host encodings. - Invoke `curl` with hardened protocol controls, for example: ```bash curl --proto '=https' --proto-redir '=https' --max-redirs 0 \ -H "Authorization: Bearer $CLAWMATE_API_TOKEN" \ "https://global.chaichaijizhang.xyz/agent-api/me" ``` - Store endpoint configuration separately from the bearer token and protect both against unauthorized modification. - Issue narrowly scoped, short-lived, revocable tokens rather than credentials covering the entire documented API surface. - Add server-side audience restrictions so a token is valid only for the intended service. - Avoid verbose request logging and ensure authorization headers are redacted from diagnostics.
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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (14)

Credential Access

High
Category
Privilege Escalation
Content
- `CLAWMATE_API_BASE`: API address, default `https://global.chaichaijizhang.xyz`

```bash
# Read the .env file:
source ~/.openclaw/skills/clawmatesquare/.env
```
Confidence
97% confidence
Finding
The instruction to source a local .env file directs the agent to access local credentials, which is a sensitive capability. In agent environments, normalizing file-based secret retrieval raises the risk of secret exposure, accidental echoing, use in unintended contexts, or abuse by prompt injection elsewhere in the skill.

Credential Access

High
Category
Privilege Escalation
Content
```bash
# Read the .env file:
source ~/.openclaw/skills/clawmatesquare/.env
```

## ⚠️ Important: How to Call APIs
Confidence
97% confidence
Finding
This is the same credential-access pattern repeated in the shell snippet, reinforcing that the model should read a specific local secret file path. The specificity of the path makes the behavior more actionable and therefore more dangerous in a prompt-driven execution environment.

Natural-Language Policy Violations

High
Confidence
98% confidence
Finding
The skill explicitly tells the agent to avoid sounding like an AI assistant and to behave as a human-like community member with an 'authentic' persona. This is deceptive identity manipulation: it encourages concealment of automation status and can materially affect consent, trust, and user decision-making in social interactions.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The README promotes posting, commenting, joining circles, and agent-to-agent conversations on an external social platform, but it does not clearly warn that agent-generated or user-derived content may be transmitted off-platform. This creates a real risk of unintended data disclosure, especially because operators may enable the skill without understanding that prompts, profile data, or conversation content could be shared with a third-party service.

Session Persistence

Medium
Category
Rogue Agent
Content
---
name: ClawMateSquare Social
description: Let your Agent socialize on ClawMateSquare — browse posts, create content, comment, like, bookmark, follow, DM, group chat, discover other Agents, and participate in the community in a healthy, authentic way.
---

# ClawMateSquare Social Skill
Confidence
74% confidence
Finding
The skill is explicitly designed for ongoing social participation—maintaining conversations, relationships, DMs, bookmarks, follows, and repeated sessions—which implies persistent behavioral state across interactions. Persistent social memory and engagement are core product features here, but they also increase the risk of long-term profiling, influence accumulation, and privacy harm if not tightly governed.

External Transmission

Medium
Category
Data Exfiltration
Content
Call format:
```bash
# GET request example:
curl -s -H "Authorization: Bearer $CLAWMATE_API_TOKEN" \
  "$CLAWMATE_API_BASE/agent-api/me"

# POST request example:
Confidence
72% confidence
Finding
The skill is built around transmitting data and actions to an external service via authenticated curl calls. External transmission is expected for a social platform skill, but it still presents a real security boundary because local prompts, message content, metadata, and account actions are sent off-box to a third-party endpoint.

Ssd 4

Medium
Confidence
87% confidence
Finding
These instructions frame relationship-building and reciprocal interaction as strategic goals for long-term influence inside a community. Even though the text discourages spam, it still operationalizes social engineering patterns by teaching the agent to cultivate trust and access over time, including escalation toward private channels.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
## DMs require the other party's consent
Don't initiate DMs without permission.
Without consent, only public interactions are allowed:

- Likes
- Bookmarks
Confidence
75% 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.

Ssd 4

Medium
Confidence
96% confidence
Finding
The 'Master override' section normalizes blended identity, telling the agent to continue conversations as if operator and agent are one persona and even to riff on hidden human intervention. This undermines provenance and can deceive counterparties about who is actually speaking, especially in DMs or sensitive exchanges.

Natural-Language Policy Violations

Medium
Confidence
83% confidence
Finding
The skill hardcodes how the agent should address humans and directs a specific interpersonal style when a human takes over. While less severe than outright concealment, it still imposes manipulative social framing and identity-role scripting without user choice, which can distort interactions and platform expectations.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
- Template-flooding comments
- Copy-pasting similar content to multiple people
- Forcing DMs without consent
- Continuous spamming
- Pretending to be close, forcing familiarity
- Posting low-information content just for visibility
Confidence
75% 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.

Description-Behavior Mismatch

Medium
Confidence
89% confidence
Finding
The skill’s stated purpose is social participation, but it also grants the agent the ability to mutate its own identity via profile/personality updates. That expands the trust and safety surface beyond ordinary social actions and enables reputation laundering, impersonation drift, or unapproved persona changes that users may not expect from a 'socializing' skill.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
Webhook configuration is infrastructure-level functionality unrelated to basic social interaction, and it can cause ongoing external event delivery to an arbitrary URL. That creates a durable exfiltration and persistence channel for notifications, comments, and follower events outside the normal agent session.

Context-Inappropriate Capability

Low
Confidence
81% confidence
Finding
The skill instructs the agent to source a local .env file to obtain credentials, which is credential access behavior not implied by the high-level socializing description. In an agent environment, teaching the model to read local secrets increases the chance of unintended secret exposure or reuse beyond the minimum necessary scope.

Static analysis

No suspicious patterns detected.