Skip to content

Restrict third-party plugin access to authentication services - #9618

Merged
ryanrhughes merged 8 commits into
omacom:quattrofrom
acrogenesis:security/plugin-auth-boundary
Sep 7, 2026
Merged

ryanrhughes merged 8 commits into
omacom:quattrofrom
acrogenesis:security/plugin-auth-boundary

Conversation

@acrogenesis

@acrogenesis acrogenesis commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Summary

  • remove direct root-shell injection from third-party plugin entry points and use capability-scoped facades
  • keep authentication services, including trusted first-party clones, outside the public service map and reachable host QObject graph using host-stamped manifest capabilities
  • detach third-party registry and bar-configuration snapshots and stamp bar click-target/popout ownership at trusted registration callbacks
  • remove the generic plugin-facade factory from replacement bars so they cannot request another plugin's live service through the supported interface
  • preserve supported lifecycle, settings, app-library, bar-state, and narrow non-authentication service flows
  • document the same-process QML boundary accurately and add runtime exploit coverage

Review follow-up

The original 10-finding review was reproduced and addressed, including registry aliasing, plugin-controlled ownership, authentication classification, clone/menu/bar compatibility, custom module identity, popout lifecycle, animated resync churn, and facade-cache cleanup.

The later adjacent-boundary review was also valid and is addressed as follows:

  • visual widgets share the host QML scene and can walk parent items, so the documentation no longer describes facades as a same-process sandbox; authentication isolation does not depend on the facade because lock/polkit remain outside _services and the reachable QObject graph
  • PluginShellApi.pluginShellForId() was removed; only the trusted built-in bar retains the host-only widget-facade factory, while replacement bars can provide configured widgets only a service-less lifecycle/settings facade
  • both initial and refreshed third-party barConfig injection now use deep snapshots rather than the live host configuration object

Compatibility note: service-backed third-party widgets retain full service integration under the built-in omarchy.bar. When hosted by an untrusted replacement bar they receive target-scoped lifecycle/settings operations but not their live service object, because exposing that object to the widget would also expose it to the bar hosting the widget.

Security report credit

Reported by security researcher Roger Piñol. The security commits record the canonical security-inbox attribution using Reported-by: Roger Piñol <rogerpicar@gmail.com>.

Thank you to Roger for responsibly disclosing the authentication-state and unlock-control exposure and providing the reproducer that led to this fix.

Verification

  • ./test/shell.d/plugin-auth-boundary-test.sh — 9 checks pass, including the Quickshell runtime fixture
  • bash ./test/shell.d/runtime-smoke-test.sh — malicious replacement-bar service/configuration probes and all existing runtime checks pass
  • plugin clone, bar, bar-widget contract, plugin registry contract, manifest entrypoint, installed-service, and plugin-manifest tests pass
  • qmllint on all changed QML entry points and facade types
  • Bash syntax and git diff --check
  • live dev-linked shell restart: clone lock and polkit healthy, built-in bar rendered all configured third-party widgets, representative third-party service IPC healthy, and no new QML warnings

Scope note

Third-party QML remains arbitrary, unsandboxed user-level code in the same shell process. The supported facade API no longer directly exposes authentication services or a generic replacement-bar service factory, but visual plugins can traverse ordinary objects in their shared QML scene and have the same file/process access as the user. The R03 security guarantee is narrower and defense-in-depth: authentication services and their cleartext state are retained outside both the public service map and the reachable host object graph.

@acrogenesis
acrogenesis force-pushed the security/plugin-auth-boundary branch 2 times, most recently from 74fae08 to 80fe49e Compare September 1, 2026 16:11
Reported-by: Roger Piñol <rogerpicar@gmail.com>
@acrogenesis
acrogenesis force-pushed the security/plugin-auth-boundary branch from 80fe49e to 1702cf0 Compare September 1, 2026 16:55
@acrogenesis
acrogenesis marked this pull request as ready for review September 1, 2026 18:26

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.

🟡 Changes recommended

Cached privileges can survive manifest changes, and enabled service clones are not consistently resolved through the new facades.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Restricts third-party QML plugins to capability-scoped facades while isolating authentication services from the host service map and QObject graph.

Changes:

  • Adds scoped shell, registry, bar, application, and service facades.
  • Marks and privately retains authentication services.
  • Adds security regression tests and updates plugin documentation.
