[codex] OM-SEC-15: Keep mixed-trust installers outside sudo lifetime - #9470
[codex] OM-SEC-15: Keep mixed-trust installers outside sudo lifetime#9470AFOliveira wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Hardens mixed-trust installation flows to prevent downloaded or user-owned code from reusing cached sudo authorization.
Changes:
- Adds command-scoped sudo and credential revocation boundaries.
- Hardens package, browser, language, font, and gaming installers.
- Adds privilege-reuse regression coverage and documentation updates.
Reviewed changes
Copilot reviewed 3 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
test/shell.d/install-chain-sudo-security-test.sh |
Adds installer-chain security regression tests. |
manual/18-development-tools.md |
Documents Docker database credentials. |
default/omarchy/sudo-no-update/sudo |
Adds a no-update sudo wrapper. |
bin/omarchy-pkg-install |
Hardens interactive package installation. |
bin/omarchy-pkg-add |
Supports command-scoped sudo. |
bin/omarchy-install-gaming-gpu-lib32 |
Hardens graphics prerequisite installation. |
bin/omarchy-install-gaming-geforce-now |
Isolates downloaded installer execution. |
bin/omarchy-install-gaming-battlenet |
Separates prerequisites from vendor execution. |
bin/omarchy-install-font |
Adds sudo revocation around font installation. |
bin/omarchy-install-dev-env |
Separates privileged and user tooling phases. |
bin/omarchy-install-browser |
Adds source validation and credential cleanup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Addressed both review findings in a46f469:
Local validation on a46f469:
The PR remains draft while the remaining repeated startup/sudo helpers are reduced onto the shared foundation. |
a46f469 to
5b74b46
Compare
|
Shared-helper reduction is now published in 5b74b46. This removes the copied startup/sudo implementations and the temporary PATH wrapper, adds one 54-line source-only install helper, and keeps the #9457 core byte-identical. Local validation on the pushed commit: standalone baseline exploit succeeds while the candidate leaves no root target; focused suite 14/14 including the |
|
A few more changes needed; PHP installs require repeated authentication. install_php ( omarchy/bin/omarchy-install-dev-env Lines 64 to 86 in 5b74b46 Desktop test still reaches host sudo. desktop-entry-launch-test. ( omarchy/test/shell.d/desktop-entry-launch-test.sh Lines 54 to 63 in 5b74b46 |
There was a problem hiding this comment.
🟡 Changes recommended
The GPU helper still exposes inherited startup injection before package operations, and required regression coverage remains incomplete.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 3/11 changed files
- Comments generated: 3
- Review effort level: Balanced
| pass "install-app does not run extra commands from a quote in the display name" | ||
|
|
||
| bash "$ROOT/bin/omarchy-install-font" "Cascadia Mono" "ttf-cascadia-mono-nerd" "CaskaydiaMono Nerd Font" | ||
| "$font_script" "Cascadia Mono" "ttf-cascadia-mono-nerd" "CaskaydiaMono Nerd Font" |
| outer_uid=$(id -u) | ||
| outer_gid=$(id -g) | ||
| subuid=$(awk -F: -v user="$(id -un)" '$1 == user { print $2; exit }' /etc/subuid) | ||
| subgid=$(awk -F: -v group="$(id -gn)" '$1 == group { print $2; exit }' /etc/subgid) |
| - Prefer a full `if`/`else` conditional for simple two-path control flow; don't rely on `exec` or `exit` in one branch to make following statements unreachable | ||
| - For strings/paths with spaces, quote them instead of escaping spaces with `\ ` (e.g., `"$APP_DIR/Disk Usage.desktop"`, not `$APP_DIR/Disk\ Usage.desktop`) | ||
| - Shebangs must use `#!/bin/bash` consistently (never `#!/usr/bin/env bash`) | ||
| - Shebangs must use `#!/bin/bash` consistently (never `#!/usr/bin/env bash`). A security-sensitive entrypoint may use the exact `#!/bin/bash -p` form only when it must suppress `BASH_ENV` and exported-function startup injection before its first command; that exception must be explained at the boundary and covered by a regression that rejects an ordinary Bash launch with a decoy `-p` argument. |
…dex/portfolio-9457-20260907
Mixed installers now finish and revoke their privileged work before language managers, Composer, downloaded vendor code or font selection run. Finding: OM-SEC-15. This branch builds on #9457's exact shared helper; canonical entrypoint resolution and startup checks protect all six affected entrypoints.
PHP, Laravel and Symfony use one fixed packaged system helper for their complete PHP prerequisite package set and configuration. The helper accepts only
phporsymfony, requires root/privileged Bash, runs in a clean environment, and accepts no caller paths, scripts or package names. Onesudo -Ncall covers that phase, then authorization is revoked before user work. This resolves the earlier per-extension prompts and the incomplete package/configuration consolidation.The new unprivileged regression exercises actual fixed configuration on temporary files, exact complete package sets, one total authentication per PHP flow, failures and revocation. Every protected installer and the package helper has a decoy-startup regression. Font tests now verify cold revocation, no-update package mode, revocation before font selection and failure cleanup. Namespace tests use login identity for subgid and probe the exact requested capability.
At
d5d40fec, independent Daybreak review accepts the code; focused installer/font suites, CLI112, syntax and whitespace pass. In the disposable Omarchy VM, the actual PHP flow completed with exactly one password and the required PHP/Xdebug modules loaded. The Symfony system phase also completed with one password and installed the official symfony-cli package. Both left authorization revoked. No Laravel/vendor downloads, full GPU/vendor-install matrix or interactive prompt cancellation were exercised; safe orchestration fixtures cover those relevant boundaries.Depends on #9457 and its coordinated runtime/settings release. Keep the new system helper packaged alongside the installers. No reusable timestamp or arbitrary root-command broker was added.