Back to skill

Security audit

OpenClaw Mobile Gateway Installer

Security checks for vulnerabilities and agentic risk

Overview

This installer also runs a broad unauthenticated admin gateway that can expose secrets and change OpenClaw state, so it should be reviewed carefully before installation.

Install only in a tightly controlled environment after reviewing the backend. Do not expose port 4800 to untrusted networks; place it behind authentication, TLS, and firewall rules. Treat any configured OpenClaw, model-provider, and channel credentials as sensitive, and prefer rotating them if this service has already been reachable. Review the install and uninstall scripts because they create an autostarting system service and remove service/config/install directories.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
Findings (7)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
backend/src/app.ts:115
Finding

Unauthenticated Administrative API Exposed on All Network Interfaces

Content
View full analysis
{ res.json(listModels()); }); app.put("/api/models", async (req, res, next) => { try { const payload = parseRequest(modelSchema, req.body); const modelId = payload.modelId ?? payload.id; const nextModel = { ...payload, modelId, providerId: payload.providerId ?? payload.platform ?? "openai", platform: payload.platform ?? payload.providerId ?? "openai" }; res.json(await upsertModel(nextModel)); } catch (error) { next(error); } }); app.get("/api/channels", (_req, res) => { res.json(listChannels()); }); app.get("/api/memory/files", async (req, res, next) => { try { const query = parseRequest(memoryQuerySchema, req.query); res.json(await listMemoryFiles(query.agentId, query.category)); } catch (error) { next(error); } }); app.post("/api/services/control", (req, res) => { const payload = parseRequest(gatewayServiceControlSchema, req.body); res.json(controlGatewayService(payload.action)); }); } ``` ```ts const port = Number(process.env.PORT ?? 4800); const app = createApp(); app.listen(port, () => { console.log(`OpenClaw gateway running on http://localhost:${port}`); }); ``` ### Technical Analysis No authentication or authorization middleware is registered before the administrative routes. The `securityConfig.accessPasswordSet` setting is only stored as state and is not enforced by request middleware. Calling `app.listen(port)` without a host ...[truncated 1586 chars]
Remediation
View remediation
{ console.log(`Gateway listening on 127.0.0.1:${port}`); }); ``` 5. Require an explicitly configured secure deployment mode before binding to a non-loopback interface. 6. Place remote access behind an authenticated TLS reverse proxy and firewall port 4800 from untrusted networks. 7. Replace unrestricted `cors()` with a strict allowlist and reject requests with untrusted `Origin` headers. 8. Add rate limiting, request auditing, authorization tests, and alerts for configuration or service-control operations. 9. Remove application-level `sudo` fallbacks unless a narrowly scoped operational requirement has been documented and reviewed. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
backend/src/services.ts:90
Finding

Model API Keys and Channel Secrets Disclosed in Plaintext

Content
View full analysis
{ res.json(listModels()); }); app.get("/api/channels", (_req, res) => { res.json(listChannels()); }); ``` ### Technical Analysis The gateway reads model-provider API keys and channel application secrets from the OpenClaw runtime configuration and places the complete values in `ModelConfig` and `ChannelConfig` objects. The corresponding GET endpoints serialize those objects directly. No masking, response DTO, field omission, or authorization check protects these values. Consequently, possession of network access to the gateway is sufficient to retrieve credentials intended for ...[truncated 833 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
backend/src/services.ts:235
Finding

Server-Side Request Forgery and Sensitive Header Forwarding Through Mutable Targets

Content
View full analysis
{ const payload = parseRequest(openClawTargetUpdateSchema, req.body); const result = updateOpenClawTargetConfig(payload); return res.json(result); }); ``` ```ts const response = await fetch(`${target.apiBaseUrl}${healthPath}`, { method: "GET", headers: { ...authHeaders, ...(target.extraHeaders ?? {}) }, signal: AbortSignal.timeout(target.timeoutMs ?? 5000) }); ``` ```ts const response = await fetch(`${payload.target.apiBaseUrl}${endpoint}`, { method: "POST", headers: { "Content-Type": "application/json", ...(payload.target.gatewayToken ? { Authorization: `Bearer ${payload.target.gatewayToken}` } : {}), ...authHeaders, ...(payload.target.extraHeaders ?? {}) }, body: JSON.stringify({ model: payload.modelId, messages: payload.messages }), signal: AbortSignal.timeout(payload.target.timeoutMs ?? 2500) }); ``` ### Technical Analysis The URL schema verifies only that `apiBaseUrl` has URL syntax. It does not restrict protocols to HTTPS, enforce trusted hostnames, reject loopback or private address ranges, prevent DNS rebinding, or control redirects. A caller can modify an existing target and then cause the server to issue requests through the pro ...[truncated 1443 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
backend/src/app.ts:251
Finding

