fix: Enforce strict path resolution and boundaries for system utilities - #423
Conversation
…s in tests - Removes `$PATH` fallbacks for system utilities (`apt-get`, `systemctl`, `df`, `sysctl`, `journalctl`, `timedatectl`, `git`) across the codebase. - Injects `--` argument boundaries into `systemctl` commands to prevent injection attacks. - Replaces raw `fs::write` calls in the `config` and `journal` tests with the `atomic_write_str` utility. - Updates `AUDIT_REPORT.md` to document these additional findings and remediations.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR implements the remaining security hardening recommendations identified in the codebase audit. Specifically:
$PATHenvironment variable for binary lookups (apt-get,systemctl,df,sysctl,journalctl,timedatectl,git). These invocations now enforce absolute paths and fail deterministically when absent.--delimiters intosystemctlexecution to protect against flag injection vulnerabilities when dealing with potentially untrusted service names.std::fs::writein test modules (config.rs,journal.rs) to utilize the project-nativeatomic_write_strwrapper, ensuring consistent data durability guarantees even within test environments.AUDIT_REPORT.md.All tests, clippy lints, and
verify.shsteps pass successfully.PR created automatically by Jules for task 16888415330612754490 started by @Cylae