Agent can self-modify openclaw.json to bypass auth and CORS controls
Summary
An AI agent running inside the NemoClaw sandbox can modify openclaw.json to weaken its own security controls. This was publicly reported by @ZackKorman on X on 2026-03-20 (1.7K views).
Attack chain
- Agent uses its standard
write/edit/exectools to modify/sandbox/.openclaw/openclaw.json - Changes
gateway.auth.tokento a trivial value (e.g."123") - Changes
gateway.controlUi.allowedOriginsto["*"] - Restarts the gateway via
exec - Result: any website the user visits can now connect to their bot via websocket and issue commands
Root cause
openclaw.json is inside the /sandbox read_write zone defined in nemoclaw-blueprint/policies/openclaw-sandbox.yaml (line 29), and no tool-level deny list prevents the agent from writing to it. After startup, the config file remains writable by the sandbox user.
Proposed fix (minimum)
After fix_openclaw_config completes in scripts/nemoclaw-start.sh, change ownership and permissions so the agent cannot modify the file:
chown root:root "$HOME/.openclaw/openclaw.json"
chmod 444 "$HOME/.openclaw/openclaw.json"
The gateway only needs read access after startup, and the agent process runs as sandbox user per the sandbox policy, so it cannot modify a root-owned read-only file.
Defense-in-depth (follow-up)
- Add
.openclaw/paths toSandboxToolPolicy.denyfor write/edit/exec tools - Move config outside
/sandboxwritable zone to a read-only mount - Change Landlock from
best_efforttoenforce - Re-evaluate
allowInsecureAuth: TrueanddangerouslyDisableDeviceAuth: Truedefaults
problem with this implementation is that any change we (users) do, be it changing model /enabling channels gets rejected because root takes ownership, and the fact there is no reliable persistence of sandboxes makes it terrible to work with having to restart from scratch modt times