Unauthenticated Persistent Agent Memory Poisoning

Content
View full analysis
{ try { const query = parseRequest(memoryQuerySchema, req.query); res.json(await listMemoryFiles(query.agentId, query.category)); } catch (error) { next(error); } }); app.put("/api/memory/files", async (req, res, next) => { try { const payload = parseRequest(memoryUpsertSchema, req.body); res.json(await upsertMemoryFile(payload)); } catch (error) { next(error); } }); app.delete("/api/memory/files", async (req, res, next) => { try { const query = parseRequest(memoryDeleteSchema, req.query); res.json(await deleteMemoryFile(query)); } catch (error) { next(error); } }); ``` ```ts export async function upsertMemoryFile(payload: { agentId: string; category: string; fileName: string; content: string; }): Promise { const safeAgentId = safeSegment(payload.agentId); const safeCategory = safeSegment(payload.category); const safeFileName = safeSegment(payload.fileName).endsWith(".md") ? safeSegment(payload.fileName) : `${safeSegment(payload.fileName)}.md`; const dir = path.join(memoryDir, safeAgentId, safeCategory); await fs.mkdir(dir, { recursive: true }); const filePath = path.join(dir, safeFileName); await fs.writeFile(filePath, payload.content, "utf-8"); const stat = await fs.stat(filePath); return { agentId: safeAgentId, category: safeCategory, fileName: safeFileName, content: payload.content, updatedAt: stat.mtime.toISOString() }; } ``` ### Technical Analysis The filename components are sanitized, which limits straightforward path traversal, but there is no identity, ownership, authorization, approval, or content-trust boundary. Any rea ...[truncated 1234 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
backend/src/services.ts:993
Finding

Path Traversal in Markdown File Update Endpoint

Content
View full analysis
{ try { const payload = parseRequest(markdownUpdateSchema, req.body); const result = await updateMarkdownFile(payload.fileName, payload.content); res.json(result); } catch (error) { next(error); } }); ``` ```ts export async function updateMarkdownFile( fileName: string, content: string ): Promise { await fs.mkdir(markdownDir, { recursive: true }); await fs.writeFile(path.join(markdownDir, fileName), content, "utf-8"); return { fileName, content }; } ``` ### Technical Analysis Validation requires only that the supplied string end in `.md`. It does not reject absolute paths, path separators, or `..` components. `path.join(markdownDir, fileName)` normalizes traversal components and can produce a path outside `markdownDir`. The endpoint is also unauthenticated. A remote client can therefore overwrite any `.md` file reachable with the service account's filesystem permissions, provided that parent directories exist or are otherwise writable. ### Attack Path 1. The attacker determines or guesses the relative location of a writable Markdown file. 2. The attacker sends a PUT request to `/api/md-files`. 3. The request uses a filename such as `../../skills/example/SKILL.md`. 4. The schema accepts the value because it ends in `.md`. 5. `path.join` resolves the traversal outside the intended Markdown directory. 6. `fs.writeFile` replaces or creates the selected Markdown file with attacker-controlled content. 7. If the overwritten file is later loaded as an instruction, S ...[truncated 479 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
install.sh:46
Finding

Upstream Authentication Token Stored in a Potentially World-Readable Environment File

Content
View full analysis
/dev/null <
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
install.sh:42
Finding

Unpinned and Non-Reproducible Dependency Installation

