blueprint-freespeech / ricochet-refresh

Anonymous peer-to-peer instant messaging
https://www.ricochetrefresh.net
Other
162 stars 27 forks source link

Unencrypted storage of sensitive data #71

Open morganava opened 3 years ago

morganava commented 3 years ago

The application stores the private key (the identity), contact nicknames and their respective public keys on the device file system in plain text. This makes it unnecessarily easy for an adversary to extract contact info or even impersonate others if they get access to the plain file system, for instance when the device has been left unattended, gets seized or is remotely attacked. The user interface displays no key info such as a public key fingerprint in the contact or chat window. This makes it easier for an adversary with limited local access to launch a man-in-the-middle attack or impersonate contacts by replacing public keys or nicknames in the configuration file. This whole attack vector could be mitigated by prompting the user for a strong password at application launch, that goes through a key derivation hardened against brute-force and dictionary attacks, and ultimately ensures secrecy, authenticity and integrity of both the identity and the contact list with an encryption scheme.

yanmaani commented 2 years ago

Would probably be reasonable to always use a key, and if password is blank, just store the key on disk. That makes wiping considerably easier.

Consider storing everything in a database (LMDB, SQLite) and then encrypting that database. There's encryption extensions for SQLite, some of which are public.