security-audit-command-reference.md

April 5, 2026 · View on GitHub

Navigation: Main Guide | Security Audit Reference | CVEs/GHSAs | Issue #1796 | Medium Article | ZeroLeeks | Post-merge Hardening | Open Issues | Open PRs | Ecosystem Threats | SecurityScorecard | Cisco AI Defense | Model Poisoning | Hudson Rock | Cline Supply Chain | ClawJacked | Model Comparison

openclaw security audit command reference

Source: src/cli/security-cli.ts:45-51, src/security/audit.ts:1380-1517, src/security/fix.ts:387-473, src/security/audit-extra.sync.ts, src/security/audit-extra.async.ts, src/security/audit-channel.ts

The built-in security audit scans your local config, filesystem permissions, and channel policies for common misconfigurations. It does not scan source code for vulnerabilities.

Command modes

CommandBehavior
openclaw security auditRead-only scan across config, filesystem, channels, models, plugins, hooks, gateway, browser, and exposure matrix checks. No live gateway network probe.
openclaw security audit --deepEverything above + static code-safety scan of installed plugins and skills (collectPluginsCodeSafetyFindings, collectInstalledSkillsCodeSafetyFindings); also maybeProbeGateway() connects to gateway WebSocket (5 s timeout), verifies auth, adds gateway.probe_failed if unreachable.
openclaw security audit --fixRuns fixSecurityFootguns() first, then full audit. Report reflects post-fix state. Also accepts --deep.
openclaw security audit --jsonAny mode above with JSON output instead of formatted text.

Quick-reference: Most common critical checks

This table summarizes the 18 checks most likely to affect real-world deployments. The full audit includes 70+ check IDs across 14 categories — see the Check categories table below for the complete list.

Check IDSeverityWhy it mattersPrimary fixAuto-fix?
fs.state_dir.*criticalWorld-readable config/credentials leak secretschmod 700 ~/.openclawYes (--fix)
fs.credentials_dir.*criticalOAuth tokens, bot tokens exposedchmod 700 ~/.openclaw/credentials/Yes (--fix)
gateway.bind_no_authcriticalNon-loopback bind without authenticationSet gateway.auth.mode: token or passwordNo
gateway.loopback_no_authcriticalLoopback bind but auth disabled (reverse-proxy/local trust risk)Set gateway.auth.mode: tokenNo
gateway.tailscale_funnelcriticalPublic internet exposure via Tailscale FunnelDisable Funnel, use Serve insteadNo
gateway.control_ui.insecure_authcriticalControl UI allows insecure HTTP auth fallbackDisable gateway.controlUi.allowInsecureAuth; prefer HTTPS or localhostNo
gateway.control_ui.device_auth_disabledcriticalDevice verification bypassedRemove dangerouslyDisableDeviceAuthNo
hooks.token_reuse_gateway_tokencriticalHook token same as gateway token (privilege escalation)Generate separate hook tokenNo
hooks.path_rootcriticalHook handler can access any pathSet hooks.path to specific directoryNo
hooks.request_session_key_enabledcriticalExternal hook payload can override session keyDisable hooks.allowRequestSessionKey (or constrain prefixes)No
browser.control_no_authcriticalBrowser control server has no authSet browser.control.auth: tokenNo
browser.remote_cdp_httpwarnRemote CDP uses HTTP (OK if tailnet-only or behind encrypted tunnel)Use HTTPS or restrict to tailnetNo
sandbox.dangerous_bind_mountcriticalContainer can access host filesystemRemove dangerous bind mountsNo
sandbox.dangerous_network_modecriticalContainer has full network accessUse bridge/none network modeNo
tools.elevated.allowFrom.*.wildcardcriticalAnyone can trigger elevated toolsReplace * with specific allowlistNo
security.exposure.open_groups_with_elevatedcriticalPublic groups + dangerous tools = exploitationClose groups or disable elevated toolsNo
channels.<provider>.dm.opencriticalAnyone can DM the bot on that channelSet dmPolicy: pairing or allowlistNo
logging.redact_offwarnSecrets visible in tool summariesSet logging.redactSensitive: toolsYes (--fix)

Tip: Run openclaw security audit --fix first to auto-resolve safe issues (file permissions, group policy, redaction). Then address remaining critical items manually.

Check categories (70+ check IDs)

