mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Security: any relay member could add any agent to any channel because
channel_add_policy defaulted to 'anyone'. Two targeted fixes:
1. Migration 0005 changes the column default from 'anyone' to 'owner_only'
so new agents start safe on all relays.
2. BUZZ_AGENT_SHARING_DISABLED=true enables relay-wide enforcement:
- kind:9000 PUT_USER targeting an agent is rejected unless the actor
is the agent's owner (pre-storage, returns NIP-01 NOTICE).
- kind:10100 setting channel_add_policy='anyone' is blocked (the DB
column is not updated; the event is stored but has no effect).
- On startup, all existing channel_add_policy='anyone' rows are
clamped to 'owner_only' (idempotent, runs every restart while
the flag is set).
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>