fix: Create appservice devices under the requested device ID (MSC4190) #2028
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/continuwuity!2028
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Deniel9204/continuwuity:fix/2015-msc4190"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #2015
The appservice branch of
update_device_route(MSC4190 device creation)generated a random device ID instead of using the one from the request path,
and dropped the requested display name. The
PUTreturned200, but thedevice the appservice asked for never existed — every subsequent request
masquerading as it failed with
M_FORBIDDEN("Device does not exist for useror appservice cannot masquerade as this device"), and one orphaned random-ID
device was leaked per attempt.
Combined with the pre-1f5e178c3f behaviour (400 "Token conflicts with an
existing appservice token"), MSC4190 appservice device creation has never
worked end-to-end in any release. On OIDC-enabled servers (where legacy
appservice login is unavailable) this makes encrypted mautrix bridgev2
bridges unable to start.
Tested with mautrix-googlechat (mautrix-go v0.29.0) against a patched build:
MSC4190 device creation lands under the requested ID with the requested
display name,
/keys/uploadand the restart-time masqueraded/keys/queryboth succeed, and the bridge starts with e2be enabled. Curl-only repro from
the issue also passes (PUT a chosen ID → GET returns that ID).
Pull request checklist:
mainbranch, and the branch is named something other thanmain.myself, if applicable. This includes ensuring code compiles.
reviewed on my phone but lgtm