Repository navigation
Prevent duplicate Buzz surfaces from bypassing relay egress controls (VERIA-146) - #205
veria-ai[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedBot user detected. Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.
|
[Medium impact] The change reaches setup and routing for every surface kind. Update the affected CLI tests before merging; keep the new duplicate rejection.
|
| .refine( | ||
| (m) => new Set(m.surfaces.map((surface) => surface.kind)).size === m.surfaces.length, | ||
| { message: "surface kinds must be unique", path: ["surfaces"] }, | ||
| ) |
There was a problem hiding this comment.
Existing CLI tests now fail. This check rejects configurations that existing tests still expect to load.
register.test.ts loads two Buzz surfaces and checks their separate channel lists. run-directory.test.ts starts two Buzz surfaces and waits for a merged directory record. Both now fail before reaching those checks. The duplicate-relay case in rehearse.test.ts also expects the old error text. Keep the new rejection, but update these fixtures and assertions so the full test suite passes.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Security fix: Duplicate Buzz Surfaces Bypass Relay-Specific Egress Controls
What was wrong
packages/core/src/manifest.tsaccepted repeated surface kinds in non-private deployments, whilepackages/core/src/gateway.tsrouted replies through a map keyed only by kind. Multiple Buzz connections could therefore share public-channel consent and route a private conversation's reply through another relay and signer.What changed
packages/core/src/manifest.tsthat rejects repeated surface kinds with an error onsurfaces.buildAdaptersinpackages/cli/src/surfaces.ts, before constructing any adapters.Gatewayconstructor inpackages/core/src/gateway.tsto reject duplicate adapter kinds instead of overwriting an existing registration, before any adapter starts.Why this is safe
Rejecting duplicate kinds removes the ambiguous connection identity that allowed cross-relay consent reuse and reply routing. Configurations with one surface per kind retain their existing routing and egress behavior; configurations with repeated kinds now fail before adapters start.
Fixes VERIA-146
This PR was generated by Veria AI.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.