Skip to content

Prevent duplicate Buzz surfaces from bypassing relay egress controls (VERIA-146) - #205

Open
veria-ai[bot] wants to merge 1 commit into
mainfrom
veria/146-duplicate-buzz-surfaces-bypass-relay-spe
Open

veria-ai[bot] wants to merge 1 commit into
mainfrom
veria/146-duplicate-buzz-surfaces-bypass-relay-spe

Conversation

@veria-ai

@veria-ai veria-ai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Security fix: Duplicate Buzz Surfaces Bypass Relay-Specific Egress Controls

What was wrong

packages/core/src/manifest.ts accepted repeated surface kinds in non-private deployments, while packages/core/src/gateway.ts routed 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

  • Added a uniqueness check in packages/core/src/manifest.ts that rejects repeated surface kinds with an error on surfaces.
  • Added the same check at the start of buildAdapters in packages/cli/src/surfaces.ts, before constructing any adapters.
  • Changed the Gateway constructor in packages/core/src/gateway.ts to reject duplicate adapter kinds instead of overwriting an existing registration, before any adapter starts.
  • Added regression tests in the manifest, adapter-construction, and gateway test files covering duplicate kinds, public/private Buzz configurations, and programmatic callers that bypass manifest validation.

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.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot 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.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches setup and routing for every surface kind.

Update the affected CLI tests before merging; keep the new duplicate rejection.

Fix All in Claude CodeFindings

  1. P1 Existing CLI tests now fail ▶

Reviews (1) · Last reviewed commit: "Prevent duplicate Buzz surfaces from byp..." · Reviewed by Greptile

Comment on lines +1297 to +1300
.refine(
(m) => new Set(m.surfaces.map((surface) => surface.kind)).size === m.surfaces.length,
{ message: "surface kinds must be unique", path: ["surfaces"] },
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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!

Fix in Claude Code

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.

0 participants