Skip to content

fix(dig-node): gate cache.listCached behind the local control token (#2108) - #196

Merged
MichaelTaylor3d merged 3 commits into
mainfrom
loop/2108-gate-listcached
Aug 7, 2026
Merged

fix(dig-node): gate cache.listCached behind the local control token (#2108)#196
MichaelTaylor3d merged 3 commits into
mainfrom
loop/2108-gate-listcached

Conversation

@MichaelTaylor3d

Copy link
Copy Markdown
Contributor

Closes #2108 (super-repo DIG-Network/dig_ecosystem#2108).

Problem: cache.listCached is reachable unauthenticated over the HTTP rpc surface, so any local process — including a cross-site page POSTing to the loopback node (DNS-rebinding / local-service attack) — can enumerate the operator's full cached-capsule inventory (storeId:rootHash, sizes, LRU order), deanonymizing what content the user has consumed.

Fix: gate cache.listCached behind the same local control-token authorization the other holder-revealing cache.* methods already require (server.rs:990). FFI/in-process callers are unaffected; anonymous public content reads stay open. WS-path parity checked (gated or provably unroutable).

TDD: failing regression test first (unauthenticated cache.listCached must be rejected with no list leaked; authorized token returns the list). Coherence sweep: SPEC.md (both crates) + README + SYSTEM.md local-RPC auth contract + docs.dig.net + DEVELOPMENT_LOG. Version fix: patch 0.100.0→0.100.1 (modules/apps nightlies).

Draft = loop salvage anchor; implementation in progress.


Generated by Claude Code

claude added 3 commits August 7, 2026 13:52
Salvage anchor for the loop lane; real change follows.

Co-Authored-By: Claude <noreply@anthropic.com>
…ver HTTP (#2108)

`cache.listCached` was reachable UNAUTHENTICATED over the loopback HTTP `rpc`
surface, so any local process — including a cross-site page POSTing to the
loopback node (DNS-rebinding / local-service attack) — could enumerate the
operator's full cached-capsule inventory (storeId:rootHash, sizes, LRU order),
deanonymizing what content the user has consumed.

Extend the existing holder-revealing `cache.*` HTTP landing gate to ALSO require
the master control token or a valid paired token for `cache.listCached`, exactly
like `cache.fetchAndCache`/`cache.pushCapsule`. An unauthorized call is rejected
UNAUTHORIZED (-32030) with no inventory in the body. The in-process FFI `cache.*`
path is unaffected (never reaches this handler); anonymous public CONTENT reads
stay open.

WS parity (#2032 lesson for reads): `cache.*` is NOT routable over `/ws` — the
`ws_dispatch` fall-through hits `WalletBackend::dispatch`, whose match has no
`cache.*` arm — so the HTTP gate is the only reachable surface. Asserted by test.

Co-Authored-By: Claude <noreply@anthropic.com>
…est (#2108)

Co-Authored-By: Claude <noreply@anthropic.com>
@MichaelTaylor3d
MichaelTaylor3d marked this pull request as ready for review August 7, 2026 14:32
@MichaelTaylor3d
MichaelTaylor3d merged commit cb60a57 into main Aug 7, 2026
14 checks passed
@MichaelTaylor3d
MichaelTaylor3d deleted the loop/2108-gate-listcached branch August 7, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants