Repository navigation
[codex] OM-SEC-18: Bound Quattro sudo before mixed-trust code - #9473
AFOliveira wants to merge 50 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Hardens the Quattro upgrader by bounding privileged execution before mixed-trust code.
Changes:
- Adds privileged Bash startup validation and sanitized command resolution.
- Replaces reusable sudo keepalive with
sudo --no-updateboundaries. - Reorders package operations and adds extensive security regression coverage.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
bin/omarchy-upgrade-to-quattro |
Implements privilege boundaries and reorders upgrade phases. |
default/omarchy/sudo-no-update/sudo |
Adds the no-update sudo wrapper. |
test/shell.d/quattro-sudo-boundary-security-test.sh |
Adds sudo-boundary security tests. |
test/shell.d/upgrade-to-quattro-test.sh |
Adds package-overwrite and ownership assertions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Addressed both review threads in d0b4d99:
Local validation on d0b4d99:
This PR remains draft while its shared startup/sudo helpers are reduced onto the common foundation. |
d0b4d99 to
9340e96
Compare
|
The reviewer-driven scope reduction is published in 9340e96. The PR now contains only the Quattro sudo-lifetime fix, its focused regression, and the documented privileged-Bash exception. Package-signature/T2/overwrite/SDDM/snapshot changes and the unused wrapper were removed (201 deletions vs 135 additions relative to the prior head). Local validation on the pushed commit: standalone baseline exploit confirmed; real boundary test passes; replacing |
Share the existing security helpers, propagate command-scoped sudo through the direct package helper boundary, and keep the regression focused on the reusable-credential defect.
|
One last thing! When /usr/bin/omarchy-snapshot exists, it uses ordinary sudo repeatedly, creating a reusable timestamp that a detached same-user process can consume before open_privilege_window invalidates it. On the intended Omarchy 3.8 upgrade path, commands instead live under $OMARCHY_PATH/bin, so the absolute /usr/bin path is absent and status 127 is accepted, which skips the snapshot entirely. The snapshot should be implemented using trusted fixed-path operations through as_root/sudo -N after cold invalidation but before the first mutation. The regression test should exercise this path explicitly. |
|
Looks good to me, pending the other PRs. |
…view-9469-20260906
The legacy Quattro upgrader must complete its system phase without maintaining reusable sudo authorization across user-controlled or downloaded code. It now uses command-scoped authentication and an irreversible transition to user work.
Finding: OM-SEC-18.
Reporter credit: Reported and remediated by Afonso Oliveira. The included #9469/#9474 prerequisites retain Roger Piñol's and Sean Huber's credits for their respective update, migration/SSH and Stay Awake reports.
sudo -Nfor each system operation.as_rootcalls or attempts to reopen it fail.The independent Daybreak model review found no separate defect in the Quattro gate. Its channel and source-root findings were fixed in the prerequisites and merged here; the final reassessment accepts those changes for maintainer review. Erik's snapshot feedback is addressed.
Includes both prerequisites by normal merges. Merge #9469, then #9474, then #9473. Compare with #9474 for the Quattro-specific delta. Package authenticity (#9460), AUR consent (#9795) and package ownership (#9070) remain separate integration work.
Reviewed head:
e749a877ab49551c18f498ebf4cd7b06aa1e2d7d.Validation: the final combined revision passes
./test/all(CLI and 242 shell test files), 36 changed Bash files pass syntax checks, and the four PRs merge cleanly together. Focused coverage includes 16 channel-lifecycle cases, 38 restart assertions, source-root/package-layout/symlink checks, migration retry/failure/signals, SSH setup and the existing Quattro privilege/snapshot tests. The aggregate uses the packaging/ISO checkout overrides withNO_COLORunset and Python bytecode disabled.Signed candidate packages
4.0.2-9004built from the combined source passed a real update on a disposable 4.0.2 VM and a complete 3.8.4 → Quattro upgrade with reboot. The latter finished in 286.1 seconds, retained the pre-upgrade snapshot, had no pending migrations or failed system/user services, and booted a healthy desktop. Eleven installed security-related files match the candidate hashes in both guests. Installed and development-checkout restart checks also pass.Ready for maintainer review. The legacy upgrade required 163 real password prompts under the guest's normal authentication policy; the test driver supplied its fixture password. Maintainers must accept that usability cost or request a separate batching design before merging the complete upgrade experience. The hook timing change also needs acceptance. The protected workflow prevents its own authentication from refreshing sudo credentials; it does not provide account-wide isolation from unrelated concurrent authentication.