Skip to content

Keep plugin scan fields separate from manifest contents - #17283

Closed
acrogenesis wants to merge 1 commit into
omacom:quattrofrom
acrogenesis:fix/plugin-scan-provenance
Closed

acrogenesis wants to merge 1 commit into
omacom:quattrofrom
acrogenesis:fix/plugin-scan-provenance

Conversation

@acrogenesis

@acrogenesis acrogenesis commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Plugin discovery uses line markers around raw manifest contents. A malformed manifest already present in the discovered directory can be interpreted as a scanner-issued record, enter the first-party map and replace a bundled registry entry.

The supported omarchy plugin add path validates JSON and reserved IDs in a hidden staging directory before publishing the plugin. It rejects the malformed payload used by this regression, installs nothing and never requests a rescan. The regression writes directly into a discovered directory; it does not demonstrate an installation-path vulnerability. This change is parser hardening, and a reachable security issue has not been established.

Use three NUL-terminated fields for origin, source and manifest, and retain the previous registry when a scan is incomplete. Newlines and old markers remain payload data. The scanner and consumer change together inside PluginRegistry.qml.

The included Muro 0.20.3 evidence proves that framing and reading any field preserves both its contents and the entire following stream. A checksum-pinned CI job checks that evidence and audits mutations of the two modeled functions. test/formal/README.md describes the proof boundary and its connection to the Bash/QML implementation.

Validation:

  • The actual-scanner/parser regression fails on base 1843592f2 when a local manifest replaces the bundled authentication source, and passes with the fix.
  • Native Quickshell registry checks pass, including NUL preservation through Process/StdioCollector and newlines in source paths. Truncated scans retain the previous registry.
  • Muro evidence checks; mutation audit: 7 killed, 0 surviving, 7 discarded, 0 out of fuel.
  • Plugin authentication-boundary, manifest/entrypoint and plugin contract checks pass. Startup, menu/panel and idle-spawn performance guards pass.
  • Full shell suite: 360 of 414 files completed without failure (10 contain skips); all 54 failing files also fail when run individually on the untouched base. These include host mise-shim failures in scratch homes, existing assertions and companion-package mismatches. One looping OpenClaw probe was terminated, and its base comparison was bounded. The base commit's existing upstream test check is also failing.

The Muro proof establishes the framing property of the model. It does not establish attacker reachability or security severity.

@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Critical impact] Plugin scans control provenance at the authentication-service boundary.

The incomplete-scan fallback needs to reject failed scans that stop between records before this is merged.

Findings

  1. P1 Failed scans remove plugins ▶

Summary

The PR separates scanner-issued origins and source paths from manifest contents using three NUL-terminated fields.

  • Plugin scans keep manifest text separate from trusted origins.
  • CI checks that framed plugin fields keep their boundaries.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Bash scanner] --> B[Origin NUL source NUL manifest NUL]
  B --> C[Quickshell collector]
  C --> D{Complete field groups?}
  D -->|No| E[Keep previous registry]
  D -->|Yes| F[Parse manifests and stamp trust]
  F --> G[Replace registry]
  H[Scan stops between records] --> D
Loading

Reviews (1) · Last reviewed commit: "Keep plugin scan payloads from forging t..." · Reviewed by Greptile

Comment on lines +608 to +609
var fields = String(text || "").split("\0")
if (fields.pop() !== "" || fields.length % 3 !== 0) {

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.

P1 Failed scans remove plugins

If the scanner stops between records, this check accepts its partial output as complete. Each whole record has three fields and ends with NUL, so even empty output passes. scanProcess.onExited also ignores exitCode.

The parser then replaces installedPlugins with the partial map, causing the shell to remove missing services and widgets instead of keeping the previous registry. Require successful scan completion before replacing the map, and test truncation between records alongside the existing missing-final-NUL case.

@acrogenesis
acrogenesis marked this pull request as draft November 1, 2026 19:52
@acrogenesis acrogenesis changed the title Keep plugin scan payloads from forging trusted origins Keep plugin scan fields separate from manifest contents Nov 1, 2026
@acrogenesis

Copy link
Copy Markdown
Member Author

Closing this. The scanner change hardens a framing path that add and update never publish: both require one JSON manifest before the plugin directory is visible to discovery. After enable, the plugin is already unsandboxed code in the shell, so a later rewrite of its own manifest does not cross a new boundary.

The Muro proof checks a separate framing model, and the incomplete-scan guard still accepts a scan that stops on a finished record. That is not enough to keep a new formal-check workflow in tree.

@acrogenesis acrogenesis closed this Nov 1, 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.

1 participant