Skip to content

Remove the sudo lockout reset command - #8046

Merged
dhh merged 1 commit into
quattrofrom
remove-sudo-reset
Aug 24, 2026
Merged

dhh merged 1 commit into
quattrofrom
remove-sudo-reset

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

omarchy sudo reset was a single line, and that line handed an environment variable to a root shell:

su -c "faillock --reset --user $USER"

$USER is an environment variable rather than a kernel-supplied identity, so whatever set it before the command ran chose the rest of the string root's shell would execute: with USER='dhh; curl … | sh', su is asked to run faillock --reset --user dhh; curl … | sh. This is not a way past PAM on its own — su still has to authenticate, and an attacker who could already run su as root would not need the detour. What makes it worth removing rather than quoting is the prompt it puts in front of the user. install/provisioning/setup-form.sh sets root's password to the user's own ("Used for user + root"), and bin/omarchy-provision-owner does the same on deferred provisioning, so the password su asks for is the one the user types into sudo prompts all day, at a prompt a documented Omarchy command just raised.

It bought little in return. Omarchy's PAM configuration sets deny=10 unlock_time=120 on /etc/pam.d/system-auth (install/config/increase-lockout-limit.sh) and on the lock screen's own stack (bin/omarchy-apply-lock), so a lockout takes ten wrong passwords to reach and clears itself two minutes later. For anyone who would rather not wait, manual/45-troubleshooting.md documents the TTY-and-root reset, which still works and is unaffected by this change. Nothing in the repository called the command; the CLI router was its only caller.

The sudo group keeps keepalive and passwordless, so GROUP_DESCRIPTIONS[sudo] is unchanged, and omarchy sudo reset now falls through to the router's unknown-command path. No migration is needed: bin/omarchy-* ships as files in the omarchy package, so an upgrade drops what the package no longer contains — the same handling every previous command removal has had.

One reference survives on purpose. basecamp/omarchy-iso's manifests/fresh-4-semantic.json lists omarchy-sudo-reset among the commands a built v4 image contained. That file is a capture of what shipped rather than a live index, and editing it would falsify the record.

🤖 Generated by Opus 5 in Claude Code. Reviewed by Codex XHigh.

Nothing in the repository called omarchy-sudo-reset, and its one line interpolated an environment-supplied $USER into a string handed to a root shell: `su -c "faillock --reset --user $USER"`. $USER is an environment variable rather than a kernel-supplied identity, so whatever set it before the command ran chose the rest of what root's shell executed. That is not a way past PAM on its own — su still has to authenticate — but the installer sets root's password to the user's own, so the prompt this raises is one the user answers by habit.

It bought little for that. Omarchy sets `deny=10 unlock_time=120` in /etc/pam.d/system-auth and in the lock screen's PAM stack, so a lockout takes ten wrong passwords to reach and clears itself two minutes later, and the manual documents the root-TTY reset for anyone who would rather not wait.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Codex XHigh <[email protected]>
Copilot AI balanced review requested due to automatic review settings August 24, 2026 13:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@omarchybot
omarchybot requested a balanced review from Copilot August 24, 2026 13:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@dhh
dhh merged commit d99d4fc into quattro Aug 24, 2026
3 checks passed
@dhh
dhh deleted the remove-sudo-reset branch August 24, 2026 13:49
omarchybot added a commit that referenced this pull request Aug 24, 2026
Backport of the omarchy-sudo-reset removal (PR #8046, merged to quattro as
d99d4fc) onto the v4-0-1 release branch, so 4.0.1 stops shipping the command.

Nothing in the repository called omarchy-sudo-reset, and its one line
interpolated an environment-supplied $USER into a string handed to a root
shell: su -c "faillock --reset --user $USER". $USER is an environment variable
rather than a kernel-supplied identity, so whatever set it before the command
ran chose the rest of what root's shell executed. That is not a way past PAM on
its own -- su still has to authenticate -- but the installer sets root's
password to the user's own, so the prompt this raises is one the user answers
by habit.

It bought little for that. Omarchy sets deny=10 unlock_time=120 in
/etc/pam.d/system-auth and in the lock screen's PAM stack, so a lockout takes
ten wrong passwords to reach and clears itself two minutes later, and
manual/45-troubleshooting.md documents the root-TTY reset for anyone who would
rather not wait. That reset is unaffected by this change.

The sudo group keeps keepalive and passwordless, so GROUP_DESCRIPTIONS[sudo] is
unchanged and omarchy sudo reset falls through to the router's unknown-command
path. No migration is needed: bin/omarchy-* ships as files in the omarchy
package, so an upgrade drops what the package no longer contains.

Clean cherry-pick: the file was byte-identical to quattro's pre-image and
nothing else on this branch referenced it, so merging v4-0-1 into quattro
resolves without a conflict. test/shell and test/cli pass here.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_018DEMYa9UWtroz93DhMTtcV
@omarchybot omarchybot mentioned this pull request Aug 24, 2026
nick1udwig pushed a commit to nick1udwig/omarchy that referenced this pull request Sep 9, 2026
Nothing in the repository called omarchy-sudo-reset, and its one line interpolated an environment-supplied $USER into a string handed to a root shell: `su -c "faillock --reset --user $USER"`. $USER is an environment variable rather than a kernel-supplied identity, so whatever set it before the command ran chose the rest of what root's shell executed. That is not a way past PAM on its own — su still has to authenticate — but the installer sets root's password to the user's own, so the prompt this raises is one the user answers by habit.

It bought little for that. Omarchy sets `deny=10 unlock_time=120` in /etc/pam.d/system-auth and in the lock screen's PAM stack, so a lockout takes ten wrong passwords to reach and clears itself two minutes later, and the manual documents the root-TTY reset for anyone who would rather not wait.

Co-authored-by: David Heinemeier Hansson <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: Codex XHigh <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
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.

4 participants