Back to skill

Security audit

Agents-Manager-and-IM

Security checks for vulnerabilities and agentic risk

Overview

The skill is a real OpenClaw agent manager, but it exposes unauthenticated controls that can run shell commands and modify or delete OpenClaw agent data.

Review carefully before installing. Do not run this on a machine with valuable OpenClaw credentials or agent data unless you first add authentication, bind the server to 127.0.0.1, remove shell-based command construction, validate paths and IDs, replace rm -rf with safe filesystem deletion, remove and rotate the documented token if it was real, and back up ~/.openclaw.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (7)

T09 · Insecure Skill Coding Practices

Error
Location
server-gemini.js:101
Finding

Unauthenticated Remote Shell Command Injection Through Chat Messages

Content
View full analysis
{ try { const { id } = req.params; const { message, imageData } = req.body; if (!message && !imageData) { return res.status(400).json({ success: false, error: 'Message or image is required' }); } const agentId = id.replace('agent-', ''); const workspace = `workspace-${agentId}`; const workspacePath = path.join(CONFIG.workspaceDir, workspace); let taskMessage = message || 'Analyze this image'; if (imageData) { taskMessage = `${message || ''} [image uploaded]`.trim(); } const safeMessage = taskMessage.replace(/"/g, '\\"').replace(/\n/g, ' '); const { stdout } = await execCmd( `cd "${workspacePath}" && openclaw agent --agent ${agentId} --message "${safeMessage}" --json 2>&1` ); ``` The command is executed through a shell: ```javascript async function execCmd(cmd) { return new Promise((resolve, reject) => { exec(cmd, { shell: 'zsh' }, (error, stdout, stderr) => { if (error) reject(error); else resolve({ stdout, stderr }); }); }); } ``` ### Technical Analysis The request-controlled `message` is embedded directly into a command string passed to `child_process.exec()` with Z shell enabled. The attempted sanitization only escapes double quotation marks and replaces newline characters. It does not prevent command substitution or other shell interpretation. For example, command substitutions using `$(...)` or backticks remain active inside double-quoted strings. The request-controlled agent identifier is also interpolated into the command without being passed as a separately quoted process argument. The endpoint has no authentication or authorization. Consequently, this is ...[truncated 1122 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
server-gemini.js:21
Finding

Unauthenticated Privileged Agent Management and Recursive Deletion

Content
View full analysis
{ try { const { name, description, model } = req.body; if (!name) return res.status(400).json({ success: false, error: 'Name is required' }); const agentId = `agent-${name.toLowerCase().replace(/\s+/g, '-')}`; const agentDir = path.join(CONFIG.agentsDir, agentId); await fs.mkdir(agentDir, { recursive: true }); const agentConfig = { id: agentId, name, description: description || '', model: model || 'bailian/qwen3.5-plus', workspace: `workspace-${name.toLowerCase()}`, createdAt: new Date().toISOString(), status: 'active' }; await writeJsonFile(path.join(agentDir, 'config.json'), agentConfig); } catch (error) { res.status(500).json({ success: false, error: error.message }); } }); app.delete('/api/agents/:id', async (req, res) => { try { const { id } = req.params; const agentDir = path.join(CONFIG.agentsDir, id); try { await fs.access(agentDir); } catch (e) { return res.status(404).json({ success: false, error: 'Agent not found' }); } await execCmd(`rm -rf "${agentDir}"`); } catch (error) { res.status(500).json({ success: false, error: error.message }); } }); ``` ### Technical Analysis The application exposes endpoints that create agent directories, modify global agent configuration, run agent conversations, and recursively delete agent directories. None of these endpoints authenticates the caller or checks whether the caller is authorized to manage the selected agent. Calling `cors()` without a rest ...[truncated 1413 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
server-gemini.js:61
Finding

Path Traversal and Filesystem Writes Through Unvalidated Agent and Workspace Names

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
index.html:285
Finding

Stored DOM Cross-Site Scripting Through Agent Metadata

Content
View full analysis
'; html += '
'; html += '' + emoji + '' + agent.name; html += '
'; html += '
' + (agent.description || '') + '
'; html += ''; } listEl.innerHTML = html; } catch (error) { console.error('Failed to load agents:', error); } } ``` An escaping helper exists but is not used for the agent list: ```javascript function escapeHtml(text) { const div = document.createElement('div'); div.textContent = text; return div.innerHTML; } ``` ### Technical Analysis Agent names, descriptions, and IDs originate from the unauthenticated creation API and are persisted in the agent registry. The front end concatenates those fields into an HTML string and assigns the result to `innerHTML`. Because the fields are not encoded for their specific HTML and JavaScript contexts, attacker-provided markup can create executable elements or event handlers. The ID is particularly dangerous because it is placed inside an inline `onclick` JavaScript attribute. This is a stored vulnerability: the payload remains in the age ...[truncated 1023 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
cli.js:41
Finding

Local Shell Command Injection in CLI HTTP Request Construction

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
README.md:42
Finding

Credential-Like OpenClaw Operator Token Committed in Documentation

Content
View full analysis
Remediation
View remediation

other

Warning
Location
SECURITY.md:5
Finding

Security Documentation Misrepresents Filesystem Privileges

Content
View full analysis
Remediation
View remediation
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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (52)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims UI features like image upload, chat history, and message isolation, while the reported backend behavior instead manages agent directories, edits ~/.openclaw state, and runs host commands such as openclaw and rm -rf. This combination of overstated benign UI capabilities and understated privileged host actions is dangerous because it can cause users to underestimate the operational and destructive access being granted.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims UI features like image upload, chat history, and message isolation, while the reported backend behavior instead manages agent directories, edits ~/.openclaw state, and runs host commands such as openclaw and rm -rf. This combination of overstated benign UI capabilities and understated privileged host actions is dangerous because it can cause users to underestimate the operational and destructive access being granted.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims UI features like image upload, chat history, and message isolation, while the reported backend behavior instead manages agent directories, edits ~/.openclaw state, and runs host commands such as openclaw and rm -rf. This combination of overstated benign UI capabilities and understated privileged host actions is dangerous because it can cause users to underestimate the operational and destructive access being granted.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims UI features like image upload, chat history, and message isolation, while the reported backend behavior instead manages agent directories, edits ~/.openclaw state, and runs host commands such as openclaw and rm -rf. This combination of overstated benign UI capabilities and understated privileged host actions is dangerous because it can cause users to underestimate the operational and destructive access being granted.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: path-to-regexp==0.1.12 — 1 advisory(ies): CVE-2024-45296 (path-to-regexp vulnerable to Regular Expression Denial of Service via multiple r)

High
Category
Supply Chain
Confidence
98% confidence
Finding

path-to-regexp 0.1.12 is a real high-risk dependency issue because vulnerable route-matching regex generation can allow Regular Expression Denial of Service. In an Express-based internet-facing service, route parsing sits directly on the request path, so malformed requests may consume excessive CPU and degrade or halt service availability.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The server wraps shell execution in a generic helper and uses it for operationally sensitive actions, including invoking agents and deleting directories. In this file, user-influenced values such as agent IDs and message content are interpolated into shell command strings, which creates command-injection risk and also grants the web UI unnecessary destructive power for a chat manager.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The application builds shell commands from request-influenced values and executes them with exec(..., { shell: 'zsh' }). In the chat flow, agentId derived from req.params.id, workspace loaded from attacker-influenced config, and message are interpolated into a shell command with only partial escaping, which is insufficient against shell metacharacter expansion and option injection. In this skill context, the server is explicitly a multi-agent manager exposed over HTTP, so this path is core functionality and especially dangerous.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

The delete-agent capability is exposed through an unauthenticated HTTP endpoint and performs a destructive filesystem operation on a parameterized target. In this skill context, an agent-management platform is expected to handle privileged local resources, so exposing deletion over a broad API surface without access control makes abuse far more dangerous, potentially allowing arbitrary removal of managed agent data.

Content

Scanner excerpt · server.js (reported line 263)May include surrounding context.

js
});

