state-before calculation may be incorrect with conflicting prev events #2016

Open
opened 2026-07-17 14:41:14 +00:00 by nex · 0 comments
Owner

This series of events was observed (forgive the artistic skills i cba ascii-art'ing this):
image

This then resolved incorrectly: the INVITE event was elided from the state before JOIN:

conduwuit_service::rooms::event_handler::handle_outlier_pdu: Checking based on auth events
conduwuit_service::rooms::event_handler::handle_outlier_pdu: PDU passed checks and has been persisted as an outlier
conduwuit_service::rooms::event_handler::handle_incoming_pdu: Fetching and persisting any missing prev events
conduwuit_service::rooms::event_handler::fetch_prev: No missing prev events. elapsed=23.81µs
conduwuit_service::rooms::event_handler::upgrade_outlier_pdu: Upgrading PDU from outlier to timeline
conduwuit_service::rooms::event_handler::pdu_checks: Resolving state at event
conduwuit_service::rooms::event_handler::pdu_checks: Running state-before auth check
[BAD] conduwuit_core::matrix::state_res::event_auth: sender cannot join as they are not invited to the invite-only room sender=@boat:starstruck.systems membership_event_id=None membership="leave"
conduwuit_service::rooms::event_handler::upgrade_outlier_pdu: Event authorisation fails based on the state before the event

membership_event_id should've been INVITE and membership should've been invite, but for some reason INVITE seemingly was elided from the resolved state before the event.

This is particularly harmful as this causes an erroneous rejection, which will not self-heal, and requires administrator intervention to fix.

This series of events was observed (forgive the artistic skills i cba ascii-art'ing this): ![image](/attachments/fa78825a-9b9c-46e3-a55d-961a33491fdf) This then resolved incorrectly: the INVITE event was elided from the state before JOIN: ``` conduwuit_service::rooms::event_handler::handle_outlier_pdu: Checking based on auth events conduwuit_service::rooms::event_handler::handle_outlier_pdu: PDU passed checks and has been persisted as an outlier conduwuit_service::rooms::event_handler::handle_incoming_pdu: Fetching and persisting any missing prev events conduwuit_service::rooms::event_handler::fetch_prev: No missing prev events. elapsed=23.81µs conduwuit_service::rooms::event_handler::upgrade_outlier_pdu: Upgrading PDU from outlier to timeline conduwuit_service::rooms::event_handler::pdu_checks: Resolving state at event conduwuit_service::rooms::event_handler::pdu_checks: Running state-before auth check [BAD] conduwuit_core::matrix::state_res::event_auth: sender cannot join as they are not invited to the invite-only room sender=@boat:starstruck.systems membership_event_id=None membership="leave" conduwuit_service::rooms::event_handler::upgrade_outlier_pdu: Event authorisation fails based on the state before the event ``` `membership_event_id` should've been INVITE and `membership` should've been `invite`, but for some reason INVITE seemingly was elided from the resolved state before the event. This is particularly harmful as this causes an erroneous *rejection*, which will not self-heal, and requires administrator intervention to fix.
nex self-assigned this 2026-07-17 14:41:14 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity#2016
No description provided.