Skip to content

fix(agent): verify remote DWN responses#1476

Merged
LiranCohen merged 7 commits into
mainfrom
fix/verify-remote-dwn-responses
Jul 25, 2026
Merged

fix(agent): verify remote DWN responses#1476
LiranCohen merged 7 commits into
mainfrom
fix/verify-remote-dwn-responses

Conversation

@LiranCohen

@LiranCohen LiranCohen commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • authenticate remote protocol configurations before they can drive encryption policy
  • authenticate returned RecordsWrite/RecordsDelete artifacts, bind them to the original query/read filter, and verify inline or streamed bytes against the signed CID and size
  • authenticate initial RecordsSubscribe snapshots with the same rules as RecordsQuery and close rejected subscriptions before endpoint fallback
  • verify app-facing signed and anonymous remote paths at each endpoint, pin lazy record reads to their original data version, and correct the anonymous subscription transport shape
  • disclose the security rationale and migration guidance for the removed social protocol catalog

Security boundary

  • protocol definitions used for encryption policy must be signed directly by the target DID
  • these checks prove artifact authorship and integrity, not response completeness, freshness, or target-tenant admission; those require a tenant-authenticated state commitment
  • RecordsCount values carry no signed artifact and remain assertions by the remote DWN
  • streamed bytes are authenticated at successful EOF; consumers that cannot tolerate an unauthenticated prefix must buffer through successful completion before using the bytes
  • initial subscription snapshots are verified, while subsequent live subscription events remain outside this response-verification boundary

Follow-ups

Test plan

  • bun run lint
  • bun run --filter @enbox/dwn-sdk-js build
  • bun run --filter @enbox/agent build
  • bun run --filter @enbox/api build
  • focused agent verifier, endpoint fallback, protocol-cache, and anonymous API tests
  • focused API lazy-record tests
  • full CI matrix and SonarCloud on the prior head; rerunning for the snapshot follow-up

@sonarqubecloud

Copy link
Copy Markdown

@LiranCohen
LiranCohen merged commit 00dafdf into main Jul 25, 2026
30 checks passed
@LiranCohen
LiranCohen deleted the fix/verify-remote-dwn-responses branch July 25, 2026 03:02
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.

1 participant