If OpenPGP is enabled, encrypt draft messages
Categories
(MailNews Core :: Security: OpenPGP, enhancement, P1)
Tracking
(thunderbird_esr78+ fixed, thunderbird80 wontfix, thunderbird81 fixed)
People
(Reporter: dab, Assigned: KaiE)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
|
47 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-esr78+
|
Details | Review |
|
47 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-esr78+
|
Details | Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Steps to reproduce:
As a long-time Enigmail user, I've been trying out the new PGP stuff in Thunderbird 78. Start composing a message and examine the message that's saved in the Drafts folder.
Actual results:
The message in the Drafts folder is in clear-text.
Expected results:
The message in the Drafts folder should be encrypted, especially if the outgoing message is flagged to be encrypted (arguably they should all be encrypted). Otherwise, if the Drafts folder is on a server machine, the message travels across the net in the clear each time it's saved before it's finally encrypted and sent. Makes the whole encryption thing kinda pointless.
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 years ago
|
||
Yes this is an important TODO.
Comment 2•5 years ago
|
||
Changing to blocker for enabling PGP by default per Kai
| Assignee | ||
Comment 3•5 years ago
|
||
I think we should get this fixed before updating 68.x users to 78.x
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 4•5 years ago
|
||
| Assignee | ||
Comment 5•5 years ago
|
||
The attached patch works in my testing. I've tested reading drafts that were saved using tb 68 + enigmail,
and I've also tested saving drafts with 78 and opening them again.
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 6•5 years ago
|
||
The storage for encryption/signing/attachment flags is kept the same was it was used with latest Enigmail.
We interpret the flags slightly differently if the flag for signing or encryption is in the "undefined" state.
That is, if Enigmail TB 68 automatically decided that encryption is possible, because of the entered email address, then it stored the flag as "undefined". (Neither never = disabled nor always = enabled.) In this scenario, we don't automatically require encryption after opening the message. Because the user didn't explicitly request encryption when saving the draft in enigmail tb 68, I think that's acceptable.
| Assignee | ||
Comment 7•5 years ago
|
||
The code also remembers and restores the previously configured flags.
For S/MIME messages, no draft flags are saved. Instead, we rely on the current encryption/signing properties, and restore the same.
Comment 8•5 years ago
|
||
Hmm, those flags are in a plain header, so trusting them seems like an exploit vector for the thing encrypted drafts try to protect against, no? (Could easily be swapped to a downgrade by the server admin.)
Comment 9•5 years ago
|
||
True, but if you don't trust the admin of your email provider, you should better change the provider...
Comment 10•5 years ago
|
||
Sure, but then, why encrypt drafts in the first place... the idea behind that is protect against a bad admin.
Comment 11•5 years ago
|
||
yes, you're right :-) Maybe we should consider moving the draft status into the encrypted message (just like the protected subject)?
Comment 12•5 years ago
|
||
Instead of continuing to support the Enigmail draft status, you might want to follow the Autocrypt specification for storing the draft status:
https://autocrypt.org/level1.html#message-drafts
Comment 13•5 years ago
|
||
I'm probably missing something, why can't we just check if the draft was indeed encrypted - and if it was, continue on with that?
| Assignee | ||
Comment 14•5 years ago
|
||
The primary attack vector here is the admin's ability to read the draft, which this patch fixes.
By encrypting the draft, we ensure the mail server admin cannot read the message.
If the admin changes the flags, the admin still cannot read the draft.
Even if the user edits the draft, and saves the draft again, we will still encrypt the draft.
The effect of an admin changing the flags is:
If the user is not careful, they might not notice that the settings in TB composer is no longer "encrypt", and might accidentally send the message unencrypted. The admin must still hope for the user's inattention to succeed.
This attack vector isn't new. All current Enigmail users are exposed to this attack vector. Therefore I think it's OK to handle that in a follow-up. I'll file a bug for that.
(In reply to Magnus Melin [:mkmelin] from comment #13)
I'm probably missing something, why can't we just check if the draft was indeed encrypted - and if it was, continue on with that?
Because the user might not intend to send this message with encryption. And the user might not be able to send the message with encryption, because no recipient keys are available. This conclusion (can or cannot encrypt) cannot be made until the user finally attempts to send the message. Only then we'll know who are the intended recipients.
There's no need to bother the user while they are editing the draft.
The user might start typing a sensitive message. And they might not be aware that the message leaves their computer prior to sending (autosave on server). Only before sending the user might set the encryption flag. By encrypting draft messages, we protect the contents, regardless of the time the user decides to switch on the encrypt flag.
Comment 16•5 years ago
|
||
(In reply to Kai Engert (:KaiE:) from comment #14)
The effect of an admin changing the flags is:
If the user is not careful, they might not notice that the settings in TB composer is no longer "encrypt", and might accidentally send the message unencrypted. The admin must still hope for the user's inattention to succeed.
Isn't it enough that the user doesn't notice the flag was set to not encrypt, and then wait until we autosave a draft, which could be just one minute?
| Assignee | ||
Comment 17•5 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #16)
Isn't it enough that the user doesn't notice the flag was set to not encrypt, and then wait until we autosave a draft, which could be just one minute?
We will always encrypt the draft, even if the message settings say "do not encrypt".
Encrypting the draft isn't driven by individual message settings.
It's driven by "openpgp key has been configured for the user's account".
Also, IIUC we only read the flags from the saved draft, after the user closes the composer window, and we need to load the draft from the save stored.
If the user continues to edit the draft, there is no need to read the flags stored on the server.
Comment 18•5 years ago
|
||
Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/67037561c66b
If OpenPGP is enabled, encrypt draft messages. r=PatrickBrunschwig DONTBUILD
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 19•5 years ago
|
||
Comment on attachment 9171034 [details]
Bug 1650551 - If OpenPGP is enabled, encrypt draft messages. r=PatrickBrunschwig
Important OpenPGP security feature for feature parity with past Enigmail. Little risk for non-OpenPGP users, and any risk limited to the ability to save drafts.
Comment 20•5 years ago
|
||
Comment on attachment 9171034 [details]
Bug 1650551 - If OpenPGP is enabled, encrypt draft messages. r=PatrickBrunschwig
[Triage Comment]
approved for esr78
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 21•5 years ago
|
||
Comment 22•5 years ago
|
||
Hmm, this is causing some test failures (verified by local backout).
Check the bc3's at https://treeherder.mozilla.org/#/jobs?repo=comm-central&revision=67037561c66b4c16a0b3a016297a32ec7cdca736 which are new
comm/mail/test/browser/composition/browser_emlActions.js | A promise chain failed to handle a rejection: Component returned failure code: 0x80040154 (NS_ERROR_FACTORY_NOT_REGISTERED) [nsIMessenger.messageServiceFromURI] - stack: getMsgHdr@chrome://openpgp/content/ui/enigmailMsgComposeOverlay.js:448:24
Comment 23•5 years ago
|
||
As well as bc5 comm/mail/test/browser/smime/browser_multipartAlternative.js at least
| Assignee | ||
Comment 24•5 years ago
|
||
I understand why my patch introduced the failure.
Apparently the call to messenger.messageServiceFromURI(msgUri).messageURIToMsgHdr(msgUri); is know to fail sometimes.
This code is inside enigmail function getMsgHdr.
Before my patch, there was a try/catch block around the call to getMsgHdr.
My code moving has removed that try/catch block.
Restoring the try/catch restores the original behavior (which ignores some failues) and makes that pass again.
However, the question remained, why is this happening only on trunk, not on comm-esr78.
I have done some analysis on that, and will report the results in bug 1635648.
I suggest that we restore the try/catch block as part of this bug here, and solve the general problem in bug 1635648.
| Assignee | ||
Comment 25•5 years ago
|
||
Comment 26•5 years ago
|
||
| Assignee | ||
Comment 27•5 years ago
|
||
Comment on attachment 9171494 [details]
Bug 1650551 - Follow-up to restore a try/catch block, fixes tests. r=mkmelin
Restore exception suppression, because of failures on trunk in automated tests. Uplift for code consistency.
Comment 28•5 years ago
|
||
Greetings from the Thunderbird team at p≡p. One question: Are there any plans to make draft encryption optional? It seems unnecessary to encrypt drafts which so far have no recipient or are stored in the Drafts folder in Local Folders, like for POP3 users or those IMAP users with a "flaky" connection who have configured their drafts storage to be local. BTW, p≡p as the concept of a "trusted server", so messages (including drafts) stored on such a server are not encrypted (especially since Gloda and folder search doesn't work on encrypted messages, bug 188988 and bug 1562737). Local Folders would generally be considered "trusted".
Comment 29•5 years ago
|
||
Comment on attachment 9171494 [details]
Bug 1650551 - Follow-up to restore a try/catch block, fixes tests. r=mkmelin
[Triage Comment]
Approved for esr78
| Assignee | ||
Comment 30•5 years ago
|
||
Comment 31•5 years ago
|
||
I'm curious why the pref temp.openpgp.protectedHeaders (and temp.openpgp.protectedSubjectText) was dropped as part of this change. It actually seems unrelated to me. Any ideas?
I'm asking because there is some doubt around the readiness for forcing this change. My understanding is that far from all OpenPGP-enabled email client support MemoryHole at this point. So some distributions might want to (easily) be able to change this default, and then this pref is great to have.
Apologies if it's bad style to comment on a closed ticket!
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
Description
•