#CategoryCheck ID prefixSeveritiesWhat it checks
1Attack surface summarysummary.attack_surfaceinfoCounts open groups, elevated tools, hooks (reports hooks.webhooks and hooks.internal as separate lines), browser control
2Synced foldersfs.synced_dirwarnState/config in iCloud, Dropbox, OneDrive, Google Drive
3Filesystem permissionsfs.state_dir.*, fs.config.*, fs.credentials_dir.*, fs.auth_profiles.*, fs.sessions_store.*, fs.log_file.*critical/warnWorld/group-writable dirs, world/group-readable config/credentials, symlink detection
4Config include filesfs.config_include.*critical/warnPermissions on included config files
5Gateway configurationgateway.bind_no_auth, gateway.loopback_no_auth, gateway.tailscale_funnel, gateway.tailscale_serve, gateway.control_ui.*, gateway.token_too_short, gateway.trusted_proxies_missing, gateway.trusted_proxy_auth, gateway.trusted_proxy_no_proxies, gateway.trusted_proxy_no_user_header, gateway.trusted_proxy_no_allowlist, gateway.auth_no_rate_limit, gateway.http.no_auth, gateway.http.session_key_override_enabled, gateway.tools_invoke_http.dangerous_allowcritical/warn/infoNon-loopback bind without auth, Tailscale Funnel public exposure, Control UI insecure auth/device auth, token length, missing trusted proxy, trusted-proxy mode hardening checks (missing proxy IPs/user-header/allowlist), auth brute-force protection (gateway.auth_no_rate_limit), and HTTP endpoint exposure: gateway.http.no_auth=warn/critical when auth.mode="none" (lists exposed HTTP endpoints; critical if remotely exposed); gateway.http.session_key_override_enabled=info; gateway.tools_invoke_http.dangerous_allow=warn/critical when gateway.tools.allow re-enables default-denied HTTP tools (sessions_spawn, sessions_send, gateway, whatsapp_login)
5aGateway nodesgateway.nodes.deny_commands_ineffectivewarndenyCommands has pattern-like or unknown entries that won't match (exact command-name matching only)
6Browser controlbrowser.remote_cdp_http, browser.control_invalid_config, browser.control_no_authcritical/warnRemote CDP over plain HTTP, invalid CDP config, and browser control server with auth disabled
7Logginglogging.redact_offwarnredactSensitive="off" leaks secrets in tool summaries
8Elevated toolstools.elevated.allowFrom.*.wildcard, tools.elevated.allowFrom.*.largecritical/warnWildcard "*" in elevated allowlist, oversized allowlist (>25 entries)
8aExec runtime / sandboxingtools.exec.host_sandbox_no_sandbox_defaults, tools.exec.host_sandbox_no_sandbox_agentswarnExec host sandbox not applied to default or agent profiles
8bSandbox configsandbox.docker_config_mode_off, sandbox.dangerous_bind_mount, sandbox.dangerous_network_mode, sandbox.dangerous_seccomp_profile, sandbox.dangerous_apparmor_profile, sandbox.bind_mount_non_absolutecritical/warnDocker config present but sandbox.mode=off; dangerous bind mounts, network modes, seccomp/apparmor profiles (critical); non-absolute bind mount path (warn)
8cTools profiletools.profile_minimal_overriddenwarnGlobal tools.profile=minimal overridden by an agent-level profile
9Hooks hardeninghooks.path_root, hooks.token_too_short, hooks.token_reuse_gateway_token, hooks.default_session_key_unset, hooks.request_session_key_enabled, hooks.request_session_key_prefixes_missingcritical/warnHooks base path is "/", short token (<24 chars), token reuses gateway token (critical as of Feb 19 2026 sync); session key unset (warn); request session key enabled or prefixes missing (critical if remotely exposed, warn otherwise)
10Model hygienemodels.legacy, models.weak_tier, models.small_paramscritical/warnLegacy models (GPT-3.5, Claude 2), weak tier (Haiku, pre-GPT-5), small models (<=300B params) without sandboxing exposed to web tools
11Config secretsconfig.secrets.gateway_password_in_config, config.secrets.hooks_token_in_configwarn/infoSecrets stored in config file instead of env vars
12Plugins/extensionsplugins.extensions_no_allowlist, plugins.tools_reachable_permissive_policy, plugins.installs_unpinned_npm_specs, plugins.installs_missing_integrity, plugins.installs_version_drift, hooks.installs_unpinned_npm_specs, hooks.installs_missing_integrity, hooks.installs_version_driftcritical/warnExtensions present but plugins.allow not configured; permissive tool reachability policy; unpinned/missing-integrity/version-drifted npm specs in plugin or hook installs
13Channel securitychannels.discord.*, channels.slack.*, channels.telegram.*, channels.*.dm.*critical/warn/infoDM policies (open/disabled/scoped), group policies, slash command restrictions, sender allowlists, multi-user DM session isolation
14Exposure matrixsecurity.exposure.open_groups_with_elevatedcriticalDangerous combination: open groupPolicy + elevated tools enabled
Deep probegateway.probe_failedwarn--deep only: gateway WebSocket unreachable or auth failed
Plugin/skill code safetyplugins.code_safety.*, skills.code_safety.*critical/warn--deep only: static pattern scan of installed plugin/skill JS/TS/JSON for dangerous patterns; entry_escape=critical, entry_path/scan_failed=warn

