Repository navigation
Require a per-session token for notification click-exec - #13312
chessing234 wants to merge 2 commits into
Conversation
Sandboxed same-uid bus clients can forge omarchy-exec-argv; mint a token under XDG_RUNTIME_DIR that only host helpers can read, and ignore click commands whose omarchy-exec-token does not match. Closes omacom#8433.
Start the token Process immediately so early --exec senders see the file, restore only after mint completes, and drop execArgv from disk snapshots so pre-token popups cannot keep click-to-exec.
aefe0be to
4bd222e
Compare
Automated AI review
Verified: For newly received notifications, the token gate works as described. Two parts of the second commit do not fully do what the PR describes. Both respond to points raised on the earlier PR #12912. Restored toasts lose their click action, but history replay still runs persisted argv
When the toast leaves the screen, the file moves to Impact:
In an isolated Node run of the head Suggested change (untested): Mark token-validated entries when persisting, for example The startup race between token minting and notification readiness remainsThe PR says starting the mint with
Runs of the head sender (busctl stub, synthetic runtime dir) plus the head receiver logic:
Impact: Callers that send right after the readiness checks can lose the toast or its action. Suggested change (untested): Create the Smaller notesOptional test improvement: The new
Anchoring the regex to the Documentation:
Dependency: Overlapping PR: Open PR #12111 still contains a separate exec-token writer for the same Review informationTest scope: Pinned head and base source, including the Quickshell v0.3.1 AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
startup token race and restorePopups clearing execArgv are still real. bigger than a drive-by; leaving open. |
|
Reviewed at 4bd222e on a worker built from the Omarchy ISO, running a live shell from this branch, with the base (7b336b1) for comparison. Codex Medium reviewed it as a second opinion. The bug is real and the gate fixes the direct path. On base, a raw The token can still reach a sandbox, through the image copy. Codex found this one and I reproduced it on the live shell. The live shell also confirms the regressions raised earlier:
Each of these needs a design decision (where the token lives and when it rotates, gating the |
|
Thanks @chessing234! In the new notification engine (#15932) the exec hint stays structural: a JSON argv that's validated and run as positional args, never re-parsed as a shell string. A per-session token is something I've deliberately left out. A same-user process can already run whatever it wants without a notification, so the token doesn't buy much (that reasoning is in |
Summary
$XDG_RUNTIME_DIR/omarchy/notification-exec-tokenwhen the notifications service starts, and honoromarchy-exec-argvonly when the matchingomarchy-exec-tokenhint is present.omarchy-notification-send --execfails closed if the token file is unreadable; forged click-exec from sandboxed session-bus clients (Flatpak etc.) no longer works.Component.onCompleted), restore waits for it, and restored popups clearexecArgvso pre-token snapshots cannot keep click-to-exec.Fixes #8433.
Test plan
bash test/shell.d/notification-send-test.shbash test/shell.d/notifications-test.shMade with Cursor