Back to skill

Security audit

Agent Manager

Security checks for vulnerabilities and agentic risk

Overview

This is a real OpenClaw agent manager, but it exposes high-impact unauthenticated APIs that run shell commands, delete files, and include a plaintext token, so it should be reviewed before installation.

Install only in a tightly controlled local environment after removing and rotating the exposed token, adding authentication, binding the server to 127.0.0.1, replacing shell exec/rm -rf with safe Node APIs or argument-array subprocess calls, validating paths and IDs, and updating vulnerable dependencies. Do not expose port 3000 to a network or run this against important OpenClaw data until those issues are fixed.

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:173
Finding

Shell Command Injection in Agent Chat and Deletion Endpoints

Content
View full analysis
{ exec(cmd, { shell: 'zsh' }, (error, stdout, stderr) => { if (error) reject(error); else resolve({ stdout, stderr }); }); }); } ``` ```javascript const agentId = id.replace('agent-', ''); const workspace = agentConfig?.workspace || `workspace-${agentId}`; const workspacePath = path.join(CONFIG.workspaceDir, workspace); // Check whether the workspace exists try { await fs.access(workspacePath); } catch (e) { return res.status(404).json({ success: false, error: `Agent 工作区不存在:${workspacePath}` }); } const safeMessage = message.replace(/"/g, '\\"').replace(/\n/g, ' '); const { stdout } = await execCmd( `cd "${workspacePath}" && openclaw agent --agent ${agentId} --message "${safeMessage}" --json 2>&1` ); ``` ```javascript 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 不存在' }); } await execCmd(`rm -rf "${agentDir}"`); ``` ### Technical Analysis The application constructs Zsh command strings containing request-controlled Agent IDs, workspace values, and chat messages. Replacing double quotes and newlines is not valid shell escaping. Shell expressions such as command substitution remain active inside double quotes, while `agentId` is inserted without shell quoting. The deletion endpoint similarly passes a request-derived path to `rm -rf` through a shell. Path ...[truncated 1171 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
server.js:24
Finding

Unauthenticated Network Access to Privileged Agent Management APIs