What --fix applies (src/security/fix.ts:387-473)

Config changes (applyConfigFixes, line 276):

  • logging.redactSensitive: "off""tools" (prevents secrets in tool summaries)
  • groupPolicy: "open""allowlist" for all 7 supported channels (telegram, whatsapp, discord, signal, imessage, slack, msteams), including per-account overrides
  • WhatsApp groupAllowFrom: populated from pairing store when policy flipped (so existing paired contacts still work)

Filesystem hardening (chmod/icacls):

TargetModePurpose
~/.openclaw/ (state dir)700User-only access to all state
Config file600User-only read/write (contains tokens)
Config include files600Same protection for split configs
~/.openclaw/credentials/700OAuth credential directory
credentials/*.json600Individual credential files
agents/<id>/agent/700Per-agent directory
agents/<id>/agent/auth-profiles.json600API keys and tokens
agents/<id>/sessions/700Session transcript directory
agents/<id>/sessions/sessions.json600Session metadata
agents/<id>/sessions/*.jsonl600Session transcript files

On Windows: uses icacls ACL reset instead of chmod.

--fix skips symlinks, missing paths, and already-correct permissions (safe + idempotent).

Coverage vs documented security issues

The audit is a configuration and filesystem hardening tool. It detects misconfigurations but not code-level vulnerabilities.

Issues the audit detects or mitigates

IssueSeverityWhat the audit catchesCheck ID
#9065LOW~/.openclaw group-writable after sudo installfs.state_dir.perms_group_writable (--fix applies chmod 700)
#7862MEDIUMSession transcripts 644 instead of 600fs.sessions_store.perms_readable (--fix applies chmod 600)
#9627HIGHConfig secrets exposed in JSONconfig.secrets.gateway_password_in_config (warns; recommends env var)
#6609HIGHBrowser bridge server optional authbrowser.control_invalid_config, browser.control_no_auth
General gateway exposureNon-loopback bind, missing auth, Tailscale Funnelgateway.bind_no_auth, gateway.loopback_no_auth, gateway.tailscale_funnel
Channel misconfigurationOpen DMs, open groups, missing allowlistsAll channels.* checks + security.exposure.open_groups_with_elevated

Note: The audit does not scan workspace bootstrap .md files (MEMORY.md, SOUL.md, AGENTS.md, TOOLS.md, IDENTITY.md, USER.md, HEARTBEAT.md, BOOTSTRAP.md, memory.md) or memory/*.md for prompt injection content. The bootstrap files are injected into the system prompt as trusted context with no content validation. Memory directory files (memory/*.md) go through a separate tool-call pipeline but are also unscanned. See Cisco AI Defense gap analysis.

Issues the audit cannot detect (code-level bugs)

IssueSeverityWhy the audit cannot detect it
#8512CRITICALPlugin HTTP routes bypass — code-level auth gap in src/gateway/server/plugins-http.ts
#3277HIGHPath traversal via startsWith — code-level validation bug
#4950HIGHBrowser evaluate default on — hardcoded constant, not configurable
#5052HIGHConfig validation fail-open — code-level bug in src/config/io.ts
#5255HIGHBrowser file upload arbitrary read — code-level
#8516HIGHBrowser download/trace arbitrary file write — code-level
#8586HIGHConfigurable exec bypass — code-level allowlist gap
#8590HIGHStatus endpoint info leak — code-level
#8591HIGHEnv vars exposed via shell — code-level
#8776HIGHsoul-evil hook hijacking — code-level
#9435HIGH FIXEDGateway token in URL query params — fixed in PR #9436
#9512HIGHSkill archive path traversal (Zip Slip) — code-level
#9517HIGHCanvas host auth bypass — code-level
#8696HIGHPlaywright download path traversal — code-level
#4949HIGHBrowser DNS rebinding — code-level (no Host header validation)
#4995HIGHiMessage DM auto-responds with pairing codes — code-level
#5995HIGHSecrets in session transcripts — by design
#6606HIGHTelegram webhook binds 0.0.0.0 — code-level
#8054HIGHType coercion "undefined" credentials — code-level

Verdict

The audit catches ~6 of 37 documented issues (config/filesystem misconfigurations). The expanded check set (70+ check IDs) adds sandbox config, exec runtime sandboxing, gateway HTTP auth gaps, plugin/hook supply-chain checks, and --deep plugin/skill code-safety scanning. The remaining ~31 issues are code-level vulnerabilities that require upstream patches. For defense-in-depth: run openclaw security audit --fix and monitor the open upstream security issues list.