Skip to content

plugins: pre-ship hardening (security, stable names, forward compatibility) - #33069

Closed
nwparker wants to merge 86 commits into
nwparker/plugins-v2-15-extension-basefrom
nwparker/plugins-v2-16-ship-hardening
Closed

nwparker wants to merge 86 commits into
nwparker/plugins-v2-15-extension-basefrom
nwparker/plugins-v2-16-ship-hardening

Conversation

@nwparker

@nwparker nwparker commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 145 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3790 $\color{#cf222e}{\Huge{\mathbf{−}}}$​827 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2963
Prod 220 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5638 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2648 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2990

ELI5

This tightens the plugin system before it ships. It does two things. It closes several ways a plugin could do more than the person installing it agreed to. It also renames and simplifies the public plugin contract now, while no published plugins depend on the old names yet.

What Changed

Security changes (what a plugin can do)

  • Panels can no longer type into terminals. Before, a panel (the sandboxed web view a plugin adds) could send text plus Enter to a terminal, which runs commands on your machine or over SSH. Its consent line read "limited". Now only worker plugins can do this, and the consent line says "Type and run commands in your terminals, local and SSH".
  • Full-access plugins need a second setting. Worker plugins run unsandboxed Node. Turning on plugins is no longer enough to run them. A new setting, "Allow plugins that run code with full access", is off by default. While it is off, main refuses to install, approve, or start one, and shows an error that names the setting.
  • Approving a dev folder applies to that folder only. The approval now includes the folder's real path. Approving one dev folder no longer approves a different folder whose manifest claims the same name and permissions.
  • Panels cannot open WebRTC connections. CSP has no rule for WebRTC, so a panel could reach a server it controls even though connect-src is 'none'. The panel shell now removes RTCPeerConnection before plugin code runs, and the main window uses the same WebRTC IP policy as doc preview.
  • Language packs cannot rewrite trust wording. A content-only language pack could rename the "Official" badge, the file-type suggestion banner, or swap Allow and Deny on agent approvals. Those components now ignore plugin translations, the same way the plugin security dialogs already did.
  • Stricter Git URL checks. Every install path rejects URLs whose user or host starts with -, because ssh reads that as an option. It also rejects a host of .., and provenance parsing rejects .. path segments, so stablyai/../evil no longer reads as the official owner.
  • Updates that moved repository go to review. If the catalog now points an installed plugin at a different repository, the update dialog shows the old and new repository and leaves that update unticked. Main checks this too: such an update always comes back as "needs review" and is never approved in one click, even if the window asks.
  • Revocations reach long sessions. Orca used to download the plugin safety list only at launch or when plugins were turned on. It now also downloads it every 6 hours while plugins are on. If a plugin is on the list, it is disabled and stopped, as at launch.

Contract changes (names and formats plugin authors use)

  • Permissions renamed: storage → storage:own, secrets → secrets:own. events:subscribe is removed. Workspace events now need workspace:read, and agent status needs a new agents:read.
  • The public API now says "workspace" instead of "worktree": workspace.created / workspace.removed carry workspaceId and a kind. Folder workspaces are not git worktrees, so the old name was wrong for them.
  • The instructional execution profile is renamed to declarative.
  • Old clients and old plugins keep working. Format 1 manifests keep their old names, which are rewritten when parsed. v1 workers still receive worktree.* events.
  • Older clients now tolerate fields added later. Unknown theme tokens and icon slots are skipped at runtime (validate:plugin still rejects them). Unknown fields in the safety list and in consent requests are dropped instead of rejected. Catalog release types is now optional and is worked out from the other fields.
  • Panels get the design tokens as --orca-* CSS variables. Panel icons come from a fixed, documented list.
  • The publisher names orca, orca-*, official, anthropic, openai and github are reserved.
  • Housekeeping: plugin-service.ts and plugin-catalog-release.ts were over the line limit. The runtime policy checks (feature switch, safety list, full access) moved into plugin-activation-policy.ts, and the catalog type list and its derivation moved into plugin-catalog-types.ts.

Why

When a capability's consent wording doesn't match what it can actually do, the consent is misleading. Typing into a terminal is running commands. A worker is full access. An approval should cover only the bytes and folder the person reviewed. Each fix sits in main or in the panel shell, where it is enforced, and not only in the UI. For example, the repository-move check runs in main, so a renderer that skips its own check still cannot one-click approve an update from a moved repository. For the safety list, a 6-hour timer reuses the existing refresh path and its listeners, so a hit behaves exactly as it does at launch. Polling more often would add network traffic for little gain.

The contract renames happen now because renaming later would break published plugins and older clients forever. Each new field is optional or worked out from other fields because client and host versions update separately. Something required today cannot be dropped later without breaking older clients.

Accepted gap: a panel can still trigger DNS-prefetch lookups. Doc preview already accepts the same risk. Blocking it would mean changing Chromium networking for the whole window, and those lookups cannot carry data back.

Linked Issue

N/A (internal plugin-system work)

Visual Proof

Copy and setting changes only (consent wording, the full-access setting and card label, the moved-repository notice in update review). Screenshots to be attached.

Testing

  • pnpm tc passes.

  • Plugin, settings and sidebar unit suites pass. The release-tag test now passes (manifest v2 is gated on 1.4.240, set in feat(plugins): one documented schema for manifests and catalogs, with actionable errors #31087).

  • New tests: periodic safety-list refresh (picks up a revocation, stops when plugins are off). Installer flags a moved repository but not a different spelling of the same repository (https vs scp, case, .git). IPC returns needsReview for a moved repository with and without one-click.

  • Schema/doc generation produces no diff. pnpm run check:code-quality:changed, oxlint on changed files, and the localization checks pass.

  • Plugin e2e specs ran hidden (ORCA_BACKGROUND_LAUNCH=1), one at a time, on macOS.

  • Automated tests added/updated

Notes

  • SSH: terminal input from panels is blocked for both local and SSH terminals. The safety-list refresh runs in main and does not depend on where the work runs.
  • Backward compatibility: format 1 manifests and v1 workers keep their old names through rewriting at parse time. New wire fields are optional.
  • Cross-platform: no platform-specific code paths added.

@smwbev

smwbev commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

The new protected components reject existing language packs as a whole, not just the three components.

The description says these components "now ignore plugin translations", but isProtectedPluginTranslationPath is checked inside the catalog walk. So a pack with any key under them fails parsePluginLanguagePackArtifact and contributes nothing. components.native-chat.approval.* is ordinary UI copy that packs translate. This hits every community language pack I could find. I ran parsePluginLanguagePackArtifact from main and from this PR's head e4507f07de on each pack's catalog at the ref submitted to orca-plugins:

Pack Ref approval keys main e4507f07de
smwbev.russian (orca-plugins#13) v5.1.173 10 ok rejected
imgusev.russian-language-pack (orca-plugins#6) v1.4.230 8 ok rejected
taranttoola-create.russian (orca-plugins#9) v1.3.6 8 ok rejected
noobitoo.russian (orca-plugins#3) v1.0.7 8 ok rejected
moksa.zh-tw (orca-plugins#10) plugin-v3.0.3 8 ok rejected

All five fail with catalog cannot replace protected security copy at components.native-chat.approval. On the release that ships this, those users' interface goes back to English. Anyone who installed a pack from a pinned Git URL stays in English until they reinstall a newer pack.

A possible fix: skip these paths in the walk instead of failing it. The components then show Orca's own copy, which matches the description, and a pack still can't relabel Allow and Deny. Packs couldn't have left these keys out, because until now they were translatable.

Related: validate-plugin-files.mjs now runs the artifact parsers for themes, terminal themes and icon themes (artifactErrors), but not for languagePacks. For a manifest v2 copy of our pack it prints orca-plugin.json: ok and a release entry at e4507f07de, even though the same commit's parsePluginLanguagePackArtifact rejects the catalog. orca-plugins#16 pins its CI to a840e1b7f6 from this branch, so catalog CI would pass all five packs. With languagePacks in ARTIFACT_PARSERS, CI would catch this and the usual mistakes too: dotted keys and the 50,000-entry, depth and 8,192-character limits. Two details: parsePluginLanguagePackArtifact returns { ok, error } instead of throwing, and a language pack contribution is named by locale, not id.

smwbev added a commit to smwbev/orca-russian that referenced this pull request Oct 24, 2026
stablyai/orca#33069 protects three components outright: the native
chat approval card, the Official badge and the file type suggestion
banner. The list lives in plugin-language-pack-artifact.ts, not in
plugin-translatable-chrome.ts, so build.py and audit-pack.py would
have kept those keys and called a pack the engine rejects accepted.

Both now read PROTECTED_TRANSLATION_COMPONENTS from the release's
engine module, at either of its two paths. audit-pack.py also reads
the entry limit there, takes --artifact offline, and stops instead of
printing a verdict when the module declares a protection rule it does
not model. Releases up to v1.4.239 have no such list, so today's
build is unchanged byte for byte.
@nwparker
nwparker force-pushed the nwparker/plugins-v2-15-extension-base branch from 1e67b57 to 83c3d6f Compare October 24, 2026 11:56
@nwparker
nwparker force-pushed the nwparker/plugins-v2-16-ship-hardening branch from e4507f0 to f429e40 Compare October 24, 2026 11:56
@nwparker
nwparker force-pushed the nwparker/plugins-v2-15-extension-base branch from 83c3d6f to 9e00b8c Compare October 24, 2026 13:43
@nwparker
nwparker force-pushed the nwparker/plugins-v2-16-ship-hardening branch from f429e40 to d4473fb Compare October 24, 2026 13:43
@nwparker
nwparker force-pushed the nwparker/plugins-v2-15-extension-base branch from 9e00b8c to f13d06c Compare October 25, 2026 05:23
@nwparker
nwparker force-pushed the nwparker/plugins-v2-16-ship-hardening branch from d63420c to 0ad69ec Compare October 25, 2026 05:23
@smwbev

smwbev commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

An update for the current head 0ad69eca85: 67b6fc0 adds five more protected components, so the whole-pack rejection from my comment above now covers far more copy.

Each pack's catalog at the ref submitted to orca-plugins, keys under PROTECTED_TRANSLATION_COMPONENTS, run through parsePluginLanguagePackArtifact from each ref:

Pack Keys under protected components main 0ad69eca85
smwbev.russian v5.1.174 151 ok rejected
imgusev.russian-language-pack v1.4.239 151 ok rejected
taranttoola-create.russian v1.3.6 102 ok rejected
noobitoo.russian v1.0.7 102 ok rejected
moksa.zh-tw plugin-v3.0.3 106 ok rejected

Besides components.native-chat.approval, every pack now hits three of the new components: auto.components.sidebar.OrcaYamlTrustDialog, auto.components.editor.IpynbViewer and browser.loadFailure. Ours and imgusev's also hit auto.components.browserPane.sitePermission and settings.browser.sitePermissions.

Two of the new prefixes reach well past the prompts named in the commit:

  • auto.components.editor.IpynbViewer is the namespace of the whole notebook editor: 61 keys read from seven files, among them the cell toolbar, the kernel toolbar and the kernel setup dialog. The run-code prompt (IpynbViewer.tsx, lines 266–280) uses 4 of them.
  • browser.loadFailure is the whole browser error page: 33 keys. The certificate warning uses 10 of them (connectionNotSecure, proceedUnsafe and the eight certificate* keys). The other 23 are the ordinary error page: can't reach the host, DNS, refused, timeout, offline, the SSH route, Retry and Open Externally.

The fix from my comment still applies: skip protected paths in the walk instead of failing it. If these components should stay protected, listing the trust keys would keep the rest of the notebook editor and the error page translatable. Dropping the keys ahead of time doesn't help packs either: users on v1.4.240 would lose those translations today, and installs from a pinned Git URL would never get the new pack.

@nwparker
nwparker force-pushed the nwparker/plugins-v2-15-extension-base branch from f13d06c to 3adb64b Compare October 26, 2026 08:17
@nwparker
nwparker force-pushed the nwparker/plugins-v2-16-ship-hardening branch 2 times, most recently from 3fedbac to efe308c Compare October 26, 2026 12:04
@smwbev

smwbev commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Thanks for loading packs that cover protected copy instead of refusing them. On efe308c963 all five community packs load again. Each catalog at the ref submitted to orca-plugins, run through parsePluginLanguagePackArtifact from that head:

Pack Protected keys dropped 'tolerant' (load) 'strict' (validate:plugin)
smwbev.russian v5.1.175 154 ok rejected
imgusev.russian-language-pack v1.4.240 151 ok rejected
taranttoola-create.russian v1.3.6 102 ok rejected
noobitoo.russian v1.0.7 102 ok rejected
moksa.zh-tw plugin-v3.0.3 106 ok rejected

The loaded catalogs also pass checkPluginLanguagePackCatalog in the renderer store, and coverage is unchanged, since protected paths were already outside its denominator.

One small thing for authors: strict mode stops at the first protected path, so validate:plugin names one component per run. Ours covers six of them, so getting clean from the validator output alone takes six runs. Naming every protected path in a single error would make that one pass.

@nwparker
nwparker force-pushed the nwparker/plugins-v2-15-extension-base branch from 22f0f85 to f22dea6 Compare October 26, 2026 12:32
@nwparker
nwparker force-pushed the nwparker/plugins-v2-16-ship-hardening branch from efe308c to b04037f Compare October 26, 2026 12:32
@blacksmith-sh

This comment has been minimized.

@nwparker
nwparker force-pushed the nwparker/plugins-v2-15-extension-base branch from f22dea6 to 6c98339 Compare October 28, 2026 04:59
@nwparker
nwparker force-pushed the nwparker/plugins-v2-16-ship-hardening branch from 3fb174f to 66f6cb3 Compare October 28, 2026 04:59
@nwparker
nwparker force-pushed the nwparker/plugins-v2-15-extension-base branch from 6c98339 to 07b68ee Compare October 28, 2026 05:31
@nwparker
nwparker force-pushed the nwparker/plugins-v2-16-ship-hardening branch from 66f6cb3 to dca9872 Compare October 28, 2026 05:31
@nwparker
nwparker force-pushed the nwparker/plugins-v2-15-extension-base branch from 07b68ee to 324702c Compare October 28, 2026 05:46
@nwparker
nwparker force-pushed the nwparker/plugins-v2-16-ship-hardening branch from dca9872 to c58df2c Compare October 28, 2026 05:46
@blacksmith-sh

This comment has been minimized.

…vents by domain capability

events:subscribe and the events.subscribe host method are gone; workspace events need
workspace:read and agent status needs the new agents:read. Format 1 manifests keep their old
names, rewritten on parse.
Events become workspace.created/removed with workspaceId and a kind field, agent status
carries workspaceId, and command context/keybinding when use workspace. Format 1 names are
rewritten on parse, v1 workers still receive worktree.* handlers, and clients treat any
non-global context from older hosts as workspace-scoped.
Format 2 keeps contributes.agents empty like every reserved point; format 1 entries, which
Orca never read, are dropped on parse so they stay inert and bind no content.
nwparker and others added 26 commits October 28, 2026 03:44
The page offered Install & enable even with full access off, then failed with a generic error.
It now shows the card's 'Turn on in settings' action, names the real reason when main refuses,
and drops a stale install error once the full access setting changes.
…it crashed

Language packs and other data plugins have no code or logs, so a load failure now reads
"Couldn't load its files" on the page and the row instead of "Its code kept crashing".
…n page

Built-in actions such as Open Board and Go Back are disabled while Settings covers the app,
so Run on the plugin page always failed. Run now closes Settings, commits that synchronously
so the dispatcher sees the app view, then runs the action.
…anel approvals

Panels get no host method that types into a terminal, yet a panel's approval listed
"Type and run commands in your terminals". Format 2 manifests now fail validation when a
profile below trusted-worker asks for terminal:send, and approvals, the access section and
update review drop that line for format 1 panels that still declare it.
The menu said "Catalog sources…" but the dialog it opens said "Marketplace sources" and
asked for orca-marketplace.json. Plugin copy now says catalog in every locale, names
orca-catalog.json (still accepting the older file), and the author guide matches the UI.
Internal identifiers and settings keys are unchanged.
Update review shows one line per plugin and only what's new for updates
that need approval, with the rest behind a See all access disclosure.
Consent, Can access, dialogs, settings menu and empty states drop restated
titles and filler; safety facts (new access, full access = files/network)
stay visible where the user decides.
Plugin app themes now fill a Light theme or Dark theme slot by their base. Orca paints the
slot for its current mode, so under System it swaps live with the OS. Appearance shows both
pickers grouped by plugin; install fills the matching slot(s) and Switch back restores them.
A legacy single selection migrates into its base's slot.
…ate; load language packs that cover protected copy
Menus, popovers, selects, hover cards, sheets and dialogs painted a fixed
glass tint (dialogs rgb 23,23,23 in dark mode), so a plugin theme's
--popover was ignored and a true-black theme still showed grey dialogs.
The tint now lives in --floating-surface / --dialog-surface, which a
plugin theme replaces with its --popover.
… of initials

The installed carousel pages with its arrows and snap points; the native
scrollbar under it only added a stray bar. Format 1 catalog listings (the
official catalog until catalog v2 publishes) carry no release types or
images, so their cards fell back to a two-letter monogram. Art now reads
the kind from catalog categories, and the last fallback is a plugin glyph.
…ls to their catalog

Reserved publishers (stablyai, official, anthropic, openai, github, orca*; case-insensitive)
and orca-* ids now install only from Orca's official catalog: a Git URL, local folder or any
other catalog is refused, and a third-party catalog listing one is refused whole. The rule lives
in one import-free module the directory indexer can vendor; validate:plugin uses it too and
warns when publisher differs from the origin remote's owner.

A marketplace install never replaces one recorded from a different catalog; switching means
remove and reinstall. Docs state the publisher == repository owner policy (enforced by the
official and community catalog CI, not a new runtime field).
…g an install

The chip beside a plugin now says where trust comes from: the Official mark for Orca's catalog,
otherwise the catalog name and the owner parsed from its Git URL (github.com/acme,
gitlab.com/acme/tools), never manifest text; Dev · unverified for development folders and
Unverified for Git URL installs. An installed plugin's page says which other catalogs list it.
…timeout

Install and update review each fetch a plugin over Git. On a loaded machine that
took 25-30s with or without the publisher checks, past the 10s expect default,
so the test read as stalled on Installing…
Shows "Alpha: The plugin interface may change. Expect nuances." under the
Plugins title until dismissed; dismissal persists in UI state
(pluginsAlphaNoticeDismissed). Localized in all locales, with unit and e2e
coverage for show-by-default and dismiss-across-reload.

Co-Authored-By: Claude <[email protected]>
…dled installs

Removes the bundled copy and its fallback-catalog listing. On startup, bundled
bootstrap now uninstalls any previously bundled plugin this release no longer
ships, so existing users don't keep a protected entry they cannot remove.
Removal code moves to plugin-removal.ts to keep plugin-install.ts under the
line limit.

Co-Authored-By: Claude <[email protected]>
… review

Each save now writes its own uniquely named temp file and treats a rename
failure as success when a concurrent writer already produced the same
content-addressed file. A cache failure now only drops the image from the
preview or catalog refresh instead of failing it.
…w's New list

Recipes always counted as new because their commands live in files the
manifest diff cannot see. Main now reads what each recipe can run (id,
checkout mode, commands) from the installed tree and the preview's staging
tree, and only a recipe that runs something new asks for review. An
unreadable file still counts as new.
…Colors

Theme files gain optional tokenColors (TextMate scope -> foreground/fontStyle).
The derived Monaco theme maps them onto Monaco's token names, the plugin-syntax
legend and raw TextMate scopes; unreadable colors are dropped.
@nwparker
nwparker force-pushed the nwparker/plugins-v2-16-ship-hardening branch from c58df2c to 67b5e44 Compare October 28, 2026 10:53
@nwparker nwparker mentioned this pull request Oct 28, 2026
7 of 9 tasks
@nwparker

Copy link
Copy Markdown
Contributor Author

Folded into #35470 (Plugin Alpha), which lands the rest of the plugin stack in one PR.

@nwparker nwparker closed this Oct 28, 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.

2 participants