Content
View full analysis
{ // Creates files and registers an Agent under ~/.openclaw }); ``` ```javascript app.post('/api/agents/:id/chat', async (req, res) => { // Invokes the OpenClaw Agent command }); ``` ```javascript app.delete('/api/agents/:id', async (req, res) => { // Recursively deletes an Agent directory }); ``` ```javascript app.listen(PORT, () => { console.log(`🚀 Agent Manager 运行在 http://localhost:${PORT}`); console.log(`📡 API 端点:http://localhost:${PORT}/api`); }); ``` ### Technical Analysis No authentication or authorization middleware protects Agent enumeration, creation, chat execution, or deletion. The default `cors()` configuration permits arbitrary web origins to issue readable cross-origin requests. Calling `app.listen(PORT)` without a host does not enforce loopback-only access. Although console output and documentation describe the service as localhost-based, the implementation does not explicitly bind it to `127.0.0.1`. The exposed operations are privileged because they modify `~/.openclaw`, execute the OpenClaw CLI, and recursively delete Agent directories. ### Attack Path 1. The user starts either documented server. 2. A malicious website, local process, container, or reachable network client connects to port 3000. 3. The attacker calls `GET /api/agents` to enumerate configured Agents. 4. The attacker calls `POST /api/agents`, `POST /api/agents/:id/chat`, or `DELETE /api/agents/:id`. 5. The server performs the operation without verifying the caller's identity or authority. 6. Permissive CORS allows a m ...[truncated 450 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
server.js:90
Finding

Path Traversal in Agent File Creation, Workspace Selection, and Recursive Deletion

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
server.js:18
Finding

Plaintext OpenClaw Operator Token Committed to Source and Documentation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
index.html:287
Finding

Stored Cross-Site Scripting Through Agent Metadata

Content
View full analysis
暂无 Agent'; return; } let html = ''; for (let i = 0; i < agents.length; i++) { const agent = agents[i]; const key = agent.id.replace('agent-', ''); const emoji = agentEmojis[key] || '🤖'; const active = agent.id === currentAgentId ? 'active' : ''; html += '
'; html += '
'; html += '' + emoji + '' + agent.name; html += '
'; html += '
' + (agent.description || '') + '
'; html += '
'; } listEl.innerHTML = html; ``` Additional unescaped metadata is used when rendering history: ```javascript const msgAgentName = m.agentName || agent.name; const msgAgentEmoji = m.agentEmoji || emoji; const header = m.type === 'user' ? '你' : (msgAgentEmoji + ' ' + msgAgentName); html += '
'; html += '
' + header + '
'; html += '
' + escapeHtml(m.content) + '
'; html += imgHtml; html += '
' + m.time + '
'; html += '
'; chatMessages.innerHTML = html; ``` ### Technical Analysis Agent IDs, n ...[truncated 1396 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
cli.js:41
Finding

Local Shell Injection in CLI and Registration HTTP Wrappers

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
package-lock.json:19
Finding

Dependencies Locked to a Third-Party Package Registry 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 (58)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The finding reports hardcoded authentication material and undisclosed execution of shell/OpenClaw commands alongside local probing. Hardcoded tokens are especially dangerous because they can leak credentials, enable unauthorized agent operations, and indicate poor secret-handling practices; combined with misleading documentation, this significantly raises the risk profile.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The finding reports hardcoded authentication material and undisclosed execution of shell/OpenClaw commands alongside local probing. Hardcoded tokens are especially dangerous because they can leak credentials, enable unauthorized agent operations, and indicate poor secret-handling practices; combined with misleading documentation, this significantly raises the risk profile.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The finding reports hardcoded authentication material and undisclosed execution of shell/OpenClaw commands alongside local probing. Hardcoded tokens are especially dangerous because they can leak credentials, enable unauthorized agent operations, and indicate poor secret-handling practices; combined with misleading documentation, this significantly raises the risk profile.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The finding reports hardcoded authentication material and undisclosed execution of shell/OpenClaw commands alongside local probing. Hardcoded tokens are especially dangerous because they can leak credentials, enable unauthorized agent operations, and indicate poor secret-handling practices; combined with misleading documentation, this significantly raises the risk profile.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
在 `server-gemini.js` 中,使用参数化命令:

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

path-to-regexp 0.1.12 is a transitive dependency of express routing, and the cited CVE describes Regular Expression Denial of Service. In a network-facing multi-agent management platform with chat and upload features, attacker-controlled paths or route matching can turn this into a practical remote service exhaustion issue.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The server exposes a generic shell execution helper using child_process.exec with a real shell (zsh), and later uses it on request-derived data in chat and deletion flows. In an agent-management web service, this creates an unnecessary command-invocation surface where quoting mistakes, future code changes, or path/id manipulation can turn into command injection or unintended command execution.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Agent deletion is performed by constructing and running rm -rf through the shell. Even though the path is quoted, invoking destructive filesystem operations via a shell is unnecessarily dangerous in a network-exposed management service and increases the blast radius of any path-validation failure or future injection bug.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

A destructive delete endpoint removes agent data immediately with no authentication, confirmation token, or safety interlock visible in the server code. In a management UI context, silent irreversible deletion increases the risk of accidental or unauthorized data loss, especially because CORS is enabled and the endpoint is network accessible.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

A hard-coded OpenClaw token is embedded directly in source code, making it recoverable by anyone with access to the skill package, repository, logs, or backups. If valid, the token could enable unauthorized access to internal OpenClaw services or agent operations, and the skill context increases risk because this server is explicitly designed to manage agents and workspaces.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

The API accepts attacker-controlled agent IDs and feeds them into shell-based operations, especially in the delete flow using execCmd(rm -rf "${agentDir}") and in chat flow via shell command construction. Because path components derived from route parameters can include traversal sequences and shell metacharacters may not be safely handled by manual quoting, an attacker may delete arbitrary directories or execute unintended commands, which is especially severe in a local agent/workspace management service.

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

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The deletion endpoint performs irreversible filesystem removal of an agent directory with no authentication, authorization, CSRF protection, or server-side safety checks. In this management-skill context, exposing destructive operations over a broadly accessible API makes unauthorized data loss much more dangerous than a mere missing confirmation dialog.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document instructs users to extract an Operator Token from a local credential store and place it into a plain config.json file, but it does not warn that this token is sensitive or describe secure handling practices. This increases the risk of credential leakage through source control, backups, screenshots, shared skill bundles, or local file disclosure, which could allow unauthorized access to the OpenClaw gateway as the operator.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file documents agent deletion as a feature, but it does not warn that deleting an agent may remove its registration and associated workspace data or otherwise be irreversible. Under the markdown-specific warning rule, destructive behaviors that can affect user data should be clearly disclosed.

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

The quickstart presents node cli.js delete agent-judy as a normal usage example, but gives no warning that it performs a destructive action. In markdown documentation, commands that may delete user-managed resources should include a clear caution about consequences.

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

The DELETE endpoint example documents a destructive operation but omits any warning about its effect on user data or system state. Markdown guidance should disclose potentially harmful actions so users understand the impact before invoking them.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

Nearly all user-facing documentation in this file is presented in Chinese, and the skill does not indicate that users may choose another language or that the locale restriction is intentional and justified. This can violate language/locale policy when a specific language is imposed without user opt-in.

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 advertises a delete/deactivate capability, but it does not include any warning that the action may be destructive or irreversible. Under the markdown-specific warning rule, user-facing documentation should disclose behaviors that can affect user data or system integrity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The API section exposes a DELETE operation for /api/agents/:id, but the documentation provides no caution about its destructive nature. For markdown files, operations affecting user data or managed resources should include a clear warning so users understand the potential impact.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README includes a concrete OpenClaw token directly in the example configuration, which trains users to embed live credentials in a local file and risks accidental reuse of a real secret. Even if intended as a sample, hardcoded tokens are commonly copied into deployments, committed to repos, or exposed via screenshots and support logs, enabling unauthorized access to the gateway.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares no explicit tool scope or permissions even though the documentation indicates capabilities involving shell execution, local filesystem access, environment/config access, and likely network/local API interaction. This is dangerous because users and platforms cannot accurately assess or constrain what the skill may do, increasing the risk of over-privileged execution and unexpected access to sensitive local OpenClaw data.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The claimed shell-execution fix is not actually safe: it still uses child_process.exec with a shell command string that interpolates agentId. If agentId can be influenced by a user or external input, this can lead to command injection and arbitrary command execution on the host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation instructs users to print the Operator token directly from a local file without emphasizing that it is a sensitive credential. This increases the chance of accidental disclosure through terminal history, screenshots, logs, copy/paste into chats, or shoulder surfing, potentially enabling unauthorized access to OpenClaw operations.

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