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

e2e upload API allows you to POST keys claiming to belong to other user's UIDs (SYN-496) #1396

Open
matrixbot opened this issue Oct 5, 2015 · 8 comments
Labels
S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@matrixbot
Copy link
Member

An accidental bug in sytest:
https://github.com/matrix-org/sytest/blob/b5c03fb7764d5d64a4272d5af88bcc46fac90ecd/tests/41end-to-end-keys/01-upload-key.pl#L21

creates a user whose name is _ANON_-6:localhost but then manages to POST a key for a different user_id. I expect this ought to have failed with 403 instead.

(Imported from https://matrix.org/jira/browse/SYN-496)

(Reported by @leonerd)

@matrixbot
Copy link
Member Author

Jira watchers: @leonerd

@matrixbot matrixbot changed the title e2e upload API allows you to POST keys for other user's UIDs (SYN-496) e2e upload API allows you to POST keys for other user's UIDs (https://github.com/matrix-org/synapse/issues/1396) Nov 7, 2016
@matrixbot matrixbot changed the title e2e upload API allows you to POST keys for other user's UIDs (https://github.com/matrix-org/synapse/issues/1396) e2e upload API allows you to POST keys for other user's UIDs (SYN-496) Nov 7, 2016
@ara4n
Copy link
Member

ara4n commented Dec 22, 2016

@richvdh - is this still a prob?

@richvdh
Copy link
Member

richvdh commented Jan 24, 2017

Yeah; it's not actually POSTing keys for a different user_id - it is allowing you to quote a different user_id in the key body, which doesn't do you a lot of good, since clients should reject it.

OTOH, it would be helpful if synapse did actually reject such malformed key uploads, both to help with development, and as an additional security check.

@richvdh richvdh changed the title e2e upload API allows you to POST keys for other user's UIDs (SYN-496) e2e upload API allows you to POST keys claiming to belong to other user's UIDs (SYN-496) Jan 24, 2017
richvdh added a commit to matrix-org/sytest that referenced this issue Jan 24, 2017
@richvdh richvdh removed their assignment Mar 15, 2017
@anoadragon453
Copy link
Member

Is this a problem? Now that sending key IDs has been deprecated and the endpoint just returns all known keys anyways?

https://matrix.org/docs/spec/server_server/unstable#get-matrix-key-v2-server-keyid

@richvdh
Copy link
Member

richvdh commented Jul 4, 2019

@anoadragon453 I think you're confusing e2e keys and server keys

@anoadragon453
Copy link
Member

I believe you're correct.

@reivilibre reivilibre added S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. labels May 19, 2023
@kegsay
Copy link
Member

kegsay commented Nov 27, 2023

Still an issue, at least for the device_id. I did exactly what Leo did 8 years ago (!) and wrote a test, accidentally used the wrong client instance, and was surprised that Dendrite failed but Synapse passed. Dendrite does apply this validation check.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-Major Major functionality / product severely impaired, no satisfactory workaround. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

No branches or pull requests

6 participants