Skip to content

Validate plugin clone usernames before creating files - #12718

Open
chessing234 wants to merge 9 commits into
omacom:quattrofrom
chessing234:fold/security-path-password-input-plugin-ldisc
Open

chessing234 wants to merge 9 commits into
omacom:quattrofrom
chessing234:fold/security-path-password-input-plugin-ldisc

Conversation

@chessing234

@chessing234 chessing234 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Validate the username-derived plugin ID before creating or copying files. Supported account names, including leading underscores and final dollar signs, remain accepted. Plugin removal uses compatible safe-character rules, so these clones can also be removed or backed up. Invalid prefixes fail with an explicit diagnostic before clone or shell side effects.

The review follow-up also rejects a username equal to omarchy, regardless of case, with an explicit built-in namespace diagnostic before creating plugin files or contacting the shell.

Retains the plugin-clone contribution from #9851. Config-path, password, and TTY-setting changes are tracked separately in #13214, #13215, and #13311.

Verification

  • Eight focused username/validation groups pass: six supported account forms exercised through cloning, activation, removal and backup, plus unsafe-name and reserved-name groups. The new reserved-name regression fails against the exact previous published clone command.
  • All 20 existing clone-lifecycle checks pass with desktop commands stubbed. These exercise real built-in plugin files, manifests, activation, removal, editor dispatch and failed-discovery cleanup.
  • Command metadata validation passes for 456 commands; both enforced bin-style checks, Bash syntax and git diff --check pass.

Tests use synthetic homes, Bash 5 and GNU utilities. The existing lifecycle suite uses an interpreter-only function bridge to execute the actual clone/remove commands under Bash 5; no production implementation is replaced. No live Quickshell session or real user plugin was changed. Maintainer classification and live shell verification remain outstanding; local command tests do not attest them.

@chessing234 chessing234 changed the title Security: refresh-config path, password sync, input names, plugin USER, ldisc Security: refresh-config path, password sync, input names, plugin USER, ldisc, first-run sudoers Sep 21, 2026
chessing234 added a commit to chessing234/omarchy that referenced this pull request Sep 21, 2026
@chessing234
chessing234 force-pushed the fold/security-path-password-input-plugin-ldisc branch from 16b8764 to c525b4a Compare September 21, 2026 09:39
@llstrk

llstrk commented Sep 23, 2026

Copy link
Copy Markdown

One conditional hardening gap was identified at c525b4a909dbed29e53b7f4fe71c8a5a4b473659: failure to apply the new TTY setting can be recorded as a completed migration.

Preserve a retry or reboot signal when the TTY setting is not applied

In migrations/1789261000.sh, sudo sysctl -p discards errors and converts failure to success. The migration runner then writes the completion marker.

Source-inspected failure path, not a live-kernel reproduction:

sudo fails before applying the drop-in
  -> failure suppressed by || true
  -> migration marked complete
  -> next migration run skips it

Impact: If the running kernel still has dev.tty.ldisc_autoload=1, the intended immediate hardening can remain absent until a later successful application or reboot. This migration neither remains pending nor sets the reboot-required marker used by the update flow. The shipped drop-in still provides the normal boot-time fallback.

Suggested change: Check the effective setting and make an unapplied value observable, retaining a retry or requesting a reboot as appropriate. Handle kernels without this key explicitly. Avoid treating every nonzero sysctl -p result as failure of this particular setting: another line can fail even when the ldisc value was applied.

Verified (source inspection): The PR adds lexical rejection of absolute and ordinary .. config paths, validates the username-derived clone prefix, and routes the password menu to a helper that checks matching nonempty input and submits both user and root passwords.

Documentation correction: In bin/omarchy-toggle-input-device, describe the new $/backtick rejection as defense in depth rather than prevention of existing Bash command expansion. The baseline's quoted variable expansion already passed these characters literally; the quoting rewrite does not introduce that protection.


Review information

Test scope: Pinned source review and targeted synthetic shell-quoting checks. No live kernel/sysctl, sudo/PAM/password change, hardware, Hyprland or full plugin lifecycle testing; the migration finding is source-proven control flow with conditional impact, not a reproduced live failure.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Astra Medium performed initial inspection and synthesis after independent Opus 5.5 High and GPT 6 Sol Xhigh technical assessments, checking the reported claims against source and targeted evidence.

@chessing234

Copy link
Copy Markdown
Contributor Author

refresh-config path guard and user/root password sync split out to #13214 and #13215 for easier review.

1 similar comment
@chessing234

Copy link
Copy Markdown
Contributor Author

refresh-config path guard and user/root password sync split out to #13214 and #13215 for easier review.

@chessing234

Copy link
Copy Markdown
Contributor Author

ldisc sysctl is on #13311 as a focused pr now

@chessing234

Copy link
Copy Markdown
Contributor Author

usb name harden for #8139 is on #13313 as a focused pr

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

This PR checks username-derived plugin IDs before creating clone files.

  • Plugin clones use checked usernames that removal accepts.

No new actionable issues were found. Tests were inspected but not run.

Reviews (3) · Last reviewed commit: "Reject reserved usernames before cloning..." · Reviewed by Greptile

Comment thread bin/omarchy-plugin-clone Resolved
@chessing234 chessing234 changed the title Security: refresh-config path, password sync, input names, plugin USER, ldisc, first-run sudoers Validate plugin clone usernames before creating files Sep 30, 2026
@jandrusk

jandrusk commented Oct 8, 2026

Copy link
Copy Markdown

Looks good. One small addition would let this close #12678 and #7118 too: a user named omarchy (any case) still produces omarchy.<plugin>, which lands back in the built-in namespace, and the registry rejects that id without telling you why.

[[ ${user_part,,} != omarchy ]] ||
  fail "username '$user_part' would reuse the built-in omarchy.* namespace for the plugin id"

A matching case in plugin-clone-username-test.sh would cover it.

@omarchybot

Copy link
Copy Markdown
Collaborator

The classification of this pull request is unsettled, so it has not been verified yet. Nothing was run.

Two models classified it at 7baddb3f, each without seeing the other's answer. Claude Opus 5.5 called it an enhancement, because most of the change is new validation of the username-derived plugin id. Codex Medium called it a bug, presumably because of the omarchy-plugin-remove change: on quattro, a clone made by an account whose name starts with _ or ends in $ cannot be removed. They disagree, so I have taken off the enhancement label from the earlier classification and added no class label.

Next step is the maintainer's. They can decide what this is, or assign it to omabot to have it worked. The suggestion above to also reject an omarchy username is not part of this pull request yet.

Explain the built-in namespace collision before creating plugin files or
contacting the shell, including case-insensitive account-name variants.
@omarchybot

Copy link
Copy Markdown
Collaborator

I read the changes at 24d26f957ff4bf52833965a23e2854d813e0d58c, the clone and removal commands, the linked reports, and the earlier review comments. The new head includes the explicit reserved-username diagnostic requested above.

My classification is bug: the removal change addresses clones made under supported account names beginning with _ or ending in $, and the new guard addresses the reserved-namespace failure. The configured classification model, deepseek-v4p1-flash, returned no usable class, so this revision has no agreed classification. I added no class or verification labels and ran no code or tests; the queue workflow stops before verification in this case.

GPT-6 in Codex performed this source review (the session does not expose its reasoning effort); no second model completed a substantive review of this revision. The item is left at disagree, awaiting resolution of its classification.

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