#18959: fix: harden permissions on cron/, browser/, settings/ in doctor --fix
agents
size: XS
Fixes #18866
`doctor --fix` (`fixSecurityFootguns`) already secures `stateDir` (700), `configPath` (600), `credentials/` (700/600), and `agents/*/sessions` (700/600), but leaves `cron/`, `browser/`, and `settings/` with default world-readable permissions.
### Changes
Added `applyPerms` calls in `fixSecurityFootguns` for:
- `~/.openclaw/cron/` → 700
- `~/.openclaw/cron/jobs.json` → 600
- `~/.openclaw/cron/jobs.json.bak` → 600
- `~/.openclaw/browser/` → 700
- `~/.openclaw/settings/` → 700
These directories contain sensitive data (scheduled task payloads, browser session state/cookies, user settings) and should not be world-readable.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Secured `~/.openclaw/cron/`, `~/.openclaw/browser/`, and `~/.openclaw/settings/` directories by adding restrictive permissions (700 for directories, 600 for files) in the `fixSecurityFootguns` function. The implementation follows the existing security hardening pattern used for credentials and agent state directories, ensuring sensitive data like scheduled task payloads, browser session state/cookies, and user settings are no longer world-readable.
<h3>Confidence Score: 5/5</h3>
- Safe to merge with minimal risk
- The changes follow established patterns in the codebase, use the existing `applyPerms` abstraction that handles both Unix and Windows permissions correctly, and address a legitimate security concern by restricting access to sensitive directories that were previously world-readable
- No files require special attention
<sub>Last reviewed commit: 0d620f1</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#19032: fix(security): tighten permissions for cron/, browser/, settings/ i...
by moxunjinmu · 2026-02-17
92.6%
#18939: fix: tighten permissions on cron/, browser/, settings/, logs/ in do...
by sriram369 · 2026-02-17
92.4%
#18954: fix(security): secure cron, browser, settings dirs in doctor --fix
by BinHPdev · 2026-02-17
89.7%
#19191: fix(security): harden cron file permissions to 0o600
by Kropiunig · 2026-02-17
86.5%
#18924: fix(security): tighten permissions on cron/, browser/, settings/ dirs…
by rexlunae · 2026-02-17
86.3%
#23432: Doctor: prevent permissive secret file modes during --fix
by bmendonca3 · 2026-02-22
84.9%
#18878: fix(cron): set secure file permissions (0o600) on jobs.json
by MisterGuy420 · 2026-02-17
77.8%
#6257: Fix: Create sensitive directories with mode 0o700
by sloppy-claw · 2026-02-01
76.1%
#22501: fix(doctor): preserve logging config in doctor --fix
by Shuai-DaiDai · 2026-02-21
74.9%
#22408: fix: doctor --fix now persists config when removing unrecognized keys
by astroclaw · 2026-02-21
73.9%