Content
View full analysis
/dev/null npm install --omit=optional popd >/dev/null ``` ```json { "dependencies": { "cors": "^2.8.5", "express": "^4.19.2", "zod": "^3.23.8" }, "devDependencies": { "@types/cors": "^2.8.17", "@types/express": "^4.17.21", "@types/jest": "^29.5.12", "@types/node": "^20.14.12", "@types/supertest": "^6.0.2", "jest": "^29.7.0", "supertest": "^7.0.0", "ts-jest": "^29.1.5", "tsx": "^4.16.2", "typescript": "^5.5.4" } } ``` ### Technical Analysis The project does not include a lockfile, uses caret version ranges, and runs `npm install` during system installation. This allows dependency versions to change between otherwise identical installations. NPM lifecycle scripts are not disabled, so scripts supplied by resolved packages can execute under the selected service user's account. `--omit=optional` does not omit development dependencies. The production systemd unit directly starts `tsx` from `node_modules`, making a development tool part of the production execution chain and expanding the dependency attack surface. No evidence shows that a currently declared package is malicious. The confirmed issue is the unsafe and non-reproducible installation process, which increases exposure to future package compromise or registry manipulation. ### Attack Path 1. A dependency account, transitive package, or configured NPM registry is compromised, or a permitted version range resolves to a malicious release. 2. A user runs `install.sh`. 3. `npm install` resolves the current package graph rather than a reviewed locked graph. 4. A malicious package lifecycle script executes during installation, or malicious package code is ...[truncated 608 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (74)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description suggests a narrowly scoped skill for one-command deployment and lifecycle management of the OpenClaw mobile gateway as a system service. The code does include some related capabilities, such as service status/control, gateway restart, OpenClaw update, uninstall, logs, and target probing. However, its primary behavior is much broader: it exposes a comprehensive administrative backend API covering chat operations, assistant sessions, OpenClaw target resolution, CRUD for models/skills/channels/agents, memory and markdown file management, cron scheduling, websocket messaging, routing, heal workflows, security/settings, and usage statistics. These are materially undeclared capabilities and indicate the skill is not just a service installer/manager but a full admin/control plane backend.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says this skill installs and manages OpenClaw as a system service and supports lifecycle actions like deploy, start, stop, upgrade, and uninstall. The provided code does not implement any of those behaviors. It simply initializes the app and starts listening on a port, which is consistent with running a web server but not with system service management or installation. This is a material mismatch in primary purpose and capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied code does not implement installation or service-management logic for OpenClaw. Instead, it provides input-validation schemas for a broad backend application. Although a small subset references gateway service control and logs, the overall code chunk’s primary behavior is schema definition for many unrelated backend features, not one-command deploy/start/stop/upgrade/uninstall of a system service. This is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description suggests a narrowly scoped skill for one-command deployment and service lifecycle management of the OpenClaw mobile gateway. While the code does include some related pieces—checking systemd service status, starting/stopping/restarting the openclaw-mobile-gateway service, reading logs, and a mock uninstall/update timestamp—it is not primarily an installer/service-manager implementation. There is no real deployment flow, no actual install routine for the service, and uninstall/upgrade behavior is mostly simulated or limited to state/config updates. Instead, most of the code implements a comprehensive backend/admin API for OpenClaw: configuration management, skill/model/channel/agent CRUD, chat proxying, token accounting, markdown/memory file storage, routing/healing, websocket sessions, and mobile app update policy. These are materially broader and different capabilities than the declared purpose, so this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill installs and manages the OpenClaw mobile gateway as a system service. However, the supplied code chunk is a TypeScript store/config module exporting static configuration objects and arrays plus a small seed function for token usage records. There are no commands, process control, service unit operations, package installation steps, upgrade/uninstall routines, or trigger handling for gateway lifecycle management. Its primary purpose is backend configuration/state definition for models, channels, routing strategies, heal policies, app updates, security, agents, and communication behavior, which is materially different from the declared operational service-management purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description presents an operational system-service management skill for OpenClaw gateway deployment and lifecycle actions. However, the supplied code is purely a type definition file for many backend application entities. While a few interfaces mention gateway/service status, there is no executable logic for managing a system service. The primary purpose of this code chunk is schema/type modeling for a backend platform, not gateway installation or service control. This is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose is system-service lifecycle management for OpenClaw, but the supplied code chunk does not perform any of those actions. It merely creates IDs using a prefix, timestamp, and random string. This is a materially different primary purpose and appears unrelated to the described skill behavior, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents this skill as a one-command installer and manager for the OpenClaw mobile gateway system service. However, the provided code only checks the current status of an existing service, verifies a listening port, and calls local health/API endpoints. That is a monitoring/verification script, not an installation or management implementation. While checking status can support service management, it does not match the primary declared purpose of deploy/start/stop/upgrade/uninstall, so this is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This file exposes a very broad administrative API surface that goes far beyond the declared purpose of installing and managing the OpenClaw mobile gateway service. In a skill context, that scope expansion is dangerous because it enables unrelated data management, messaging, configuration changes, and system actions that increase attack surface and violate least privilege.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Chat and assistant messaging endpoints are unrelated to a gateway installer/service-management skill and create an unjustified capability to send content to backend targets. That broadens the blast radius from service administration into message proxying and remote interaction, which could be abused for unauthorized data exchange or lateral operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The gateway restart endpoint triggers a system-level action immediately with no visible confirmation or safety gate in this file. That makes accidental invocation or abuse capable of causing service disruption and denial of service for users depending on the gateway.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

The system update endpoint applies an update action directly from request input without any visible warning, approval step, or compatibility safeguards in this file. Uncontrolled update execution can lead to unexpected code changes, outages, or rollback difficulties if triggered accidentally or by an unauthorized caller.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This module substantially exceeds the declared scope of a gateway installer/manager by implementing chat proxying, content management, routing, telemetry, updates, and configuration mutation. That mismatch increases attack surface and creates capability creep: a user invoking an installer skill could unintentionally grant a broad administrative control plane over models, channels, secrets, files, and runtime behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code sends arbitrary user/assistant messages and credentials to configurable remote endpoints via fetch, effectively acting as a chat proxy unrelated to gateway installation. In the context of an installer skill, this is dangerous because it can exfiltrate prompts, secrets, and operational metadata to attacker-controlled targets under the guise of service management.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · uninstall.sh (reported line 9)May include surrounding context.

sh
sudo systemctl stop "${SERVICE_NAME}" 2>/dev/null || true
sudo systemctl disable "${SERVICE_NAME}" 2>/dev/null || true
sudo rm -f "/etc/systemd/system/${SERVICE_NAME}.service"
sudo systemctl daemon-reload
sudo rm -rf /etc/openclaw-mobile-gateway
sudo rm -rf "${INSTALL_DIR}"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · uninstall.sh (reported line 11)May include surrounding context.

sh
sudo systemctl disable "${SERVICE_NAME}" 2>/dev/null || true
sudo rm -f "/etc/systemd/system/${SERVICE_NAME}.service"
sudo systemctl daemon-reload
sudo rm -rf /etc/openclaw-mobile-gateway
sudo rm -rf "${INSTALL_DIR}"

echo "Uninstalled ${SERVICE_NAME}."

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · uninstall.sh (reported line 11)May include surrounding context.

sh
sudo systemctl disable "${SERVICE_NAME}" 2>/dev/null || true
sudo rm -f "/etc/systemd/system/${SERVICE_NAME}.service"
sudo systemctl daemon-reload
sudo rm -rf /etc/openclaw-mobile-gateway
sudo rm -rf "${INSTALL_DIR}"

echo "Uninstalled ${SERVICE_NAME}."

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README instructs operators to export a bearer token into their shell environment and immediately execute an installation script that performs system changes, but provides no warning about secret exposure, privilege requirements, or review of the script before execution. In practice, environment variables can be exposed through shell history, process inspection, logs, or inherited subprocesses, and combining secret handling with one-command install increases the chance of accidental credential leakage or unsafe deployment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The uninstall command is presented as a simple one-liner with no notice that it may stop services, remove files, or alter system configuration. This creates a real risk of accidental destructive action by users who may not understand the operational impact or whether the removal is reversible.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises shell, environment-variable, and network-driven installation behavior but does not declare any explicit tool scope or permissions. For an installer that can modify system services and consume secrets from environment variables, missing scope boundaries increases the risk of over-broad execution and weak user consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill describes one-command installation, service registration, auto-start, and uninstall, but does not clearly warn that it will make persistent system-level changes and that uninstall may be destructive. In an agent context, weak disclosure can lead users to approve privileged actions without understanding service, filesystem, or startup impacts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation tells users to export a bearer token in an environment variable without any warning about secret handling, shell history, process exposure, or log leakage. Because this is an installer skill that may call shell commands and system services, poor token-handling guidance can expose credentials to other users, scripts, or telemetry.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file manages agents, memory files, cron jobs, websocket chat sessions, and assistant sessions—objects unrelated to installing or controlling the gateway service. Combining these capabilities in one skill violates separation of duties and gives the skill unnecessary authority over application state and automation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The uninstall endpoint performs a destructive action immediately and this file shows no confirmation, warning, or safety interlock before removal. In a one-command administrative surface, that increases the risk of accidental or unauthorized service removal with operational impact.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The markdown update endpoint writes user-supplied content to files, yet this file provides no indication of user disclosure, path restriction details, or review workflow. In an admin backend, file-writing primitives are risky because they can modify application content or potentially enable stored content injection depending on how the files are later rendered or used.

Content

No source excerpt is available for this finding.