File summaries
File Description
test/shell.d/runtime-smoke-test.sh Tests replacement-bar boundaries.
test/shell.d/plugin-auth-boundary-test.sh Adds authentication-boundary coverage.
test/shell.d/fixtures/plugin-registry/shell.qml Tests trusted capability stamping.
test/shell.d/fixtures/plugin-auth-boundary/shell.qml Exercises facade isolation at runtime.
test/shell.d/fixtures/plugin-auth-boundary/AuthStoreReader.qml Verifies private store imports.
test/shell.d/fixtures/plugin-auth-boundary/AuthStoreOwner.qml Manages the test authentication store.
shell/Ui/qmldir Exports the bar facade type.
shell/Ui/PluginBarApi.qml Defines scoped widget-to-bar access.
shell/shell.qml Implements service isolation and facade creation.
shell/services/PluginShellApi.qml Defines the scoped shell interface.
shell/services/PluginRegistryApi.qml Provides a self-scoped registry view.
shell/services/PluginRegistry.qml Stamps trusted manifest capabilities.
shell/services/PluginFirstPartyServiceApi.qml Proxies selected built-in services.
shell/services/PluginBarWidgetRegistryApi.qml Exposes detached widget snapshots.
shell/services/PluginBarStateApi.qml Exposes scalar bar state.
shell/services/PluginAppLibraryApi.qml Scopes application-library operations.
shell/services/AuthServiceStore.js Privately retains authentication services.
shell/README.md Documents the security boundary.
shell/plugins/polkit/manifest.json Marks Polkit as authentication-sensitive.
shell/plugins/panels/weather/Panel.qml Supports the scoped bar setter.
shell/plugins/panels/clock/Panel.qml Supports the scoped bar setter.
shell/plugins/lock/manifest.json Marks lock as authentication-sensitive.
shell/plugins/bar/Bar.qml Adds widget facades and ownership tracking.
manual/32-shell-plugins.md Explains user-facing security limitations.
docs/omarchy-shell.md Documents facade and replacement-bar behavior.
agents/skills/shell-dev.md Updates shell-development guidance.
Review details

Suppressed comments (1)

shell/shell.qml:523

  • This always returns null for a non-bar clone, even when requestedId resolves to that clone's own service. For example, the cloned omarchy.media widget still calls firstPartyServiceFor("omarchy.media") in shell/plugins/services/media/BarWidget.qml:10, so it loses its companion service under the trusted built-in bar, contrary to the PR's compatibility note. Treat a source ID that resolves to the caller as an own-service lookup; replacement-bar entry facades still have no lookup callback.
      _firstPartyServiceLookup: function(requestedId) {
        return barCapabilities ? (firstPartyServices[requestedId] || null) : null
      },
  • Files reviewed: 26/26 changed files
  • Comments generated: 2
  • Review effort level: Balanced

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

Comment thread shell/shell.qml Resolved
Comment thread shell/shell.qml Resolved
Reported-by: Roger Piñol <rogerpicar@gmail.com>
@acrogenesis

Copy link
Copy Markdown
Member Author

The suppressed Copilot compatibility note is also fixed in 203e163: when a built-in source ID resolves to the calling clone, firstPartyServiceFor treats it as the existing own-service lookup. Replacement-bar entry facades still have no service callback. The full runtime fixture proves the clone widget reaches its companion service under the trusted built-in bar and remains isolated under an untrusted replacement bar.

Co-Authored-By: GPT-5.6-Sol <noreply@openai.com>
ryanrhughes and others added 2 commits September 6, 2026 22:04
Co-Authored-By: GPT-5.6-Sol <noreply@openai.com>
Co-Authored-By: GPT-5.6-Sol <noreply@openai.com>
@ryanrhughes

Copy link
Copy Markdown
Collaborator

I reviewed current head 203e1639 with GPT-5.6-Sol at xhigh in T3 Code, plus a separate Codex xhigh pass. I found four concrete defects, and all four are now fixed on this branch:

  1. f2b4731b keeps authentication classification in the private service store, so a visual plugin cannot mutate reachable manifest state, force a service rescan, and republish the lock service through ShellRoot. I reproduced the original downgrade and callable unlock sentinel with a synthetic QML fixture in rootless Podman before applying the fix.

  2. 3292c19f gives omarchy.idle clones a detached copy of the configured idle and lock timeouts instead of silently falling back to 150/300 seconds.

  3. 3292c19f also restores the narrow auxiliary UI calls used by built-in audio, media, monitor, and network clones: OSD, Wi-Fi QR, and speed test.

  4. The final Codex fix review caught that replacement bars used a separate service-less widget facade that still rejected those clone summons. 23aeb4c6 closes that last gap while keeping service access unavailable and rejecting every summon outside the existing allowlist.

