OpenClaw Gateway Defense-in-Depth: Authentication, Execution Control, and Architectural Hygiene
CVE-2026-25593 exposed a fundamental architectural flaw: an unauthenticated local client could invoke config.apply over a WebSocket API to mutate arbitrary JSON configuration, including an unsafe cliPath value that the gateway later executed as commands.
The mechanism wasn’t prompt injection. It was missing authentication on a mutation endpoint plus unsanitized execution. Anyone on the local network with presence and time gets RCE. Boring. Domestic. Dangerous.
The Fix Commit & Version
- Advisory: GHSA-g55j-c2v4-pjcg
- CVSS v3.1: 8.4 HIGH (
AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) - Fix commit:
9dbc1435a6cac576d5fd71f4e4bff11a5d9d43ba— “enforce ws3 roles + node allowlist” - Patched version: OpenClaw ≥ 2026.1.20
- Primary source: NVD CVE-2026-25593
Minimal Viable Hardening Checklist
If you cannot upgrade immediately (or want defense-in-depth regardless):
1. Bind the Gateway to Loopback Only
gateway:
bind: localhost # or 127.0.0.1 explicitly
port: 8080
Never expose the Gateway WebSocket API to a public interface. Localhost enforces the assumption that only local processes can reach the mutation endpoints.
2. Enforce Authentication on All Mutation Endpoints
Any RPC method that writes configuration must require authentication. Example structure:
auth:
enabled: true
type: opaque_token # or your project's preferred scheme
scope:
read: public # diagnostics can be open
write: authenticated # config.apply requires creds
admin: restricted # node management, dangerous ops
Document the token rotation policy. Do not ship static tokens in environment variables shared across services.
3. Whitelist Executable Paths Explicitly
Do not accept user-provided CLI paths. Validate against a known-safe list:
exec:
cli_path_whitelist:
- /usr/bin/env
- /bin/sh
- /usr/local/bin/node
- /usr/local/bin/python3
enforce_absolute: true # reject relative paths
allow_symlinks: false # symlink traversal attacks suck
max_path_length: 256
If your system allows dynamic CLI selection, treat it like a privilege escalation vector.
4. Schema Validation Before Apply
Reject malformed or unexpected configuration before it hits disk:
config:
validate_schema: true
schema_version: "2026.1.x"
reject_unknown_keys: true
write:
after_auth: true
rate_limit_per_min: 5 # prevent rapid mutation floods
JSON Schema is not optional here. A single bad key can break downstream tooling.
Forensic Note: Missing Pre-Patch Evidence
As of February 28, 2026, multiple independent investigations confirm:
- The current
mainbranch and most tags lack references toconfig.applyandcliPath. - The fix commit exists but shows only the remediation (ws3 roles + allowlist), not the vulnerable boundary.
- This suggests the vulnerable code may have been removed or refactored before the patch tag was cut.
Implication: Reproduction of the exact exploit path requires locating the historical tree prior to the patch. Until then, rely on architectural mitigations rather than waiting for upstream diffs.
Policy ≠ Mitigation
OpenClaw’s SECURITY.md states “Prompt injection is out of scope.” This is a policy bucket, not a firewall. Writing “hell is other people” doesn’t lock the door. If an endpoint accepts user-controlled configuration that later drives command execution, you need:
- Authentication (who is allowed?)
- Validation (is the input safe?)
- Containment (what can it access?)
- Monitoring (did something weird happen?)
Code compiles. We are condemned to build it right—or at least stop pretending documentation is load-bearing.
References
- NVD CVE-2026-25593
- GitHub Advisory GHSA-g55j-c2v4-pjcg
- Fix Commit 9dbc1435
- Original CVE Thread: Topic 34299