Missing Linux safeStorage backend migration can block startup or push users to basic_text/plaintext key storage
Using a supported version?
- I have searched open and closed issues for duplicates.
- I am using Signal-Desktop as provided by the Signal team, not a 3rd-party package.
Overall summary
I hit this while using the Signal Desktop Flatpak on my Fedora machine. I started investigating after noticing that the local database key had ended up using the basic / basic_text path, meaning the database key was stored as plaintext in config.json and therefore not protected by an OS-backed keyring.
I understand that Flatpak packaging is 3rd party, but I think the underlying issue belongs in Signal's Linux safeStorage/database-key migration logic. The Flatpak exposed the problem for me, but similar backend-change failures are already reported upstream for normal Linux desktop/session changes.
Signal Desktop stores the SQLCipher database key in config.json using key for the legacy/plaintext database key, encryptedKey for encryption with Electron safeStorage and safeStorageBackend for the Linux backend, e.g. gnome_libsecret, kwallet5, kwallet6, or basic_text.
On Linux, Electron’s selected safeStorage backend can change when the desktop environment changes, when KWallet/libsecret availability changes, or when the app is launched with a different --password-store=... value.
When this happens, Signal will detect the backend mismatch and throw SafeStorageBackendChangeError, which is reasonable for protection against decryption with the wrong backend, but a general migration path doesn't exist.
The issue is not specific only to the backend-change startup failure, because in practice, users can also end up on --password-store=basic, either as a workaround or a downstream package default, which makes Electron use basic_text, so the Signal database key is stored without OS keyring protection (which is what prompted me to investigate).
From what I can understand from the codebase, getSQLKey() checks the previous safeStorageBackend against safeStorage.getSelectedStorageBackend() before attempting recovery from a retained plaintext key. Current automatic migration handles only kwallet5 <-> kwallet6.
For the Flatpak specifically, I think an upstream migration fix would directly help with the existing Flatpak issues where users move between gnome_libsecret, KWallet, and basic_text.
The Flatpak currently defaults to SIGNAL_PASSWORD_STORE=basic, which makes Electron use basic_text. This was a deliberate compatibility workaround after problems with encrypted backends which caused database/key-access failures in the Flatpak environment.
If Signal can recover from a safeStorage backend change, then the Flatpak package no longer has to choose between keeping basic for compatibility and risking startup failures when the selected backend changes. Maintainers could then more safely preserve or move users toward an OS-backed backend, because Signal would own the actual database-key migration. So an upstream migration path would remove the hardest blocker there.
So I created this issue to consolidate the broader Linux backend migration problem, which boil down to:
- backend changes can block startup
- retained plaintext
keycannot not be used as recovery material before the backend-change error - encrypted-only cases do not have a guided decrypt-and-reencrypt migration
- users/package maintainers can be pushed toward
basic_text, which stores the DB key plaintext
Steps to reproduce
To demonstrate the issue.
- Start Signal Desktop with an OS-backed password store, e.g.:
--password-store=gnome-libsecretor--password-store=kwallet6depending on environment. - Let Signal start normally with that profile, then quit.
- Inspect config.json and observe that it contains encryptedKey and safeStorageBackend, e.g: "safeStorageBackend": "gnome_libsecret" or: "safeStorageBackend": "kwallet6".
- Start the same Signal profile with a different backend, e.g.:
--password-store=basic - Electron now reports basic_text, while Signal’s config still records the previous backend.
- Signal fails with a backend-change database-key error instead of migrating the key.
Expected result
Signal should provide a recoverable migration path when the Linux safeStorage backend changes.
If both
encryptedKeyand plaintextkeyexist, and the backend has changed, Signal should be able to use the plaintextkeyas recovery material instead of immediately failing. It can then clear stale encrypted metadata and re-encrypt under the current backend when safeStorage encryption is available.If only
encryptedKeyexists, Signal could provide an automatic or guided migration path e.g. relaunch with the previous backend, decrypt the key, temporarily store explicit migration state, relaunch with the target/current backend, and re-encrypt under that backend when possible.Users should not need to manually edit
config.json, stay permanently pinned to an old--password-store=..., or fall back tobasic_text/plaintext storage just to keep using Signal Desktop.
Actual result
Errors like: SafeStorageBackendChangeError: Detected change in safeStorage backend, can't decrypt DB key (previous: gnome_libsecret, current: basic_text)
The only current migration path is kwallet5 to kwallet6: https://github.com/signalapp/Signal-Desktop/commit/2dea157233d82a0bf44b34a04b2b39e34a112e5d
So the missing ones are:
- gnome_libsecret <-> basic_text
- kwallet* <-> basic_text
- gnome_libsecret <-> kwallet*
Relevant issues and discussions:
https://github.com/signalapp/Signal-Desktop/issues/6962 https://github.com/signalapp/Signal-Desktop/issues/7117 https://github.com/signalapp/Signal-Desktop/issues/6970 https://community.signalusers.org/t/change-in-encryption-keyring-backend/63981 https://community.signalusers.org/t/recover-password-store-in-snap-installation/64147 https://community.signalusers.org/t/migrate-signal-from-kwallet5-to-kwallet6-or-whatever-the-current-default-may-be/62719 https://community.signalusers.org/t/signal-start-issue-after-going-from-gnome-to-niri/74180 https://community.signalusers.org/t/configurable-password-store/74181
Flatpak issues: https://github.com/flathub/org.signal.Signal/issues/753 https://github.com/flathub/org.signal.Signal/issues/752 https://github.com/flathub/org.signal.Signal/issues/754
Relevant Flatpak PR history for defaulting to basic: https://github.com/flathub/org.signal.Signal/pull/729 https://github.com/flathub/org.signal.Signal/pull/737 https://github.com/flathub/org.signal.Signal/pull/738 https://github.com/flathub/org.signal.Signal/pull/741 https://github.com/flathub/org.signal.Signal/pull/744
Screenshots
No response
Signal version
8.16.0
Operating system
Linux
Version of Signal on your phone
No response
Link to debug log
No response
Source: signalapp/Signal-Desktop