element-hq / element-hq/element-web

If publishing the cross-signing keys fails, we give up trying but we should keep trying

Open
#27,253 8 comments 0 reactions 0 assignees View on GitHub
A-E2EE A-E2EE-Cross-Signing O-Occasional S-Major T-Defect
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

When first logging in on a new account, we try to publish cross-signing keys (via `/device_keys/upload`).

This process can fail for example, if the homeserver is configured to use SSO auth. (Publishing the public keys requires user-interactive auth, which may fail. https://github.com/matrix-org/matrix-spec-proposals/pull/3967 is an attempt to help with that, ~~but is as yet unstandardised~~. Edit 2024-06-11: It is now standardised, and https://github.com/element-hq/synapse/pull/17284 lands support for it in Synapse.)

If the process fails (either because the HS rejects it or the user gets bored of trying to do UIA), we show an error:
![image](https://github.com/element-hq/element-web/assets/1389908/705f99c7-bc0f-47b1-b193-ffacd5327f2d)

After that point, the application is fully-functional, and will even allow you to set up 4S and store the *private* cross-signing keys in 4S. The problem is that there is no further attempt to publish the public keys, so the account is now totally broken until the user resets cross-signing.

Contributor guide

Open the contributing guide

Research direction

The issue identifies the first-login cross-signing flow and the /device_keys/upload endpoint as entry points. Start by tracing how a failed upload is handled after UIA or homeserver rejection; done means a later retry can publish the public keys without forcing a cross-signing reset.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, frontend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.