Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database stores multiple cross-signing keys of the same type for a given user #16398

Open
matrixbot opened this issue Dec 21, 2023 · 0 comments

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 21, 2023

This issue has been migrated from #16398.


The Matrix protocol assumes that each user will have at most one cross-signing key of a given type (master, self_signing, user_signing) at a time.

However, it is possible for clients to replace the existing keys with further calls to POST /_matrix/client/v3/keys/device_signing/upload. When that happens, Synapse appears to just add the new key to e2e_cross_signing_keys without deleting the old one. Some matrix.org users have accumulated over 2000 keys of each type.

This is redundant data which we have no business keeping (and it sucks up disk space).

There also seems to be a codepath somewhere where we end up with multiple copies of a key for a remote user get stored in the database.

Ideally the e2e_cross_signing_keys table should be UNIQUE in (user_id, keytype).

@matrixbot matrixbot changed the title Dummy issue Database stores multiple cross-signing keys of the same type for a given user Dec 22, 2023
@matrixbot matrixbot reopened this Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant