Repository navigation
Pls trust only crash entries written by systemd-coredump - #19630
Edward-cmyk wants to merge 1 commit into
Conversation
omarchy-crash-watch announced any journal entry carrying the core-dump MESSAGE_ID and this user's UID. Any process can write those fields, a Flatpak app included, so a forged entry put up a critical "Process crashed" toast that bypasses Do Not Disturb, and one click handed its text to an agent launched with approvals off. Require the journald-stamped _EXE and _SYSTEMD_UNIT of the system's systemd-coredump service, which a sender cannot set. Tell the agent, in the prompt and in the skill, that crash data is untrusted input.
[Medium impact] This PR appears safe to merge. SummaryThis PR limits crash notifications to entries sent by systemd-coredump.
No actionable issues were found. The full test suite was not run during this review. Reviews (2) · Last reviewed commit: "Trust only crash entries written by syst..." · Reviewed by Greptile |
|
GPT-6 High in Codex read the diff, the existing crash watcher and diagnosis entry point, their callers, and #19629. I classify this as a bug fix, but the configured classifier, deepseek-v4p1-flash, returned no usable answer, so the required classification remains unresolved. No second opinion reviewed the implementation, no tests ran, and no changes were pushed. Verification awaits a completed classification; there is nothing requested from the author at this stage. |
|
GPT-6 High in Codex checked this diff against current quattro, and Opus 5.5 High reviewed the two approaches. #7155 already ties crash events to individual coredump service runs, so I’ve queued the crash-data guidance from this PR for #7155. #20275 separately adds approval prompts to crash diagnosis. This branch conflicts with the out-of-memory watcher changes in #20446. A conflict resolution needs to keep sender validation on the crash path and update the crash fixtures in the out-of-memory tests. This was a source review. Worker verification against current quattro is pending, and GitHub marks the Tests and translation workflows as requiring action. The choice between the two fixes is with the maintainer. |
What changes
Fixes #19629.
omarchy-crash-watchannounced any journal entry with the core-dumpMESSAGE_IDand the user's UID. Any process can write those fields (Flatpak apps get the journal socket by default), so a forged entry put up a critical, Do-Not-Disturb-bypassing "Process crashed" toast. One click then handed its text to an agent launched with approvals off. Details are in the issue.bin/omarchy-crash-watch: only entries whose_EXEis/usr/lib/systemd/systemd-coredumpand whose_SYSTEMD_UNITmatchessystemd-coredump@*.serviceare announced. journald stamps both fields from the sender's process and cgroup, so the sender can't set them. Runningsystemd-coredumpfrom the user's own session doesn't pass either, because the unit then isuser@UID.service.bin/omarchy-agent-crash: the prompt now tells the agent that the process name, binary and everything from coredumpctl or the core came from the crashed program. It must treat them as evidence, not instructions, and stop and tell the user if any of it reads like a request.omarchy-diagnose-crashskill: a short "Crash data is untrusted" section with the same rule, plus: never paste crash fields into a shell unquoted.Not in this PR: crash diagnoses still launch with each agent's approval-skipping flags. Changing that touches every agent in
omarchy-agent, so it should be a separate change.Verification
test/shell.d/crash-capture-test.sh: the existing fixture now carries the_EXE/_SYSTEMD_UNITof a real entry, and three new cases pass. An entry forged by an ordinary process gets no toast;systemd-coredumprun from the user session gets no toast; a forged entry doesn't stop the real crash after it from being announced. All 31 cases pass. Against the old watcher, the first new case fails.test/shell.d/provision-user-test.sh(references the skill) passes._EXE=/usr/lib/systemd/systemd-coredumpand_SYSTEMD_UNIT=systemd-coredump@<n>-<…>.service, and still produce their toast../test/allrun; other distros'systemd-coredumppaths (Omarchy is Arch-only).Screenshots
No visible change: genuine crash toasts look the same; forged ones no longer appear.