Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Synapse does not reject an attempt to upload keys for device A from device B #11720

Open
DMRobertson opened this issue Jan 10, 2022 · 0 comments
Labels
P4 (OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. z-cross-signing (Deprecated Label)

Comments

@DMRobertson
Copy link
Contributor

Discovered when playing around writing a stress test.

Synapse seems to treat the contents of /keys/upload as an opaque blob. But the spec is pretty explicit that it should have a certain shape, and that you must include a device_id which matches "the one when logging in".

As proof, I offer the following debug line

* 2022-01-10 18:21:09,180 - synapse.handlers.device - 251 - WARNING - GET-4 - DMR: stream_id=6, devices=[{'device_id': 'MEVKUJOZQV* ', 'keys': {'algorithms': [], 'device_id': 'alice_1', 'keys': {}, 'signatures': {}, 'user_id': '@alice:hs1'}}]

which came from

    async def on_federation_query_user_devices(self, user_id: str) -> JsonDict:
        stream_id, devices = await self.store.get_e2e_device_keys_for_federation_query(
            user_id
        )
        logger.warning(f"DMR: {stream_id=}, {devices=}")
@DMRobertson DMRobertson added P4 (OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. labels Jan 10, 2022
@MadLittleMods MadLittleMods added the z-cross-signing (Deprecated Label) label Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P4 (OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. z-cross-signing (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

2 participants