Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

~/.config/Signal/sql/db.sqlite now unencrypted? #5097

Closed
1 task done
aurelg opened this issue Mar 13, 2021 · 8 comments
Closed
1 task done

~/.config/Signal/sql/db.sqlite now unencrypted? #5097

aurelg opened this issue Mar 13, 2021 · 8 comments

Comments

@aurelg
Copy link

aurelg commented Mar 13, 2021

  • I have searched open and closed issues for duplicates

Bug Description

Archlinux, up-to-date as of 2021-03-13: signal-desktop 1.40.1 suddenly refused to start with an error message SQLITE_NOTADB, very much like #4513. It then asked to re-link to Signal running on my phone. The database is recreated anew: all messages are gone. I can live with it.

However, after investigation, it seems that the database in ~/.config/Signal/sql/db.sqlite - that used to be encrypted with sqlcipher -, is now recreated without encryption: I can open it e.g. with sqlitebrowser without even entering the key that was stored in ~/.config/Signal/config.json.

I understand the encryption was pretty much useless since the key was stored in clear text, yet it surprises me that such a breaking change is implemented without further notification.

Steps to Reproduce

  1. Start 1.40.1 till it complains with the SQLITE_NOTADB message
  2. Relink your account, ~/.config/Signal/sql/db.sqlite is recreated

Actual Result:

After step 2,~/.config/Signal/sql/db.sqlite is not encrypted.

Expected Result:

After step 2, ~/.config/Signal/sql/db.sqlite should be encrypted.

Platform Info

Signal Version:

1.40.1

Operating System:

Archlinux up to date as of 2021-03-13.

Linked Device Version:

5.4.12

@primeos
Copy link

primeos commented Mar 13, 2021

I can confirm that db.sqlite is also unencrypted on my system (Signal-Desktop 1.40.1 on Linux/NixOS) and I didn't even re-link recently (I last re-linked approx. 3 months ago). No complaints (I always wondered why the DB has to be encrypted if the key is stored using the same permissions) but given that .config/Signal/config.json still contains the key, that this was't mentioned in any changelog, and that a quick GitHub search doesn't reveal such a change or a reason for it this does certainly seem strange...

@eNTi
Copy link

eNTi commented Mar 14, 2021

Same here... I wasn't aware of the db being encrypted but that makes quite a lot of sense really.

Also losing all conversations and contacts is a quite annoying litte side effect.

@grantler
Copy link

I came to report the unexpected loss of the database. "Quite annoying" does not express how much of a major hassle this is. A recovery seems not to be possible. Maybe it can be left to the user if they want to set their take on the tradeoff between security and usability, e.g. mirror old messages between the phone and the desktop client.

@gkft
Copy link

gkft commented Mar 14, 2021

@aurelg did you test whats happening if you purge the signal database install a not affected gtk3 version as described in #4513 (comment)?
If the database is encrypted afterwards then Signal correctly uses the bundled sqlcipher otherwise Signal somehow may use the system installation of sqlite.

@aurelg
Copy link
Author

aurelg commented Mar 14, 2021

I did not (yet). I'm using signal-desktop "in production", and it makes experimenting not that trivial. I'll do it asap - except if someone else tries first! 👍

@gkft
Copy link

gkft commented Mar 14, 2021

@LukeLR confirmed the behavior #4513 (comment)

Does it make sense to close this issue as the observed behavior is a consequence of #4513?

@aurelg
Copy link
Author

aurelg commented Mar 15, 2021

Yes, I think it makes sense to close it. I'll follow #4513 very carefully. Thanks for your help! 👍

@primeos
Copy link

primeos commented May 11, 2021

I've reopened this as #5245 because IMO this is Signal-Desktop's responsibility and their "unfortunate" design shouldn't waste the time of users and package maintainers.

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

No branches or pull requests

5 participants