Back to skill

Security audit

Agents-Manager-and-IM

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real OpenClaw agent manager, but it exposes unsafe local management APIs, shell execution, deletion, persistent storage, and a hardcoded token in ways users should review carefully before installing.

Install only in a controlled local environment after removing the hardcoded token, adding authentication, binding the server to 127.0.0.1, replacing shell command construction and rm -rf with safer APIs, validating agent IDs and paths, and deciding whether browser chat/image history should be stored at all.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (7)

T09 · Insecure Skill Coding Practices

Error
Location
server.js:163
Finding

Unauthenticated Remote Shell Command Injection

Content
View full analysis
{ try { const { id } = req.params; const { message } = req.body; if (!message) { return res.status(400).json({ success: false, error: 'Message is required' }); } const agentConfigPath = path.join(CONFIG.agentsDir, id, 'config.json'); let agentConfig = null; try { agentConfig = await readJsonFile(agentConfigPath); } catch (e) {} const agentId = id.replace('agent-', ''); const workspace = agentConfig?.workspace || `workspace-${agentId}`; const workspacePath = path.join(CONFIG.workspaceDir, workspace); try { await fs.access(workspacePath); } catch (e) { return res.status(404).json({ success: false, error: `Agent workspace does not exist: ${workspacePath}` }); } const safeMessage = message.replace(/"/g, '\\"').replace(/\n/g, ' '); const { stdout } = await execCmd( `cd "${workspacePath}" && openclaw agent --agent ${agentId} --message "${safeMessage}" --json 2>&1` ); ``` The command execution helper explicitly enables 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 interpolated into a command executed by `zsh`. The attempted sanitization only escapes double quotes and replaces newline characters. It does not prevent shell expansion within double quotes, including: - Command substitution using `$(...)` - Command substitution using backticks - Parameter expansion - Other shell-specific substitutio ...[truncated 1448 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
server.js:232
Finding

Unauthenticated Path Traversal and Recursive Directory Deletion

Content
View full analysis
{ 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 does not exist' }); } await execCmd(`rm -rf "${agentDir}"`); const agentsConfigPath = path.join(CONFIG.workspaceDir, 'agents.json'); let allAgents = []; try { allAgents = await readJsonFile(agentsConfigPath); } catch (e) { return res.json({ success: true, message: 'Deleted' }); } allAgents = allAgents.filter(a => a.id !== id); await writeJsonFile(agentsConfigPath, allAgents); res.json({ success: true, message: `Agent "${id}" deleted` }); } catch (error) { res.status(500).json({ success: false, error: error.message }); } }); ``` ### Technical Analysis The route parameter `id` is passed directly to `path.join()` without validating its syntax or checking that the resolved path remains inside `CONFIG.agentsDir`. Traversal sequences can cause the normalized path to point outside `~/.openclaw/agents`. After confirming that the target exists, the application executes `rm -rf` against the resulting path. Quoting the path does not prevent traversal because traversal has already been resolved at the filesystem path level. The operation requires no authentication or authorization. ### Attack Path 1. The attacker connects to the exposed Agent Manager API. 2. The attacker supplies an encoded traversal-bearing Agent ID to `DELETE /api/agents/:id`. Encoded path separators may be decoded into the route parameter by the framework. 3. `path.join(CONFIG.agentsDir, id)` normalizes the traver ...[truncated 820 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
server.js:25
Finding

Unauthenticated OpenClaw Agent Management Interface

Content
View full analysis
{ // Enumerates registered and running Agents }); app.post('/api/agents', async (req, res) => { // Creates directories and persistent Agent configuration }); app.post('/api/agents/:id/chat', async (req, res) => { // Invokes a local OpenClaw Agent }); app.delete('/api/agents/:id', async (req, res) => { // Recursively deletes an Agent directory }); app.listen(PORT, () => { console.log(`Agent Manager is running at http://localhost:${PORT}`); }); ``` ### Technical Analysis None of the management routes verifies the caller's identity or authorization. The application enables CORS with the default permissive configuration, allowing arbitrary web origins to read API responses and issue supported cross-origin requests. Calling `app.listen(PORT)` without a host normally binds to all available interfaces, not exclusively to loopback. The console message stating `localhost` does not enforce a loopback-only binding. The APIs expose privileged local operations: - Enumeration of registered and running Agents - Creation of persistent files under `~/.openclaw` - Invocation of local OpenClaw Agents - Recursive deletion of Agent directories - Health information about the local gateway ### Attack Path 1. The attacker discovers port 3000 through local-network access, host exposure, container port publishing, or another network path. 2. The attacker calls `GET /api/agents` to enumerate Agent IDs and metadata. 3. The attacker calls `POST /api/agents` to create persistent Agent records and files. 4. The attacker invokes Agents using `POST /api/agents/:id/chat`, consumi ...[truncated 696 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
server.js:18
Finding

Hardcoded OpenClaw Operator Token in Distributed Files

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
index.html:287
Finding

Persistent 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) { document.getElementById('agentList').innerHTML = '
Load failed: ' + error.message + '
'; } } ``` Additional unsafe rendering occurs when an Agent is selected: ```javascript if (history.length === 0) { chatMessages.innerHTML = '
' + '
' + emoji + '
' + '
Start a conversation with ' + agent.name + '
' + '
'; } ``` ### Technical Analysis The Agent creation API accepts attacker-controlled `name` and `description` values and persists them in `~/.openclaw/agents.json`. The frontend subsequently inserts those values into HTML strings assigned to `innerHTML`. The values are not HTML-escaped or sanitized. Agent IDs are also inserted into an inline `onclick` attribute, allowing attribute ...[truncated 1324 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
cli.js:41
Finding

Local Shell Injection in CLI HTTP Request Construction

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
package-lock.json:19
Finding

Dependency Lockfile Uses a Non-Official Package Mirror

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Rogue AgentSelf-Modification, Session Persistence
Findings (51)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The reported behavior includes child_process shell execution, rm -rf deletion, filesystem access to agent registries, local port probing, and a hardcoded OpenClaw token that is not disclosed in the description. Hardcoded credentials combined with privileged local operations materially increase the risk of unauthorized access, command misuse, and irreversible modification or deletion of local agent data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The reported behavior includes child_process shell execution, rm -rf deletion, filesystem access to agent registries, local port probing, and a hardcoded OpenClaw token that is not disclosed in the description. Hardcoded credentials combined with privileged local operations materially increase the risk of unauthorized access, command misuse, and irreversible modification or deletion of local agent data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The reported behavior includes child_process shell execution, rm -rf deletion, filesystem access to agent registries, local port probing, and a hardcoded OpenClaw token that is not disclosed in the description. Hardcoded credentials combined with privileged local operations materially increase the risk of unauthorized access, command misuse, and irreversible modification or deletion of local agent data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The reported behavior includes child_process shell execution, rm -rf deletion, filesystem access to agent registries, local port probing, and a hardcoded OpenClaw token that is not disclosed in the description. Hardcoded credentials combined with privileged local operations materially increase the risk of unauthorized access, command misuse, and irreversible modification or deletion of local agent data.

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
99% confidence
Finding

path-to-regexp 0.1.12 is a transitive dependency of Express routing and is associated with a Regular Expression Denial of Service issue. In a network-facing multi-agent management platform, attacker-controlled request paths can hit route matching logic repeatedly, potentially causing excessive CPU consumption and service degradation or outage.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The server exposes host-side shell execution through exec(), and that capability is later used on request-driven data in the chat flow. Even though the message escapes double quotes and newlines, invoking a shell for normal application logic greatly increases the attack surface and creates command-injection and privilege-boundary risk if any parameter handling is bypassed or extended later.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The delete endpoint performs filesystem deletion by invoking rm -rf through a shell, giving a web request destructive host-level power. If path handling or identifier validation is ever weakened, this can become arbitrary file deletion; even as written, it is an unnecessarily dangerous primitive for a web-facing management UI.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The DELETE endpoint accepts an untrusted path parameter and ultimately feeds the derived path into a shell command: rm -rf "${agentDir}". Because path.join does not prevent traversal and quoted shell strings still permit command substitution such as $(...), an attacker can supply a crafted id to delete arbitrary directories or potentially achieve command execution. In the context of an agent-management platform handling local workspaces, this is especially dangerous because it operates on sensitive directories under the user's home directory.

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 explicitly shows how to extract an Operator Token from a local file, but does not warn that this token is a sensitive credential or instruct users on secure handling. In the context of an agent management platform that centralizes access to multiple agents, disclosure or careless reuse of this token could allow unauthorized control of the OpenClaw gateway and downstream agent actions.

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
91% confidence
Finding

This is a markdown file, so SQP-2 applies to missing user-facing warnings about behaviors that can affect user data or system integrity. The guide shows both CLI deletion and later API deletion usage, but does not disclose whether deleting an Agent also removes its directory, configuration, or registration data, which could surprise users.

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 markdown includes a DELETE request for removing an Agent, which is a destructive operation affecting managed resources. There is no adjacent warning about consequences to user data, persistence, or reversibility, so users are not clearly informed before using the endpoint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

For markdown files, SQP-2 covers omitted warnings about privacy-sensitive behaviors. The guide instructs users to place an operator token in config.json but does not warn them to keep the token secret, avoid committing it, or protect file permissions, which is important for credential safety.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The markdown file lists '删除/停用 Agent' as a feature, which includes a destructive action affecting user-managed agent data or configuration. There is no accompanying warning, confirmation note, or explanation of permanence anywhere in the README, so users are not alerted to the impact on their data or system state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The DELETE /api/agents/:id endpoint is presented as a normal API action with no warning about what is removed, whether related workspace/pairing state is also deleted, or whether the action can be undone. For markdown files, omission of warnings about behaviors affecting user data or system integrity should be flagged.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The README includes a real-looking bearer token in plaintext configuration instructions, which creates a strong risk of credential leakage and accidental reuse. If the token is valid or copied by users into real deployments, an attacker could access the OpenClaw gateway or associated agent-management functions.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises and appears to rely on capabilities such as shell, network, and environment access, but the manifest does not declare any tool scope or permissions. This creates a transparency and least-privilege problem: users and platforms cannot accurately assess or constrain what the skill may do before execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill states that chat history is auto-saved and data is stored locally in the browser, but it does not clearly warn that conversation contents and uploaded images may persist on the device. This can expose sensitive user data to other local users, browser compromise, or accidental retention beyond the user's expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Nearly all help text, prompts, and status messages are hard-coded in Chinese, which imposes a specific language on users without opt-in. This is a natural-language policy concern because the tool does not provide any language selection or justification for the locale restriction.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The code builds a shell command string containing JSON body data and executes it with execSync. Because the JSON is wrapped in single quotes for the shell, attacker-controlled input containing a single quote can break out of the quoted argument and inject arbitrary shell commands, leading to local command execution when creating agents or sending chat messages.

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
96% confidence
Finding

This second helper repeats the same unsafe pattern: it interpolates untrusted request body data into a shell command and runs it under zsh. In this CLI, user-supplied fields such as agent name, description, model, and chat message can be crafted to terminate the quoted -d payload and execute arbitrary commands on the host.

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
93% confidence
Finding

The delete command issues a DELETE request and removes an agent after only checking that an ID was provided. While it logs that deletion is happening, there is no confirmation prompt or warning to the user before the irreversible action executes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

User chat content is sent over plain HTTP to localhost, which means message contents are unencrypted in transit. While localhost reduces remote interception risk, the skill context manages potentially sensitive multi-agent conversations, so local malware, hostile local proxies, container boundary crossings, or port forwarding could expose confidential prompts and responses.

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 chat history, including user messages and embedded image data URLs, in localStorage without any notice, consent, retention control, or sensitivity warning. In a multi-agent chat manager, users may share prompts, internal data, or screenshots, and localStorage is long-lived and readable by any script running in the same origin, increasing privacy and data exposure risk.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access, suspicious.install_untrusted_source

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
cli.js:13

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
register-existing.js:51

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
server-gemini.js:27

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
server.js:31

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
server-gemini.js:14

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
server.js:15

Install source points to URL shortener or raw IP.

Warn
Code
suspicious.install_untrusted_source
Location
config.json:2