Repository navigation
Restrict third-party plugin access to authentication services - #9618
Conversation
74fae08 to
80fe49e
Compare
Reported-by: Roger Piñol <rogerpicar@gmail.com>
80fe49e to
1702cf0
Compare
Reported-by: Roger Piñol <rogerpicar@gmail.com>
There was a problem hiding this comment.
🟡 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
nullfor a non-barclone, even whenrequestedIdresolves to that clone's own service. For example, the clonedomarchy.mediawidget still callsfirstPartyServiceFor("omarchy.media")inshell/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.
Reported-by: Roger Piñol <rogerpicar@gmail.com>
|
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>
Co-Authored-By: GPT-5.6-Sol <noreply@openai.com>
Co-Authored-By: GPT-5.6-Sol <noreply@openai.com>
|
I reviewed current head
The final tree passed a clean 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 |
Co-Authored-By: GPT-5.6 Sol <noreply@openai.com>
Backport plugin authentication boundary to 4.0.3 (#9618)
Backport plugin authentication boundary to 4.0.3 (#9618)
…boundary Restrict third-party plugin access to authentication services (cherry picked from commit e78d89e)
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.
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
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
Summary
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:
_servicesand the reachable QObject graphPluginShellApi.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 facadebarConfiginjection now use deep snapshots rather than the live host configuration objectCompatibility 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 fixturebash ./test/shell.d/runtime-smoke-test.sh— malicious replacement-bar service/configuration probes and all existing runtime checks passqmllinton all changed QML entry points and facade typesgit diff --checkScope 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.