#21159: fix(security): harden data exposure controls
scripts
docker
agents
size: XS
Cluster:
OpenClaw Plugin Enhancements
## Summary
- **Bind CDP socat proxy to 127.0.0.1** — The socat proxy for Chrome DevTools Protocol was bound to `0.0.0.0`, exposing the CDP port to the network. Any reachable attacker could connect and gain full Chromium control. Now restricted to loopback only.
- **Default cache trace to exclude message content** — `includeMessages`, `includePrompt`, and `includeSystem` defaulted to `true`, causing full conversation content (including proprietary system prompts) to accumulate on disk indefinitely. Defaults changed to `false`; operators can opt-in via config.
- **Restrict log file permissions and redact payload content** — `QueuedFileWriter` now creates files with mode `0o600` (owner-only). Anthropic payload logger records only the SHA-256 digest instead of the full API request body containing conversation context and user messages.
## Test plan
- [x] Build succeeds with no type errors
- [x] All existing tests pass (no dedicated tests for these modules)
- [ ] Verify `sandbox-browser-entrypoint.sh` socat binds to `127.0.0.1` on container start
- [ ] Verify cache-trace JSONL excludes messages by default, includes when opted-in
- [ ] Verify payload log files created with `0o600` permissions on Linux
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Tightens data exposure controls across multiple security surfaces: restricts CDP proxy to loopback, defaults cache trace to exclude sensitive content, and hardens log file permissions.
- Bound socat CDP proxy to `127.0.0.1` instead of `0.0.0.0` to prevent network exposure of Chrome DevTools Protocol
- Changed cache trace defaults from opt-out to opt-in for `includeMessages`, `includePrompt`, and `includeSystem` to prevent accumulation of sensitive conversation data
- Added file permission restrictions (`0o600`) in `QueuedFileWriter` to prevent other system users from reading diagnostic logs
- Switched anthropic payload logger to record only SHA-256 digests instead of full API request bodies
The security improvements are sound and address real exposure risks. The implementation correctly uses `chmod` to enforce permissions on existing files.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk - it hardens security controls without breaking existing functionality
- All changes are defensive security improvements that reduce data exposure. The CDP binding change prevents network access to browser debugging. The cache trace defaults prevent inadvertent logging of sensitive content. The file permissions restrict access to diagnostic data. The payload digest change prevents full conversation content from accumulating on disk. No breaking changes to existing functionality.
- No files require special attention
<sub>Last reviewed commit: 897a608</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#21964: Security: harden gateway and plugin trust boundaries
by Elormyevu · 2026-02-20
77.5%
#14197: fix(security): harden browser API auth, token comparisons, and hook...
by leecarollyn-gif · 2026-02-11
77.5%
#21136: fix(security): harden agent autonomy controls
by novalis133 · 2026-02-19
77.1%
#15757: feat(security): add hardening gap audit checks
by saurabhsh5 · 2026-02-13
77.1%
#5649: fix(security): harden file permissions and header merging
by sfo2001 · 2026-01-31
76.5%
#23574: security: P0 critical remediation — plugin sandbox, password hashin...
by lumeleopard001 · 2026-02-22
76.3%
#22227: fix(security): harden gateway auth — audit logging, pairing, mode v...
by novalis133 · 2026-02-20
76.2%
#23465: Gateway: strengthen Control UI security headers
by bmendonca3 · 2026-02-22
75.9%
#8517: Browser: sandbox download/trace paths
by coygeek · 2026-02-04
75.6%
#18924: fix(security): tighten permissions on cron/, browser/, settings/ dirs…
by rexlunae · 2026-02-17
75.5%