EFail – Vulnerabilities in end-to-end encryption technologies OpenPGP and S/MIME
Let&#x27;s summarize the situation:<p>Abstract: S&#x2F;MIME and MUAs are broken.  OpenPGP (with MDC) is not, but clients MUST check for GPG error codes.  Use Mutt carefully or copy&#x2F;paste into GPG for now.<p>- Some mail clients concatenate all parts of a multipart message together, even joining partial HTML elements, allowing the decrypted plaintext of an OpenPGP or S&#x2F;MIME encrypted part to be exfiltrated via an image tag.  Mail clients shouldn&#x27;t be doing this in any world, and can fix this straightforwardly.<p>- S&#x2F;MIME (RFC 5751) does not provide for authenticated encryption, so the ciphertext is trivially malleable.  An attacker can use a CBC gadget to add the image tag into the ciphertext itself.  We can&#x27;t expect a mail client to avoid exfiltrating the plaintext in this case.  S&#x2F;MIME itself needs to be fixed (or abandoned).<p>- OpenPGP (RFC 4880) provides for authenticated encryption (called &quot;MDC&quot;, see sections 5.13 and 13.11 of the RFC) which would prevent a similar CFB-based gadget attack if enforced.  GPG added this feature in 2000 or 2001.  If the MDC tag is missing or invalid, GPG returns an error.  If GPG is asked to write the plaintext as a file, it will refuse.  When the output is directed to a pipe, it will write the output and return an error code [1].  An application such as an MUA using it in this manner must check for the error code before rendering or processing the result.  It seems this requirement was not made clear enough to implementors.  The mail clients need to release patches to check for this error.  This will create an incompatibility with broken OpenPGP implementations that have not yet implemented MDC.<p>- Even without clients enforcing or checking the authentication tag, it&#x27;s a bit trickier to pull off the attack against OpenPGP because the plaintext may be compressed before encryption.  The authors were still able to pull it off a reasonable percentage of the time.  Section 14 of RFC 4880 actually describes a much earlier attack which was complicated in this same manner; it caused the OpenPGP authors to declare decompression errors as security errors.<p>Net-net, using encrypted email with Mutt is safe [2, Table 4], though even there, opening HTML parts encrypted with S&#x2F;MIME in a browser is not, and double-checking how it handles GPG errors would be prudent before forking a browser on any OpenPGP encrypted parts.  See the paper for other unaffected clients, including Claws (as noted below) and K-9 Mail (which does not support S&#x2F;MIME).  Otherwise, it&#x27;s probably best to copy and paste into GPG (check the error code or ask it to write to a file) until this is worked out.<p>[1] <a href="https:&#x2F;&#x2F;lists.gnupg.org&#x2F;pipermail&#x2F;gnupg-users&#x2F;2018-May&#x2F;060315.html" rel="nofollow">https:&#x2F;&#x2F;lists.gnupg.org&#x2F;pipermail&#x2F;gnupg-users&#x2F;2018-May&#x2F;06031...</a><p>[2] <a href="https:&#x2F;&#x2F;efail.de&#x2F;efail-attack-paper.pdf" rel="nofollow">https:&#x2F;&#x2F;efail.de&#x2F;efail-attack-paper.pdf</a>