keybase / keybase/keybase-issues
Private key is stored on disk and exported unencrypted without user's knowledge
- Dominant language
- No language data
- Stars
- 899
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
I installed the Keybase desktop application for OS X and exported the PGP private key with the command `keybase pgp export -s > somefile.txt`, and imported the resulting file into multiple instances of the “Mailvelope” extension for Google Chrome on multiple machines.
When I did some test transmissions of PGP-encrypted mail with Mailvelope I was never prompted for a passphrase. That is when I realized that Keybase had done something that encryption software should never, ever do without the user's explicit request and consent: It had exported a private key in the clear.
Equally bad, Keybase installs the user's private key into GPG keyring in the clear. This too is a bad idea. The private key should remain unencrypted only in RAM and only while the Keybase application is active. There is no good reason why the private key should ever be stored on disk in the clear.
Understandably, we don't want to prompt the user to enter a passphrase each time the Keybase application starts up when the machine boots. The preferable mechanism here is to use the OS keychain, which will be unlocked when the user logs in, and relocked when the user logs out.
This problem was indirectly reported in Issue #2676. The official response was:
> Judging by [this post](https://github.com/keybase/keybase-issues/issues/1912#issuecomment-163956144) from Chris it looks like `keybase pgp export --secret` **decrypts** your private key. So you would expect a decrypted key to be in plain text and without password.
I don't think this is a good reason for why the private key is being exported in the clear, or why it is inserted into the user's GPG keyring in the clear. The average end-user will not know about a tiny comment hidden somewhere in Github that warns him to expect an unencrypted key to be stored on disk. If a private key is to be stored unencrypted (and I cannot imagine why that would ever be the case), the user should be loudly warned before, during, and after this is done.
The default action should be to encrypt the private key with the user's password that is used to log into Keybase.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing `keybase pgp export -s` on the Keybase desktop application for OS X and inspect where the exported key and GPG keyring copies are written. Done means plaintext private keys are not stored or exported without explicit user consent, with the OS keychain considered for protected storage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos
- Domain
- cryptography, desktop, security
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100