Skip to content

dweb: adopt the read-through sharing invariant (observer model) before data-bearing mesh surfaces land #318

Description

@NotASithLord

The invariant

Sharing a thing must never grant a recipient access to data they couldn't already read directly.

This is the core of Cloudflare OS's "observer" system (docs/observers.md in github.com/cloudflare/cloudflare-os), which is itself the Sandstorm information-flow lesson made practical. Their decomposition:

  1. Verify at attach. When Bob is granted access to a shared Gadget, each resource broker (Gatekeeper) verifies — against the vendor's own ACL, using a verifier minted by Bob's own account — that Bob could independently read everything the Gadget has ever ingested through it. Failure denies the share.
  2. Forward exclusion. After Bob is attached, any new read that Bob couldn't make directly is blocked (or explicitly excluded from him), rather than silently widening what the share leaks.
  3. Blunt stopgap first. Before the fine-grained system existed they shipped prohibitAllSharing: one maximally-sensitive observation ⇒ the thing can't be shared with anyone at all. All-or-nothing, but sound.
  4. Re-verification runs at every open (lazy, catches upstream revocation), and authorization keys off the durable sharing graph, never off live sessions.

Why peerd doesn't have this hole today

peerd shares code (signed bundles) and rooms (consent-gated overlays), never live instances; a running dwapp has no local storage at all (opaque origin); room data is knowingly public-to-room per the join consent dialog. So there is currently no surface where sharing transitively leaks third-party-readable data.

Why it's about to matter

Roadmap items that create exactly this surface:

Ask (deliberately modest)

  1. Name the invariant in docs/security/THREAT-MODEL.md now (an INV-nn): no mesh surface may relay data to a peer unless (a) the peer could read it independently, or (b) the user explicitly consented to disclosing that data to that peer. Cheap to write down, expensive to retrofit.
  2. Ship the blunt stopgap with the first data-bearing surface: a per-item "sharable / not sharable" bit checked at the serve boundary (peerd's equivalent of prohibitAllSharing), before any fine-grained system exists.
  3. Design the fine-grained version later, borrowing the decomposition: verify-at-attach + forward-blocking, keyed off durable grant state, lazily re-checked. In a P2P setting the "vendor ACL oracle" is usually absent, so expect most classifications to be Cloudflare OS's strategy A (private-only) or D (low-stakes/public) rather than B/C (oracle-checked) — which is fine; the taxonomy is the useful part.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions