Skip to content
Snippets Groups Projects
  • Andrew Morgan's avatar
    27c1abc7
    Use _check_sigs_and_hash_and_fetch to validate backfill requests (#8350) · 27c1abc7
    Andrew Morgan authored
    This is a bit of a hack, as `_check_sigs_and_hash_and_fetch` is intended
    for attempting to pull an event from the database/(re)pull it from the
    server that originally sent the event if checking the signature of the
    event fails.
    
    During backfill we *know* that we won't have the event in our database,
    however it is still useful to be able to query the original sending
    server as the server we're backfilling from may be acting maliciously.
    
    The main benefit and reason for this change however is that
    `_check_sigs_and_hash_and_fetch` will drop an event during backfill if
    it cannot be successfully validated, whereas the current code will
    simply fail the backfill request - resulting in the client's /messages
    request silently being dropped.
    
    This is a quick patch to fix backfilling rooms that contain malformed
    events. A better implementation in planned in future.
    27c1abc7
    History
    Use _check_sigs_and_hash_and_fetch to validate backfill requests (#8350)
    Andrew Morgan authored
    This is a bit of a hack, as `_check_sigs_and_hash_and_fetch` is intended
    for attempting to pull an event from the database/(re)pull it from the
    server that originally sent the event if checking the signature of the
    event fails.
    
    During backfill we *know* that we won't have the event in our database,
    however it is still useful to be able to query the original sending
    server as the server we're backfilling from may be acting maliciously.
    
    The main benefit and reason for this change however is that
    `_check_sigs_and_hash_and_fetch` will drop an event during backfill if
    it cannot be successfully validated, whereas the current code will
    simply fail the backfill request - resulting in the client's /messages
    request silently being dropped.
    
    This is a quick patch to fix backfilling rooms that contain malformed
    events. A better implementation in planned in future.