#18878: fix(cron): set secure file permissions (0o600) on jobs.json
size: XS
trusted-contributor
Fixes #18866
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR enhances security by setting strict file permissions (`0o600`, user-only read/write) on the cron jobs store file (`jobs.json`) and its backup. The change ensures that cron job data—which may contain sensitive information like agent messages, session keys, and delivery configuration—is only accessible to the file owner.
The implementation follows the established pattern used throughout the codebase for sensitive files (credentials, sessions, config files). The atomic write operation now sets `mode: 0o600` when creating the temporary file, and the backup file receives the same permissions via `chmod` after creation.
<h3>Confidence Score: 5/5</h3>
- Safe to merge with no concerns
- The change is a straightforward security improvement that follows the well-established pattern used throughout the codebase for handling sensitive files. The implementation is correct, adds no new logic complexity, and the import reordering is standard formatting cleanup.
- No files require special attention
<sub>Last reviewed commit: b617264</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#19191: fix(security): harden cron file permissions to 0o600
by Kropiunig · 2026-02-17
83.4%
#18924: fix(security): tighten permissions on cron/, browser/, settings/ dirs…
by rexlunae · 2026-02-17
81.9%
#18954: fix(security): secure cron, browser, settings dirs in doctor --fix
by BinHPdev · 2026-02-17
79.8%
#18959: fix: harden permissions on cron/, browser/, settings/ in doctor --fix
by jwchmodx · 2026-02-17
77.8%
#17463: fix: write config files with explicit 0o600 mode instead of post-wr...
by miclaldogan · 2026-02-15
77.6%
#18939: fix: tighten permissions on cron/, browser/, settings/, logs/ in do...
by sriram369 · 2026-02-17
77.0%
#8751: fix(security): use 0o600 permissions for session transcript files
by revenuestack · 2026-02-04
76.4%
#19032: fix(security): tighten permissions for cron/, browser/, settings/ i...
by moxunjinmu · 2026-02-17
76.2%
#8698: fix(cron): default enabled to true for new jobs
by emmick4 · 2026-02-04
74.8%
#8837: fix(cron): guard against undefined job.state in printCronList
by fxd-jason · 2026-02-04
74.3%