.. This file is part of PEPSI. Copyright (C) 2026 GNUnet e.V. PEPSI is free software; you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. PEPSI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. .. _research: ========================================= Vulnerabilities in E-mail implementations ========================================= This chapter summarises what the security literature knows about attacks on e-mail, and says for each weakness whether and how it affects Pepsi as it is today. The works come from an extensive literature survey covering scientific papers, theses, standards, vulnerability records, vendor advisories and articles on SMTP, sender authentication, MIME, OpenPGP, S/MIME, the PKI, cryptographic primitives and their libraries, mail software and the people who use it. Every work cited here is listed in the :doc:`bibliography`; the per-work analyses and BibTeX entries are kept in the source tree. How this chapter is organised ============================= The works are not summarised one by one. The vulnerabilities they describe are grouped into *issues*: one issue is one weakness, however many works describe, measure or rediscover it. The issues are arranged in three levels: 1. **Where the weakness lives**: transport and infrastructure, sender authenticity and mail flow, message format and rendering, mail software, end-to-end encryption and keys, cryptographic primitives and libraries, and accounts and people. 2. **Why it exists**: implementation defects, cryptographic weaknesses, protocol design gaps, missing or incorrect checks, deployment, configuration and credentials, resource exhaustion and abuse, information leaks and tracking, and misleading display and user decisions. 3. **The issue itself**: what goes wrong and how it is exploited, with citations of the works that describe it, followed by its assessment for Pepsi. The last section, :ref:`research-who-must-act`, turns the view around: it lists only the issues Pepsi remains exposed to, arranged by who would have to act to close them, and links back to the issue descriptions rather than repeating them. Each assessment ends in one of four verdicts: * **Not applicable**: Pepsi has no such component or role, and no analogue. * **Addressed**: Pepsi has the component, or an analogue, and its design or code demonstrably avoids the weakness. The assessment says how. * **Partly addressed**: Pepsi defends against part of the weakness, or only in some configuration, or a residue remains. * **Vulnerable**: the weakness exists in Pepsi as shipped or in a supported configuration. This includes limitations Pepsi inherits from a standard, from the need to interoperate, from a dependency, or from what the human user has to do, which Pepsi cannot remove on its own. The impact is the qualitative severity of the issue for a Pepsi deployment, using the CVSS 3.1 base-score bands: critical (9.0 to 10.0), high (7.0 to 8.9), medium (4.0 to 6.9), low (0.1 to 3.9) and none. Attacks that need a captured ciphertext are scored with low attack complexity, because capturing mail in transit or at a compromised mailbox is the attack model of end-to-end encryption. The assessments are made by reading Pepsi's source code and this manual, and are updated whenever the code changes. They are not tests against a running system, so a verdict can be wrong in either direction; where a verdict depends on behaviour that could not be verified from the code, the assessment says so. The purpose is an honest picture for operators and for future development, not a favourable one, and where in doubt the more serious verdict was chosen. Properties that no mail system can offer today, such as forward secrecy for stored mail, are not counted against Pepsi unless it could reasonably do better. How Pepsi addresses whole classes of attack by design is documented in :doc:`threat-model` and :doc:`security`. .. _research-summary: Summary ======= .. include:: ../research/issues/summary.rst Main findings ------------- The table counts the issues by area and verdict. None of the issues that are still partly addressed or open rates high or critical; each is of medium or low impact. Most of the literature's implementation attacks do not carry over. Memory corruption, spool races and the command and header injection that dominate the CVE record of the established MTAs are absent or blocked in Pepsi's Rust code, which keeps its queue in PostgreSQL and parses mail in memory-safe code, with libFuzzer targets for the security-critical parsers (sender authentication, DKIM key records, MIME classification, CMS, OpenPGP, X.509 name constraints, bounce and list input). Most cryptographic attacks on the primitives are likewise avoided by the choice of libraries and modes. Where an issue touches Pepsi's own code, its assessment says what the code does about it. What remains open falls into the following groups. **Sender authentication is only as strict as the receivers enforce it.** Pepsi enforces DMARC on inbound mail, with an ARC override for the forwarders and lists that the operator names in ``ARC_TRUSTED_SEALERS``; an operator who switches enforcement off accepts forgeries of any domain, the deployment's own included (:ref:`lit-receivers-not-enforcing-auth`). ``pepsi-setup`` suggests ``p=reject`` for the operator's own domains, but publishing it is the operator's decision (:ref:`lit-dmarc-missing-or-none`). Forwarded mail is SRS-rewritten into a domain that ``pepsi-setup`` refuses to let align with a served one (unless the operator overrides it), and Pepsi does not DKIM-sign a forwarded forgery, so forwarding does not launder it (:ref:`lit-forwarding-launders-spoofed-mail`, :ref:`lit-forwarder-dkim-signs-spoofed-mail`). A client certificate is accepted only as a pinned key or on a full RFC 5280 path to a CA that the operator configured. That path is checked against CRLs, by the one revocation check in Pepsi that fails closed. The certificate then sends only as the addresses to which ``SENDER_MAP`` binds it (its own mailbox, for a CA-issued one that names it), and nothing at all until bound (:ref:`lit-client-cert-overbroad-trust`). A ``MYNETWORKS`` network must be bound the same way, or ingress refuses to start; only the loopback host, and a network the operator explicitly binds to every address, send as any address (:ref:`lit-provider-account-from-unbound`). Inbound, downloaded IP blocklists mark or refuse a listed client without any list operator being asked about it, and the deployment watches its own addresses on the DNS blocklists; whether a listing is acted on is still the operator's reading (:ref:`lit-ip-blocklist-evasion`, :ref:`lit-blocklist-collateral-damage`). Automatic replies are not sent when SPF or DMARC definitely fails, but still answer senders who are merely unauthenticated (:ref:`lit-backscatter-forged-return-address`). **Transport security is opportunistic, as it is for every MTA.** STARTTLS can be stripped where a domain publishes neither an enforcing MTA-STS policy nor DNSSEC-signed TLSA records; where it publishes usable TLSA records, the default ``DANE = strict`` makes TLS mandatory and refuses a mismatching certificate, as RFC 7672 requires (:ref:`lit-starttls-stripping`, :ref:`lit-mta-sts-tofu-gap`). Everything that rests on DNS inherits the resolver's weaknesses: Pepsi does not validate DNSSEC itself but trusts the AD bit of the resolver that it is given, which it can reach over DNS over TLS or HTTPS; ``pepsi-setup`` names every off-host resolver the deployment so trusts, and the DANE workers and ``pepsi-status`` report a resolver that does not validate (:ref:`lit-mail-auth-relies-on-dns`, :ref:`lit-ad-bit-trusted-from-resolver`). A key lookup that fails in the DNS defers the message instead of sending it in clear; only a forged "no such record" for a zone without DNSSEC still reads as "no key" (:ref:`lit-unauthenticated-denial-existence`). Pepsi is as exposed to a mis-issued certificate as every other client wherever a server is authenticated by the Web PKI: an MTA-STS peer, a verified smarthost, a WKD or key-server fetch. Its TLS clients act on a stapled OCSP response that says the certificate is revoked but fetch no revocation information themselves, and Certificate Transparency is checked only to warn (:ref:`lit-ca-misissuance-compromise`, :ref:`lit-ct-equivocation-sct-enforcement`). **End-to-end encryption inherits the weaknesses of S/MIME and OpenPGP.** S/MIME mail is sent as authenticated ``AuthEnvelopedData``, with a one-time plaintext notice to a correspondent for whom nothing is recorded, unless the correspondent's capability record says that their client cannot read it. Mail to such a client (Thunderbird, by measurement) is unauthenticated CBC, which keeps the EFAIL malleability attacks alive on the way to it. A CBC plaintext that arrives here and that no signature covers is delivered as plain text, so the gadgets have nothing to render in the clients of Pepsi's own users (:ref:`lit-efail-malleability-gadgets`, :ref:`lit-aead-downgrade-to-unauthenticated`). S/MIME certificates are checked against the CRLs that ``pepsi-keydisc`` fetches, soft-failing when none can be had. A signer chain is checked at decryption. A cached peer certificate is no key for encryption once it is revoked by a list signed by an enabled trust anchor, or by an intermediate that was fetched under ``CA_ISSUERS_FETCH`` and chains to one. Any other list revokes nothing; of the TLS paths only the inbound client certificate is checked against CRLs, and the outbound clients act only on a stapled OCSP response (:ref:`lit-revocation-soft-fail`, :ref:`lit-stale-certs-after-key-exposure`). Keys learnt from inbound mail are trust-on-first-use, narrowed by DKIM: a key from a message whose aligned signature covered it cannot be replaced from unsigned mail, and encrypting to any unpublished key triggers a lookup of the published sources in the background; first contact with a correspondent whose domain signs nothing remains open to a forged ``From:`` (:ref:`lit-autocrypt-key-injection`). Header fields are protected and messages padded by default, but the envelope and the transport metadata stay in clear; a signature whose protected ``From:`` differs from the visible one is not trusted (:ref:`lit-unprotected-mail-headers`, :ref:`lit-cleartext-metadata`). A signature is bound to its intended recipient only where its signer named them, as Pepsi's own OpenPGP signatures do. Most other signers do not, S/MIME has no such binding, and a signed message forwarded unencrypted still verifies (:ref:`lit-surreptitious-forwarding`). Known-compromised keys and RSA keys that share a prime are refused (:ref:`lit-shared-or-known-private-keys`). A new S/MIME identity is an EC key that never performs RSA decryption; its ECDH and ECDSA run on AWS-LC's constant-time arithmetic. For the RSA identities that a site holds, every private-key operation runs on AWS-LC's constant-time arithmetic too, except for one branch on its PKCS #1 v1.5 unpadding or OAEP decoding verdict (:ref:`lit-timing-bleichenbacher-marvin`). The OpenPGP library has a known subkey-binding flaw with no fixed release, which Pepsi works around with a check of its own (:ref:`lit-openpgp-binding-signatures-unchecked`). **What people see and do cannot be fixed by the server alone.** Look-alike names, misleading display names and users who send in clear by mistake are open in every mail system (:ref:`lit-sender-display-deception`, :ref:`lit-confusable-lookalike-names`, :ref:`lit-accidental-plaintext-sending`). Pepsi refuses a submitted display name that claims another address and marks such inbound mail, as it marks inbound mail from look-alikes of the domains it serves, and its subject tags and :doc:`secure-link` portal narrow the rest, but none of this closes them. :ref:`research-who-must-act` lists every open issue by who can close it. .. include:: ../research/issues/1-transport.rst .. include:: ../research/issues/2-senderauth.rst .. include:: ../research/issues/3-format.rst .. include:: ../research/issues/4-software.rst .. include:: ../research/issues/5-e2e.rst .. include:: ../research/issues/6-crypto.rst .. include:: ../research/issues/7-people.rst .. _research-who-must-act: Who must act on what remains ============================ This section lists every issue assessed above as *partly addressed* or *vulnerable*, by who would have to act to close it, and within that by the cause of the weakness. It includes issues that are not Pepsi's fault: weaknesses written into a standard, kept for compatibility with other mail systems, or left to what the user has to do. An issue that needs action from two parties is listed under both, and the table counts it for both; its last row counts each issue once. Each entry links to the issue's description and assessment and gives the verdict and impact. .. include:: ../research/issues/who-must-act.rst