Skip to content

State resets or blank timelines if origin's /get_missing_events omits key auth events #19970

Description

@gamesguru

Description

When Synapse calls /get_missing_events to fill topological gaps, it heavily assumes the origin server will return a fully accurate response.

If the origin has a bug in topological stitching or visibility checks (e.g., recent bug found in Continuwuity; see below), it can silently omit critical junction or auth events.

When Synapse receives this fragmented response, it can panic in various ways, such as requesting their state before orphaning them as outliers. This can result in dramatic state resets as well as truncated, pruned, or blank timelines.

Synapse should not rely exclusively on the origin server's integrity to fill in topological gaps; this can result in broken auth chains or severed edges. Synapse should instead fall back to querying other participating servers, whether randomly or via a peer scoring algorithm, before defaulting to a (potentially) hard state reset.

For reference on the origin-side traversal bugs that trigger this in Synapse, see the TestInboundCanReturnMissingEvents fix applied to Continuwuity here:

Comparing 3b27ca2b6..569527e73 · src/api/server/get_missing_events.rs · gamesguru/continuwuity

Homeserver

zirco/maunium/vel's

Synapse Version

likely all 1.150+

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions