Skip to content

Verify ACP query events and bind channel routing - #7012

Draft
jmecom wants to merge 1 commit into
jm/verify-acp-relay-eventsfrom
jm/verify-acp-query-events
Draft

Verify ACP query events and bind channel routing#7012
jmecom wants to merge 1 commit into
jm/verify-acp-relay-eventsfrom
jm/verify-acp-query-events

Conversation

@jmecom

@jmecom jmecom commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

What changed

Verify every Nostr event returned by the ACP HTTP /query client before metadata or prompt-context consumers can inspect it. Responses now fail closed when an event is malformed, has an invalid NIP-01 ID or signature, or does not match any requested filter, including multi-character Buzz tags such as #buzz-channel.

Bind WebSocket channel delivery to the exact active subscription and require the event's signed h tag to match that channel. This prevents a relay from relabeling an authentic event into another channel or continuing delivery through an inactive subscription.

Safety and tradeoffs

Signature verification runs on the blocking pool once per HTTP response page. Any invalid event rejects the whole response instead of exposing a partially trusted result. Existing consumer-level checks remain as defense in depth.

This PR is stacked on #7010. Relay-signer authorization for membership notifications remains separate because it requires a configured relay trust anchor.

Testing

cargo test -p buzz-acp

cargo clippy -p buzz-acp --all-targets -- -D warnings

just ci

Signed-off-by: Jordan Mecom <jm@squareup.com>
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