Skip to content

fix(auth): reject scoped capability re-rooting - #189

Draft
marcus-pousette wants to merge 1 commit into
fix/auth-docwide-writes-onlyfrom
fix/auth-stable-delegation-roots
Draft

marcus-pousette wants to merge 1 commit into
fix/auth-docwide-writes-onlyfrom
fix/auth-stable-delegation-roots

Conversation

@marcus-pousette

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

Copy link
Copy Markdown
Collaborator

Roadmap: Deferred from #38; #255 is the supersession gate.
Status: Scoped-capability work outside the first owner-only profile. Do not merge this stack; close it only after #255 removes or fails closed on the old scoped public surface.

Problem

A delegated capability could choose a different subtree root based on the receiver's current ancestry. Because ancestry changes with delivery order, peers could disagree about whether the delegation was valid.

What changes

  • A non-document-wide proof may delegate only at the same root.
  • It may still narrow actions/time, reduce maxDepth, or add exclusions.
  • A document-wide proof may still delegate a narrower root.
  • Remove scopeEvaluator from token parsing, recursive proof validation, and the public describe API.
  • Keep scope evaluators only for runtime read filtering and subtree authorization.

Token parsing/delegation is now deterministic from signed token data, trust, revocation, document, and time; mutable materialized ancestry is not an input.

Fast paths

  • Scoped delegation is a synchronous restriction comparison with no tree lookup.
  • Document-wide re-rooting and same-root narrowing remain supported.

Tests

  • same-root scoped delegation narrows permissions
  • scoped proofs cannot re-root
  • document-wide proofs can delegate a narrower root
  • action, time, depth, and exclusion restrictions remain enforced

Stack

Stacked on #188.

@marcus-pousette
marcus-pousette force-pushed the fix/auth-docwide-writes-only branch from da5ddf4 to bff75b8 Compare July 11, 2026 22:30
@marcus-pousette
marcus-pousette force-pushed the fix/auth-stable-delegation-roots branch 2 times, most recently from 8e0d3c0 to a60fc61 Compare July 11, 2026 23:00
@marcus-pousette marcus-pousette added bug Something isn't working area:auth Authorization, capabilities, proofs, signatures, crypto, and privacy labels Jul 12, 2026
@marcus-pousette
marcus-pousette force-pushed the fix/auth-docwide-writes-only branch from db233a2 to d3f633a Compare July 12, 2026 12:18
@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 changed the title fix(auth): make delegated roots ancestry-independent fix(auth): reject scoped capability re-rooting Jul 12, 2026
@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-docwide-writes-only branch 2 times, most recently from 3c84925 to f30990b 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-docwide-writes-only branch from f30990b to 891bb4c 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
@marcus-pousette
marcus-pousette force-pushed the fix/auth-docwide-writes-only branch from 891bb4c to a776700 Compare August 19, 2026 08:52
@marcus-pousette
marcus-pousette force-pushed the fix/auth-stable-delegation-roots branch from 0d1d338 to 659626a Compare August 19, 2026 08:52
@marcus-pousette
marcus-pousette force-pushed the fix/auth-stable-delegation-roots branch from 659626a to fc540b8 Compare August 20, 2026 11:30
@marcus-pousette
marcus-pousette force-pushed the fix/auth-docwide-writes-only branch from a776700 to d521dc1 Compare August 20, 2026 11:30
@marcus-pousette
marcus-pousette marked this pull request as draft August 31, 2026 13:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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