The final tree passed a clean ./test/cli run in archlinux:latest, plus the focused authentication-boundary static and Node checks in node:22. Bash syntax and git diff --check also pass. The Quickshell runtime assertions remain compositor-gated, so they could not run in the container and I did not run this untrusted PR tree against the live desktop.

The current head already resolves Copilot's stale-facade and clone-service lookup comments, including the suppressed own-service case, and Erik's three Basecamp findings against 1702cf0b. With these three follow-up commits, I don't have any remaining blockers from this review.

Co-Authored-By: GPT-5.6 Sol <noreply@openai.com>
@ryanrhughes
ryanrhughes merged commit e78d89e into omacom:quattro Sep 7, 2026
@acrogenesis
acrogenesis deleted the security/plugin-auth-boundary branch September 7, 2026 14:03
ryanrhughes added a commit that referenced this pull request Sep 7, 2026
Backport plugin authentication boundary to 4.0.3 (#9618)
ryanrhughes added a commit that referenced this pull request Sep 8, 2026
Backport plugin authentication boundary to 4.0.3 (#9618)
VaheOfficial pushed a commit to VaheOfficial/DedMarchy that referenced this pull request Sep 9, 2026
…boundary

Restrict third-party plugin access to authentication services

(cherry picked from commit e78d89e)
VaheOfficial pushed a commit to VaheOfficial/DedMarchy that referenced this pull request Sep 9, 2026
Exercise production JavaScript from omacom#9485 and omacom#9618 together with a synchronous Qt test double. Cover keepLoaded identity, detached authentication retention, refreshed manifests, cleanup eligibility, sticky classification, and clone lookups without the unrelated video-wallpaper services alias. Native QObject, PAM, and Wayland validation remains separate.
VideoPants added a commit to VideoPants/OmarchySearch that referenced this pull request Sep 9, 2026
Omarchy 4.0.3 (omacom/omarchy#9618) replaced the injected `shell` with a
capability-scoped facade. `appLibrary` is only attached for the `menu`
kind, and the facade objects are revoked shortly after a keepLoaded overlay
loads, leaving `shell` null and the Apps category empty.

- manifest: declare `menu` alongside `overlay` to request appLibrary
- Search.qml: prefer shell.appLibrary when alive, otherwise read
  DesktopEntries directly with the same hidden-entry filters, icon lookup
  and uwsm-app/gtk-launch launch path as the built-in launcher; fall back
  to `omarchy-shell shell hide` over IPC in dismiss()
- Search.js: vendor AppSearch.js ranking so results match the stock menu
- README: document the incompatibility and the fix
drmikecrowe pushed a commit to drmikecrowe/omarchy-fido2-key-suite that referenced this pull request Sep 12, 2026
Omarchy added `capabilities: ["authentication"]` to the built-in lock
plugin's manifest (omacom/omarchy#9618). stampHostCapabilities()
propagates capabilities to clones through omarchy.clonedFrom, so this
fork inherits it -- and ensureService() files an authentication service
in the private AuthServiceStore rather than the registry serviceFor()
reads, deliberately, so credential-bearing QML stays unreachable from a
bar surface.

BarWidget was built entirely on serviceFor("erijl.lock"). That now
returns null however healthy the service is: keyPresent and configured
were false forever, so the glyph sat dim and read "Security key not set
up" with a key attached and both factors working.

Read presence over `omarchy-shell lock presence` instead. That call is
also how the widget registers interest, which is what watchPresence()
did before: an indicator cannot hold the service, so interest becomes a
lease it renews rather than a count it decrements -- a widget torn down
with its monitor cannot give a watcher back, but it does stop asking.
The service still owns the enumeration; this never touches the bus.

Separately, settings came only from shell.shellConfig, which an
installed third-party plugin never receives -- it is handed a
capability-scoped API carrying barConfig instead (omacom/omarchy#10830).
settings was therefore empty for every installed copy, and empty reads
as "not asked for", so lockOnUnplug and notifyOnKeyChange were off
however shell.json set them and the service stopped watching for the key
while unlocked. Fall back to barConfig, which holds the same bar-layout
entry. shellConfig is still preferred, so the fallback goes inert by
itself if #10830 is fixed upstream.

Tests cover both regressions, the lease lapsing, and the widget's
command bound like every other collected command in the plugin.

Co-Authored with Claude
@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