Phase 1 threat model¶
Controls: forced PostgreSQL RLS with app.tenant_id; explicit permission checks; default-deny plugin capabilities; CSP/safe React rendering; no arbitrary plugin JS; mediated outbound HTTP for Wasm; redacted structured logging; request/execution limits; Wasm fuel/time/memory limits; signed-artifact verification fields; secure cookie/CSRF design for BFF sessions; non-root containers; CI dependency/container/secret scanning hooks; narrow CORS; problem+json errors. Threats considered include tenant bypass, confused deputy plugins, privilege escalation, forged workspace IDs, CSRF, XSS, SSRF, secret leakage, file access, event replay, duplicate delivery, malicious packages, migration tampering, supply-chain compromise, audit exposure, DoS, and insecure containers.
Plugin supply-chain attack mitigations¶
Core out-of-box plugins such as Contacts are high-trust components and must be treated as release artifacts, not casual local code. The plugin manifest now carries [supply_chain] metadata for distribution type, source repository, source revision, provenance, artifact digest, signature, and SBOM. Core out-of-box plugins must provide the complete set so installers can verify origin, integrity, build identity, and dependency inventory before enablement.
Equivalent controls apply to any plugin according to distribution risk: reserved namespaces prevent impersonation of platform.* plugins; artifact digests pin installed versions; signatures and provenance attestations bind artifacts to reviewed source and CI; SBOM scanning detects vulnerable or prohibited dependencies; and upgrade reviews flag capability, permission, migration, outbound-network, secret, and event-publishing changes before rollout. See docs/plugins/supply-chain.md for the detailed control set.
Record drafts in the browser¶
Record drafts (ADR 0036) make the authenticated origin keep record values on disk for the first time: what a member read and typed into a record form, in IndexedDB, until they save, discard, sign out or it expires (7 days by default, at most 90). Each draft is encrypted with AES-256-GCM under a non-extractable per-workspace key derived (HKDF-SHA-256) from a random per-browser key that the server holds in draft_keys and returns only to a browser session of the same user, with Cache-Control: no-store. The key lives in page memory only; the associated data binds each payload to its member, workspace and draft id. Plain metadata (ids, the draft key of record ids and API names, times, sizes) stays readable so expiry and clearing work without the key.
What this protects: a copy of the browser profile, or a later user of the same computer account, once the member's session has ended; sign-out deletes the drafts and then the key, so an interrupted deletion still leaves nothing readable; a different member signing in clears the previous member's drafts before anything renders, and could not decrypt them anyway. What it does not protect: someone using the member's live session in the same browser, or script running in the origin, which could read the form itself; the content security policy and the rule against third-party script in the authenticated origin (ADR 0005) remain the defence there. A database copy holds the per-browser keys but no drafts, which never reach the server. Browsers may evict drafts under storage pressure; they are best-effort.