Skip to content

fix(auth): fail closed on unsafe scoped op-log projection#190

Open
marcus-pousette wants to merge 2 commits into
fix/auth-stable-delegation-rootsfrom
fix/auth-safe-oplog-projection
Open

fix(auth): fail closed on unsafe scoped op-log projection#190
marcus-pousette wants to merge 2 commits into
fix/auth-stable-delegation-rootsfrom
fix/auth-safe-oplog-projection

Conversation

@marcus-pousette

@marcus-pousette marcus-pousette commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Problem

Sync filters reconcile historical operations, but the subtree evaluator only sees current materialized ancestry. A node can enter a private subtree and later re-enter readable state; filtering from current membership can then reveal its private destination or payload history.

Simply omitting a required operation is also unsafe because it changes the selected causal op set and can leave the receiver stale.

What changes

  • The reference COSE/CWT auth implementation requires document-wide read_structure for both Filter.all and Filter.children.
  • Payload updates, payload clears, and payload-bearing inserts additionally require document-wide read_payload.
  • Unsafe projections reject as a whole instead of trying to redact individual historical operations.
  • Filters may still reduce reconciliation work; they no longer reduce the authorization scope.
  • Custom SyncAuth implementations remain free to provide a different authenticated projection format.
  • Obsolete current-membership projection tests are replaced with fail-closed coverage.

Fast paths

  • Structure-only batches need only read_structure.
  • Peers with document-wide grants keep the direct allow path.
  • Backend children filtering and the existing reconciliation optimizations remain available.

Tests

  • private destinations and history remain hidden after a node re-enters readable state
  • structure-only projections work without payload authority
  • payload updates, clears, and inline payload inserts require read_payload
  • playground scoped projections fail closed

Stack

Stacked on #189.

@marcus-pousette
marcus-pousette force-pushed the fix/auth-stable-delegation-roots branch from 8e0d3c0 to a60fc61 Compare July 11, 2026 23:00
@marcus-pousette
marcus-pousette force-pushed the fix/auth-safe-oplog-projection branch from 9b37f32 to 54181f6 Compare July 11, 2026 23:01
@marcus-pousette marcus-pousette added bug Something isn't working area:auth Authorization, capabilities, proofs, signatures, crypto, and privacy area:api Public interfaces, bindings, events, and cross-backend contracts labels Jul 12, 2026
@marcus-pousette
marcus-pousette force-pushed the fix/auth-stable-delegation-roots branch from a60fc61 to 93b6c16 Compare July 12, 2026 12:18
@marcus-pousette
marcus-pousette force-pushed the fix/auth-safe-oplog-projection branch from 54181f6 to 3c84eae Compare July 12, 2026 12:18
@marcus-pousette
marcus-pousette force-pushed the fix/auth-stable-delegation-roots branch from 93b6c16 to 0e47034 Compare July 13, 2026 14:07
@marcus-pousette
marcus-pousette force-pushed the fix/auth-safe-oplog-projection branch 2 times, most recently from 76a4623 to b8a38ac Compare July 13, 2026 15:06
@marcus-pousette
marcus-pousette force-pushed the fix/auth-stable-delegation-roots branch from 0e47034 to 34ce166 Compare July 13, 2026 15:06
@marcus-pousette
marcus-pousette force-pushed the fix/auth-safe-oplog-projection branch from b8a38ac to afc0fe2 Compare July 13, 2026 15:50
@marcus-pousette
marcus-pousette force-pushed the fix/auth-stable-delegation-roots branch from 34ce166 to 0d1d338 Compare July 13, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:api Public interfaces, bindings, events, and cross-backend contracts area:auth Authorization, capabilities, proofs, signatures, crypto, and privacy bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant