Inbound Nostr sync accepts calendar events from any pubkey: takeover of local events and unmoderated catalog injection #71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
wait_for_nostr_eventssubscribes to every kind 31922/31923 on the relays (nostr_sync.py:140-144) and_handle_calendar_eventupserts whatever arrives. Correlation is bydtag, and our own published events used = event.id, so the id of any approved event is public. If a row matches and the incomingcreated_atis newer, the row's name, info, dates, banner, location and categories are overwritten (nostr_sync.py:93-101) with no comparison of the incomingpubkeyagainst the signer the publisher used for that event. If nothing matches, a new row is inserted withwallet=""andstatus="approved"(nostr_sync.py:108-118), bypassing the proposed/approved workflow and landing straight inGET /api/v1/events/public. An attacker can keep bumpingcreated_atto re-win against legitimate republishes. The task runs on every start (__init__.py:126).Fix direction: only apply an update when the incoming
pubkeyequals the pubkey recorded for the event's owner wallet signer (store it on the row at publish time); never insert discovered events asapproved(a separatediscoveredstatus or table, or drop them); scope the REQ with anauthorsfilter to known signer pubkeys. The sync feature was added in aiolabs/events#5/#15 with no trust model; this is the inbound counterpart of the outbound custody hardening inapi_event_update.Found during reforge run #1 (sandbox events#9).