/**
 * DELETE /api/agents/:id - 删除 Agent
 */
app.delete('/api/agents/:id', async (req, res) => {
  try {

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation instructs users to extract an Operator Token from a local OpenClaw file and place it into config.json without clearly warning that the token is a sensitive credential. This increases the risk of credential exposure through source control, backups, screenshots, or accidental sharing, which could allow unauthorized access to the OpenClaw gateway or agent environment.

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 · QUICKSTART.md (reported line 36)May include surrounding context.

md
node cli.js list

# 创建新 Agent
node cli.js create Judy "营销外展专家" bailian/qwen3.5-plus

# 与 Agent 对话
node cli.js chat agent-judy

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file includes CLI commands for deleting an Agent and later shows a DELETE API example, but the document does not warn that these actions remove registered agents or describe the impact on associated configuration/workspace state. Under the markdown-specific warning rule, destructive behaviours that could affect user data or system integrity should be disclosed clearly.

Content

No source excerpt is available for this finding.

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 · QUICKSTART.md (reported line 56)May include surrounding context.

获取 Agent 列表

bash
curl http://localhost:3000/api/agents

创建 Agent

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation instructs users to place an operator token directly into config.json without any privacy or secret-handling guidance. This increases the risk of credential exposure through filesystem leakage, screenshots, backups, or accidental source control commits, which could enable unauthorized access to the OpenClaw gateway.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README content is entirely in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. The policy requires flagging language or locale constraints when they are imposed without user opt-in or clear justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file describes a DELETE endpoint for removing an Agent, but it does not include any warning about the destructive nature of the action or whether deletion is reversible. Under the markdown-specific warning criteria, destructive operations affecting user-managed resources should be disclosed clearly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file presents all safety and usage guidance exclusively in Chinese, including warnings and operational details. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale limitation is documented and justified.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill declares access to sensitive local resources and instructs the user to run Node.js code, but it does not explicitly declare any tool scope or permissions despite requiring shell, filesystem, and network-like capabilities. This weakens user visibility and consent around what the skill can do, especially given the broader behavior indicated by the accompanying static findings.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill’s natural-language instructions, headings, and warnings are predominantly presented in Chinese, which effectively imposes a specific language on users. The policy allows locale constraints only when they are optional or clearly justified, but this file does not offer an alternative language or explicit opt-in.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a multi-agent conversation management platform with UI features like chat history and image upload. In this CLI implementation, the skill invokes arbitrary shell commands via execSync and later constructs curl command strings for routine API access, introducing shell-execution capability that is not an obvious requirement of agent management itself.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The CLI builds a shell command string for curl and inserts JSON request data directly into a single-quoted shell argument. If attacker-controlled input contains a single quote or shell metacharacters, it can break out of quoting and trigger command injection on the local machine, making this much more severe than ordinary external transmission.

Content

Scanner excerpt · cli.js (reported line 27)May include surrounding context.

js
const method = options.method || 'GET';
  const body = options.body ? JSON.stringify(options.body) : null;
  
  let cmd = `curl -s -X ${method} "${url}"`;
  if (body) {
    cmd += ` -H "Content-Type: application/json" -d '${body}'`;
  }

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

This second helper has the same core flaw: it interpolates JSON-serialized user-controlled body data into a shell command executed via zsh. Because create/chat inputs originate from CLI arguments or interactive input, a crafted value can inject arbitrary commands locally while appearing to be only API data.

Content

Scanner excerpt · cli.js (reported line 47)May include surrounding context.

js
const url = API_BASE + endpoint;
  const method = options.method || 'GET';
  
  let cmd = `curl -s -X ${method} "${url}"`;
  if (options.body) {
    cmd += ` -H "Content-Type: application/json" -d '${JSON.stringify(options.body)}'`;
  }

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The delete command performs an irreversible destructive action immediately on a supplied agent ID, with no confirmation prompt, dry-run mode, or force flag semantics. In a management CLI, this increases the chance of accidental deletion from user error, scripting mistakes, or copied wrong IDs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The root HTML element sets lang="zh-CN", and the interface text and time formatting are also fixed to Chinese, indicating a mandatory locale choice. Per policy, forcing a specific language or locale without opt-in or documented regional justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The application persists per-agent chat history, including user messages and image data references, in browser localStorage with no disclosure, retention notice, or consent. localStorage is readable by any script running on the origin and remains after logout/browser restart, so sensitive prompts or uploaded content can be exposed on shared devices or through same-origin XSS elsewhere in the app.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code sends message text and imageData to the '/agents/{id}/chat' endpoint via fetch, which transmits potentially sensitive user content to a server. The UI text invites users to type and upload images, but does not disclose that this content will be sent to backend services.

Content

No source excerpt is available for this finding.