Repository navigation
Open
Description
The workflow
I run a security-sensitive plugin — the client-side crypto endpoint of a "sealed mode" scheme: it intercepts HTTP(S) requests in bb's embedded browser and HPKE-seals them to pinned origin keys, so the CDN edge in between only sees ciphertext. The plugin is the trust anchor. Independent of provenance work (companion issue), the cheapest meaningful hardening is: the bytes that execute are the bytes the installer validated, checked at every activation.
What happens today (main @ 9b4f273)
hashInstallDiralready exists — a deterministic sha256 over the whole plugin tree (names, contents, modes, symlinks) — and is recorded per artifact in the DB.- It is re-checked on install/promote/dedup paths (
managed-plugin-artifacts.ts, e.g.:723/:997/:1189/:1432) — install-time bookkeeping, not activation. - The load path never compares:
plugin-runtime.tsloadOne()(called on server start, enable, reload, and rollback) only stats the directory, reads the manifest, and executes. plugin-activation.tsreloads the previous artifact on failure — if that directory drifted since it was recorded, rollback silently re-executes drifted code.- Plugins are full-trust in the bb server process: any plugin can write into another plugin's directory and wait for a reload.
What a load-time check would close
- Another plugin patching this one (see above).
path:drift — bad merge, build leftovers, an agent editing files, a crash mid-update leaving the DB and disk disagreeing.- Sync/backup/restore putting a modified copy back under the same
rootDir. - Rollback trusting drifted bytes — the exact moment you most want the check.
What it does not solve (so triage is honest)
- Provenance — the recorded hash is TOFU; if the install itself was compromised, the hash faithfully attests to the malicious bytes. That is the companion signature issue (Plugin supply chain: publisher signature verification + pin/verify mode for install/update #3523).
- Runtime prevention — this is tamper evidence at load time; a same-process peer can drift files after activation until the next reload.
- A compromised host account, which can rewrite the DB row holding the expected hash.
path:dev workflow as-is — in-place editing is the supported dev flow and reload rebuilds with the host toolchain (bb plugin reload rebuilds a path plugin with the host build, with no way for the plugin to supply its own #1863), so a hard refuse would break local plugins. Policy should be per source kind: enforce for immutable resolutions (npm exact + integrity, git commit), warn/allow forpath:.
What you would expect
- Compare disk to the recorded hash at
loadOne; on mismatch, refuse to activate (or load with a louddriftedstate, policy per source kind) and reuse the existing failed-load surface (PREVIOUS_INSTANCE_KEPT— "the previous instance is still running"). - A
driftedsignal inbb plugin listand logs, so it is visible without reading DB rows. - Tests covering: patched directory, post-install drift, rollback into drifted bytes, and the
path:allow/warn path.
Context and alternatives
- Everything needed already exists: the hash function, the per-artifact column, one choke point (
loadOne), the failure surface. This is a comparison + a policy switch + a signal + tests — no signing-scheme decision, no key distribution, no ecosystem work. - Adjacent: companion provenance issue (Plugin supply chain: publisher signature verification + pin/verify mode for install/update #3523 — publisher signatures + pin/verify mode); Add transactional prebuilt plugin generations with exact resident rollback #2690 (transactional prebuilt plugin generations + exact resident rollback); bb plugin reload rebuilds a path plugin with the host build, with no way for the plugin to supply its own #1863 (path plugin reload rebuilds with the host toolchain).
- Provenance: condensed investigation report — https://gist.github.com/cad0p/35a62a445538fd9915937fdb52b419f2 (base bb
main@9b4f273, 2026-09-11). Companion issues are the same driver.
Checks
- I searched open and closed issues for the same request.
- If an agent wrote this, the body ends with
> AGENT GENERATED.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 11, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotApplied Type: Feature, Priority: Medium, Effort: Medium, and labels:
plugins,security. No existing classification values were present.This adds activation-time integrity enforcement, source-specific policy, and drift visibility to existing installation checks. Final Type verified as Feature; reproduction report and fix steps skipped. No PR opened because this requires new policy and security behavior.