If exceptions occur in OpenPGP code, sending should be prevented
Categories
(MailNews Core :: Security: OpenPGP, defect, P1)
Tracking
(Not tracked)
People
(Reporter: KaiE, Unassigned)
References
Details
While developing the OpenPGP code, I saw something that is worrying.
I had a bug in the JS code, which caused the encryption processing to abort.
Nevertheless, sending of the message proceeded - without encryption.
It might be easy to accidentally have this kind of bug in some code path, and having messages being sent without encryption, while the UI promises to use encryption, would be a nightmare bug.
I think we should try to find a solution that prevents this scenario from happening.
Potential idea:
- at the time the send action is triggered, set a flag that means "encryption/signing processing not yet done"
- only at the very end of a successful encryption/signing operation, we'd set that flag to "done". The idea is, if there's any bug in the processing code, this flag would never be set.
- the code that causes us to proceed with sending the message should check for the "done" flag. If it isn't in the "done" state, then abort sending.
Comment 1•4 years ago
|
||
Bug 1695590 basically does this, I think.
Comment 2•4 years ago
|
||
The issue was that for all exceptions, we just went on... In combination with not using proper async promises which covered up the return value that could be unexpectedly and error (which is "true").
Comment 3•4 years ago
|
||
Per previous comments, I think this is working now. -> WFM
Description
•