Skip to content

fix: Enforce strict path resolution and boundaries for system utilities - #423

Merged
Cylae merged 1 commit into
mainfrom
fix-path-fallbacks-and-raw-writes-16888415330612754490
Sep 17, 2026
Merged

Cylae merged 1 commit into
mainfrom
fix-path-fallbacks-and-raw-writes-16888415330612754490

Conversation

@Cylae

@Cylae Cylae commented Sep 17, 2026

Copy link
Copy Markdown
Owner

This PR implements the remaining security hardening recommendations identified in the codebase audit. Specifically:

  1. Strict Path Resolution: Replaced insecure fallbacks to the $PATH environment variable for binary lookups (apt-get, systemctl, df, sysctl, journalctl, timedatectl, git). These invocations now enforce absolute paths and fail deterministically when absent.
  2. Argument Boundary Enforcement: Injected explicit -- delimiters into systemctl execution to protect against flag injection vulnerabilities when dealing with potentially untrusted service names.
  3. Atomic Writes in Tests: Updated remaining occurrences of raw std::fs::write in test modules (config.rs, journal.rs) to utilize the project-native atomic_write_str wrapper, ensuring consistent data durability guarantees even within test environments.
  4. Audit Documentation: Logged these remediations systematically in the central AUDIT_REPORT.md.

All tests, clippy lints, and verify.sh steps pass successfully.


PR created automatically by Jules for task 16888415330612754490 started by @Cylae

…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.
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@Cylae
Cylae merged commit 0336360 into main Sep 17, 2026
1 check passed
@Cylae
Cylae deleted the fix-path-fallbacks-and-raw-writes-16888415330612754490 branch September 17, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant