Skip to content

Recovery key : bad MAC for the secret m.cross_signing.master #34878

Description

@MarcWadai

Steps to reproduce

This is a bug encounter by a user using Tchap based on element version 1.12.17

  1. Where are you starting? What can you see?
    When trying to use the recovery key, the UI just shut down after enter. the error in the log indicate bad MAC for the secret m.cross_signing.master

Outcome

What did you expect?

Verification to complete

What happened instead?

UI shut down and we can see in the log :

2026-08-24T07:16:46.659Z D SetupEncryptionToast[verify_this_session]: Primary button clicked: opening SetupEncryptionDialog
2026-08-24T07:16:46.659Z I Removed toast with key 'setupencryption'
2026-08-24T07:16:46.681Z D MatrixChat: handling action aria_hide_main_app
2026-08-24T07:16:47.741Z D SetupEncryptionStore.usePassphrase
2026-08-24T07:16:47.742Z D SecurityManager: enabling 4S key cache
2026-08-24T07:16:47.742Z D SecurityManager: accessSecretStorage: bootstrapCrossSigning
2026-08-24T07:16:47.742Z D SecurityManager: getSecretStorageKey: request for 4S keys [acedd131-7702-4691-9aaa-ade733be93c5] for secret `m.cross_signing.master`: looking for key acedd131-7702-4691-9aaa-ade733be93c5
2026-08-24T07:16:47.742Z D SecurityManager: getSecretStorageKey: prompting user for key abedd131-7502-4691-9aaa-ade733be93c4
2026-08-24T07:16:47.760Z D MatrixChat: handling action aria_hide_main_app
2026-08-24T07:16:59.383Z D FetchHttpApi: <-- GET https://matrix.agent.ssi.tchap.gouv.fr/_matrix/client/v3/sync?filter=xxx&timeout=xxx&org.matrix.msc4222.use_state_after=xxx&since=xxx [16289ms 200]
2026-08-24T07:16:59.386Z D MatrixChat: handling action MatrixActions.Room.receipt
2026-08-24T07:16:59.398Z D FetchHttpApi: --> GET https://matrix.agent.ssi.tchap.gouv.fr/_matrix/client/v3/sync?filter=xxx&timeout=xxx&org.matrix.msc4222.use_state_after=xxx&set_presence=xxx&since=xxx
2026-08-24T07:16:59.403Z D MatrixChat: handling action MatrixActions.sync
2026-08-24T07:17:00.300Z D FetchHttpApi: <-- GET https://matrix.agent.ssi.tchap.gouv.fr/_matrix/client/v3/sync?filter=xxx&timeout=xxx&org.matrix.msc4222.use_state_after=xxx&set_presence=xxx&since=xxx [902ms 200]
2026-08-24T07:17:00.306Z D MatrixChat: handling action MatrixActions.Room.receipt
2026-08-24T07:17:00.317Z D FetchHttpApi: --> GET https://matrix.agent.ssi.tchap.gouv.fr/_matrix/client/v3/sync?filter=xxx&timeout=xxx&org.matrix.msc4222.use_state_after=xxx&set_presence=xxx&since=xxx
2026-08-24T07:17:00.318Z D MatrixChat: handling action MatrixActions.sync
2026-08-24T07:17:05.145Z D SecurityManager: getSecretStorageKey: got key abedd131-7502-4691-9aaa-ade733be93c4 from user
2026-08-24T07:17:05.145Z D SecurityManager: Caching 4S key abedd131-7502-4691-9aaa-ade733be93c4
2026-08-24T07:17:05.145Z E SecurityManager: accessSecretStorage: error during operation Error decrypting secret m.cross_signing.master: bad MAC
Error: Error decrypting secret m.cross_signing.master: bad MAC
    at i (https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2898.js:2:392521)
    at async C.bootstrapCrossSigning (https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2343.js:1:14474)
    at async re.bootstrapCrossSigning (https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2343.js:1:55103)
    at async https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2898.js:2:1144288
    at async T (https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2898.js:2:1143504)
    at async j (https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2898.js:2:1143609)
2026-08-24T07:17:05.145Z D SecurityManager: disabling 4S key cache
2026-08-24T07:17:05.146Z D SetupEncryptionStore.usePassphrase: error Error decrypting secret m.cross_signing.master: bad MAC
Error: Error decrypting secret m.cross_signing.master: bad MAC
    at i (https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2898.js:2:392521)
    at async C.bootstrapCrossSigning (https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2343.js:1:14474)
    at async re.bootstrapCrossSigning (https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2343.js:1:55103)
    at async https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2898.js:2:1144288
    at async T (https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2898.js:2:1143504)
    at async j (https://www.tchap.gouv.fr/bundles/ec4076dd6d33874dccc1/2898.js:2:1143609)
2026-08-24T07:17:05.153Z D MatrixChat: handling action aria_hide_main_app

Do you have an ideas in which scenario the user enter this state ?

Operating system

windows

Browser information

Edge 151.0.0

URL for webapp

No response

Application version

1.12.17

Homeserver

No response

Will you send logs?

No

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-E2EE-Key-BackupO-UncommonMost users are unlikely to come across this or unexpected workflowS-CriticalPrevents work, causes data loss and/or has no workaroundT-DefectTeam: Crypto

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions