← Back to PRs

#18878: fix(cron): set secure file permissions (0o600) on jobs.json

by MisterGuy420 open 2026-02-17 04:59 View on GitHub →
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