Reject OTK uploads if clients exceed 500 server-side keys - #20162
Open
kaylendog wants to merge 8 commits into
Open
Reject OTK uploads if clients exceed 500 server-side keys#20162kaylendog wants to merge 8 commits into
kaylendog wants to merge 8 commits into
Conversation
3 tasks
kaylendog
force-pushed
the
kaylendog/feat/reject-otks
branch
from
August 28, 2026 14:56
6f3f0f8 to
9fe1486
Compare
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
kaylendog
force-pushed
the
kaylendog/feat/reject-otks
branch
from
August 28, 2026 15:07
9fe1486 to
9c82f30
Compare
kaylendog
marked this pull request as ready for review
August 28, 2026 15:15
richvdh
reviewed
Aug 28, 2026
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
Member
|
For links: the combination of matrix-org/matrix-rust-sdk#6780 and the js-sdk resulted in matrix-org/matrix-js-sdk#5501, which in turn led to people seeing decryption errors, which can't even be fixed by rolling back the client, since the incorrect OTKs have already been uploaded to the server. The goal here is to provide a backstop against similar client breakage in future by refusing to cooperate with such broken clients. Hopefully this will result in a user-visible "it's all horribly broken" error, which is better than silent breakage that manifests through decryption errors some time later. In any case, Synapse should have a guard against users uploading absurd numbers of OTKs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
matrix-org/matrix-rust-sdk#6780 fixed a long-standing issue in the Rust SDK where
OlmMachine::receive_sync_changesincorrectly treated a missingone_time_keys_countsas "no change", when (for sync v2) this means "no keys". This behaviour made it into the WASM SDK in release v18.5.0, which causes clients written using the JS SDK to endlessly upload OTKs on every sync.This PR introduces a server-side check to see if a device has uploaded over
500keys when it tries to upload more, errorring if this is the case. This should help inform client developers that something is wrong with their OTK implementation before it becomes a problem.Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.