96. 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 Bibliography; the per-work analyses and BibTeX entries are kept in the source tree.
96.1. 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:
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.
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.
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, Who must act on what remains, 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 Threat model and Security model.
96.2. Summary¶
Area |
Issues |
Not applicable |
Addressed |
Partly addressed |
Vulnerable |
|---|---|---|---|---|---|
81 |
5 |
23 |
47 |
6 |
|
67 |
7 |
20 |
38 |
2 |
|
9 |
0 |
6 |
3 |
0 |
|
79 |
5 |
52 |
22 |
0 |
|
84 |
11 |
29 |
39 |
5 |
|
54 |
3 |
31 |
20 |
0 |
|
40 |
4 |
12 |
23 |
1 |
|
Total |
414 |
35 |
173 |
192 |
14 |
Area |
Critical or high |
Medium |
Low |
Total |
|---|---|---|---|---|
0 |
23 |
30 |
53 |
|
0 |
7 |
33 |
40 |
|
0 |
0 |
3 |
3 |
|
0 |
5 |
17 |
22 |
|
0 |
9 |
35 |
44 |
|
0 |
1 |
19 |
20 |
|
0 |
8 |
16 |
24 |
96.2.1. 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 (Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment)). pepsi-setup suggests
p=reject for the operator’s own domains, but publishing it is the operator’s
decision (Missing, invalid or non-enforcing DMARC policies leave domains spoofable). 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
(Forwarders, relays and lists launder spoofed mail into authenticated mail,
Forwarders DKIM-sign spoofed mail for the domains they host). 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 (Over-broad client-certificate trust and missing issuer and key-usage checks). 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 (Authenticated accounts and tenants may send as any From address).
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 (IP blocklists evaded by bots, webmail accounts and shared networks,
Blocklist collateral damage and authentication-misconfiguration bounces). Automatic replies are not sent when SPF
or DMARC definitely fails, but still answer senders who are merely
unauthenticated (Bounces, auto-replies and MDNs reflected at forged return addresses).
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 (Opportunistic STARTTLS can be stripped by an active attacker, MTA-STS first-contact gap and blocking of policy discovery).
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
(Mail routing and sender authentication rely on unauthenticated DNS, Stub resolvers trust an unauthenticated AD bit from the recursive 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” (Unauthenticated or failed denial of existence suppresses DNS records). 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 (CA compromise, coercion and mis-issuance of certificates,
Log equivocation and unenforced Certificate Transparency).
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
(EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail,
Downgrade from authenticated to unauthenticated encryption under the same key). 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 (Revocation not checked or soft-failed by clients,
Stale certificates and missing revocation 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: (Autocrypt and in-band key exchange open to key injection and MITM). 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 (Header fields not protected by signature or encryption,
Cleartext metadata, headers and lengths of encrypted mail). 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 (Surreptitious forwarding: signatures not bound to the intended recipient).
Known-compromised keys and RSA keys that share a prime are refused
(Private keys shared across devices or publicly known). 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
(Timing and microarchitectural Bleichenbacher oracles (Marvin and successors)). The OpenPGP library has a known
subkey-binding flaw with no fixed release, which Pepsi works around with a check
of its own (OpenPGP subkey and user ID binding signatures not verified).
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 (Sender display deception: display names, look-alikes, RTLO and truncation, Look-alike and IDN homograph domains, confusable characters and alias addresses, Users send mail unencrypted by mistake because encryption state is unclear). 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 The secure-link fallback portal portal narrow the rest, but none of this closes them.
Who must act on what remains lists every open issue by who can close it.
96.3. Transport and infrastructure¶
SMTP relaying, STARTTLS and TLS, MTA-STS, DNS, DNSSEC and DANE, and the hosting and routing infrastructure under them.
96.3.1. Implementation defects¶
Memory safety, injection, parser differentials and logic errors in a particular implementation.
96.3.1.1. SMTP smuggling via inconsistent end-of-data handling¶
SMTP ends a DATA transfer with <CR><LF>.<CR><LF>, and RFC 5322 forbids a
bare CR or LF in a message, yet implementations diverge: some sending servers pass
bare-LF or bare-CR sequences around a dot (or sequences with a NUL byte) through
unchanged, while some receiving servers accept such a sequence as the end of the
data. When a message travels from a sender of the first kind to a receiver of the
second kind, the receiver ends the message early and reads the rest as further
pipelined SMTP commands – a second, attacker-composed transaction with any envelope
sender and headers. Because that message really arrives from the provider’s
legitimate outbound server, it passes SPF, and DMARC aligns for every domain whose
SPF record authorises that server. Longin disclosed the technique in December 2023
[longin2023]: GMX/Ionos and Exchange Online passed a bare-LF variant, Postfix,
Sendmail, Fastmail and Runbox accepted it, and Cisco’s secure email gateways turned a
bare CR into a line end by default; the receiver side became CVE-2023-51764
(Postfix), CVE-2023-51765 (Sendmail), CVE-2023-51766 (Exim) and CVE-2024-27305
(aiosmtpd). A free account at an affected provider sufficed to spoof domains such as
microsoft.com.
Eight months later Wang et al. found seven new NUL-based payloads by fuzzing and
showed that the problem was far from fixed [wang2025]: 18 of 20 public services
(including Gmail, Outlook and Yahoo) and all five tested MTAs passed at least one
payload on the sending side, 8 of 22 services plus 1,577 private mail systems were
vulnerable on the receiving side, and shared SPF records magnify the reach (81,718
top-million domains include Outlook’s SPF, 63,225 Gmail’s). The SMTP revision now
states the rule explicitly: a server MUST NOT accept LF-only line endings or treat
<LF>.<LF> as end of data, and a client MUST NOT send a bare CR or LF
[draft-ietf-emailcore-rfc5321bis]. The same desynchronisation appears inside a
single client when its dot-stuffing is wrong, as in the Rust library lettre, whose
escaping missed a period after two consecutive CRLFs and let a message body inject
SMTP commands into the application’s session (CVE-2021-38189) [rustsec-2021-0069].
The fix is strict parsing on both sides: receivers accept only <CR><LF>.<CR><LF> and
may refuse unauthorised pipelining; senders refuse, normalise or encode bare CR, bare
LF and NUL.
Pepsi: Addressed. Impact: none.
As a receiver pepsi-ingress is strict. read_data in
pepsi-ingress/src/smtp/session.rs refuses any DATA line not terminated by
CRLF and closes the session with 500 5.6.0 (so neither <LF>.<LF> nor any
mixed variant can end a message), recognises the end of data only as a CRLF-framed
line consisting of a single dot, and rejects arguments after DATA, RSET and
STARTTLS so that command boundaries cannot be read differently either. BDAT
chunks are length-delimited and normalised to CRLF (message::normalize_crlf)
before they enter the queue. As a client, dot_stuff in
pepsi-common/src/smtp/client.rs stuffs a dot after every LF, including after
consecutive CRLFs (the lettre bug), and completes a trailing bare LF to CRLF; Pepsi
does not use lettre, and pepsi-sendmail normalises line endings and stuffs dots
the same way (pepsi-ingress, pepsi-sendmail).
The bare CR needs its own rule. Suppose that a body line such as
text<CR>.<CR>MAIL FROM:... were accepted, stored and relayed verbatim by
pepsi-stage-relay-to-internet and pepsi-stage-relay-to-smarthost, which
always send over DATA. A next hop that converts bare CR to CRLF, as Cisco
gateways do by default, would then see a second message coming from the Pepsi
host’s address. That message would pass SPF and DMARC for the deployment’s own
domains and bypass USERNAME_MAP and DKIM signing. Ingress therefore refuses
any DATA line in which a bare CR frames a dot (the line contains
<CR>.<CR>, starts with .<CR> or ends with <CR>.); it answers
500 5.6.0 and closes the session. So no end-of-data marker can be smuggled
in for a receiver that reads a lone CR as a line ending, whether the body comes
from an authenticated user or from an outside sender whose message Pepsi
forwards. Other bare CRs, which cannot form such a marker, are still
relayed unchanged, so no originator’s DKIM signature is broken by rewriting them.
96.3.1.2. STARTTLS command and response injection via retained plaintext buffers¶
A protocol that switches from plaintext to TLS mid-session must forget everything
received before the handshake. Many implementations instead kept their
application-level read buffer and only swapped the read and write functions, so bytes
that arrived in the same packet as the STARTTLS command were read after the
handshake as if they had come through the protected channel. A man in the middle
appends commands to the client’s STARTTLS; the server executes them inside the
client’s TLS session. Venema found this in Postfix in 2011 (CVE-2011-0411) and
showed it affected many other servers and appliances, while Sendmail and Exim, which
replace the whole stream, were immune [postfix2011]; it is also catalogued among the
known TLS attacks [rfc7457] and in textbooks [schwenk2022a]. The SMTP AUTH
specification already required client and server to discard all knowledge obtained
before a security layer is established [rfc4954].
Poddebniak et al. revisited the class systematically for SMTP submission, IMAP and POP3 a decade later [poddebniak2021]. They found eight new server instances and about 320,000 vulnerable servers on the Internet (2% of all e-mail servers), and added the client-side mirror image, response injection, in which forged server replies appended before the handshake are consumed inside TLS. Exploits include logging the victim into the attacker’s account so that the victim’s next login or message lands in the attacker’s mailbox, and IMAP tag reflection that serves attacker-chosen HTTPS content under the mail server’s certificate. Follow-up advisories covered the Dovecot submission server (CVE-2021-33515) [cve-2021-33515], the Mutt and NeoMutt clients (CVE-2020-14954) [cve-2020-14954] and Exim’s outbound SMTP client when relaying to another MTA (CVE-2021-38371) [cve-2021-38371]. The fix is to clear (or refuse) buffered input at the switch, or to use implicit TLS.
Pepsi: Addressed. Impact: none.
Every STARTTLS transition in Pepsi drops the plaintext buffer. On the server
side, handle_starttls in pepsi-ingress/src/smtp/session.rs clears rbuf
right after its 220 reply and before the rustls handshake, and afterwards resets
the greeting, the EHLO state and the envelope; AUTH is only offered on an
encrypted session, so no authentication state can carry over. On the client side,
Client::upgrade in pepsi-common/src/smtp/client.rs clears its read buffer
before the handshake and the caller re-issues EHLO/LHLO over TLS, which covers
the internet and smarthost relays and pepsi-stage-relay-to-lmtp. The IMAP client of
pepsi-helper-mailbox-scan hands the bare socket to TLS via async-imap’s
into_inner, which discards the library’s buffer, and starts a fresh session on
the encrypted stream. The client refuses to send SASL credentials over a connection
that is not encrypted, and a STARTTLS transport that is required fails when the
offer is missing (SmtpError::Transient). Stripping of opportunistic
STARTTLS is a different issue, see Opportunistic STARTTLS can be stripped by an active attacker and
An active network attacker.
96.3.1.3. Shell command injection via SMTP envelope addresses in MTAs¶
Several MTAs let an envelope address reach an interpreter. In Exim 4.87 to 4.91 a
failing recipient was passed through expand_string(), whose ${run{...}} item
executes commands, so a crafted recipient (or, in the default configuration, a
sender address that a frozen bounce later reaches after about seven days) ran code
as root (CVE-2019-10149) [qualys2019]. In OpenSMTPD a validation routine returned
success for an invalid local part when the domain was empty, and local delivery ran
the MDA command line through /bin/sh -c with the sender substituted, giving
remote root code execution with a single message (CVE-2020-7247) [qualys2020]. In
Zimbra’s postjournal service the RCPT TO address was placed inside double
quotes in a popen() command, where command substitution still works
(CVE-2024-45519), exploitable without authentication when the service was enabled
[projectdiscovery2024]. The common lessons are to never let envelope data reach a
shell or an expansion language, to pass arguments as an array, and to fail closed
in validation.
Pepsi: Addressed. Impact: none.
No Pepsi component builds a shell command from message or envelope data. Helpers
are started with argument arrays (std::process::Command): the Maildir writer
gets a uid, the auto-pay helper gets taler:// URIs and amounts that are
already parsed, and the
message itself goes on standard input. The only /bin/sh -c is in
pepsi-helper-dot-forward, which runs the |command that the user wrote in
their own ~/.forward, after fully dropping to that user, with a fixed PATH
and no envelope data in its arguments or environment
(pepsi-stage-dot-forward). Mustache templates render values as
text, and the configuration’s ${VAR} substitution applies to configuration
values only, never to addresses. Ingress also rejects control characters in
envelope addresses (pepsi-ingress/src/smtp/command.rs).
Argument (not shell) injection is closed too. pepsi-stage-secure-link with
PIN_DELIVERY = command passes the recipient address to the operator’s
PIN_COMMAND (deliver_by_command) after a -- separator, so a
sender-chosen recipient whose local part legally begins with - cannot look
like an option to a gateway script; the address is the second argument
($2), and the PIN goes on standard input only.
96.3.1.4. TLS library implementation bugs (Heartbleed and kin)¶
Beyond protocol flaws, TLS fails through implementation mistakes: libraries that omit server certificate validation (for example Python 2 HTTP libraries, CVE-2013-2191), skip the host-name check or read the name from the Common Name instead of the subjectAltName, validate chains incorrectly or ship outdated trust anchors, and memory-safety bugs such as Heartbleed (CVE-2014-0160), which disclosed server memory including private keys. RFC 7457 lists these together with the usability failure of clients that let users accept invalid certificates [rfc7457]. The remedies are correct, validating-by-default libraries, policy mechanisms such as HSTS and pinning, and careful UI design.
Pepsi: Partly addressed. Impact: low.
Every TLS endpoint of Pepsi uses rustls 0.23 with the aws-lc-rs provider and
with_safe_default_protocol_versions (pepsi-common/src/smtp/tls.rs,
pepsi-ingress/src/smtp/mod.rs). These endpoints are pepsi-ingress,
pepsi-httpd, the relay, LMTP and IMAP clients, key discovery over HTTPS and
LDAP and its HTTPS fetcher that pepsi-tlsrpt reuses, the HTTP client of
pepsi_common::http_client, and the client for DNS over TLS and HTTPS in
pepsi-common/src/dns.rs. rustls is written in memory-safe Rust, has no
heartbeat extension, and validates certificates and host names with webpki by
default; pepsi-helper-mailbox-scan always verifies, and credentials are never sent
on an unencrypted connection. cargo deny check (part of the quality gate) fails the
build on a published RustSec advisory in any dependency.
The residue is inherent in depending on a TLS stack. The cryptographic primitives
in aws-lc are C code, and Pepsi’s own verifiers are custom code on the
security path: DANE in pepsi-common/src/smtp/dane.rs, the soft Certificate
Transparency check in smtp/ct.rs, the evaluation of stapled OCSP responses in
smtp/ocsp.rs, and client-certificate pins and path validation. A future
library bug would affect every deployment until it is updated.
Opportunistic TLS to MX hosts without certificate validation is a separate,
deliberate choice discussed in MTAs accept unvalidated certificates and rarely use DANE or MTA-STS. Operators must
apply updates promptly; the developers keep the dependency set small and audited.
96.3.1.5. Pre-TLS plaintext phase lets attacker tamper with mailbox and client UI¶
Poddebniak et al. found that the plaintext phase before STARTTLS leaks into the
protected session in ways other than buffering [poddebniak2021]. IMAP clients
accepted untagged data responses sent before STARTTLS and stored them as mailbox
state, so a man in the middle could tamper with the locally cached mailbox. Many
servers kept state set in the plaintext phase (a POP3 user name, even a fully
authenticated SMTP session) after the switch, contrary to the standards; the authors
found no practical exploit for the server fixations they saw. And clients showed
attacker-controlled text from plaintext-phase responses (error texts, IMAP ALERT,
POP3 response codes) in prominent dialogs, a ready phishing vector in an apparently
secure session. The fix is to discard all state and data obtained before the
handshake, never show plaintext-phase server text, and prefer implicit TLS.
Pepsi: Addressed. Impact: none.
Pepsi has no IMAP or POP3 server and no mail client user interface. Its SMTP server
resets the greeting, EHLO domain and envelope on STARTTLS and offers AUTH
only after TLS is up, so no authentication state can be established in plaintext;
its SMTP and LMTP clients discard the pre-TLS EHLO capabilities and re-issue
EHLO/LHLO over TLS (pepsi-common/src/smtp/client.rs); and the IMAP
client of pepsi-helper-mailbox-scan ignores the plaintext greeting and starts a
new session on the encrypted stream, reading only header blocks with EXAMINE
(see STARTTLS command and response injection via retained plaintext buffers).
96.3.1.6. HTML forms send cross-protocol commands to SMTP, POP3 and IMAP¶
Topf described in 2001 how a web page or HTML e-mail turns the victim’s browser into a
client for a line-based protocol on another port [topf2001]. An HTML form may POST
to any host and port, and with multipart/form-data a text area’s content is sent
unencoded, so the request body can carry SMTP, NNTP, POP3 or IMAP command lines.
The target server answers the HTTP request line and headers with “command
unrecognised” errors, keeps the connection open, and executes the commands that
follow. Sendmail 8.9.3, Exim 3.16 and INN 2.2 all accepted them; Internet Explorer
5.5 and Opera 5 imposed no port restrictions. The attacker borrows the victim’s
network position: relaying mail through servers that trust the victim’s address or
sit behind a firewall, issuing commands to address-authenticated POP3 and IMAP
servers, and hiding their own origin. The fixes are for browsers and proxies to block
the well-known ports of line-based protocols, and for servers to close the connection
on an HTTP request line or after a few unknown commands (Exim did so in 3.32).
Pepsi: Addressed. Impact: none.
The decisive fix landed in the browsers: the Fetch standard’s list of blocked ports
includes 25, 110, 143, 465, 587, 993 and 995, so current browsers refuse to connect.
Pepsi itself has no POP3 or IMAP server, ingress never authenticates a TCP client by
address alone for anything but MYNETWORKS relaying (empty unless the operator
lists networks or answers TRUST_LOOPBACK in the wizard; an entry outside
loopback must be bound by SENDER_MAP or ingress refuses to start), and the
local submission socket is a UNIX socket that a browser cannot reach.
pepsi-ingress also defends on its own: the command loop in
pepsi-ingress/src/smtp/session.rs closes the session with 554 at the first
HTTP request line (GET, POST, CONNECT, …) or Host:/User-Agent:
header (command::is_http_request), as Postfix does. A browser’s form
submission always begins with its request line, so a browser without the port
block (old, embedded, or behind a forwarding proxy) on a host inside
MYNETWORKS cannot relay through Pepsi. Other unrecognised lines are
answered with 500, and at the tenth such line ingress closes the session
with 421 (MAX_UNRECOGNISED_COMMANDS); see also
SMTP tunnelled through HTTP proxies and CDNs to borrow their IP addresses.
96.3.1.7. SMTP tunnelled through HTTP proxies and CDNs to borrow their IP addresses¶
The BreakSPF study used shared infrastructure to obtain IP addresses that many SPF records authorise, and widened that pool by tunnelling SMTP through HTTP forwarding services [wang2024]. An HTTP proxy, or a CDN whose origin is set to the victim’s MX on port 25, forwards a crafted HTTP request whose body, request line or even a single header contains the SMTP dialogue. It works because receiving MTAs tolerate the unknown commands formed by the HTTP lines and accept bare LF line endings, while the HTTP service itself uses CRLF, so SMTP content can be smuggled inside one HTTP header. The spoofed message then arrives from the proxy’s or CDN’s address and passes SPF, and with alignment DMARC, for every domain whose record covers that address. The paper asks proxy and CDN operators to refuse connections to mail ports and domain owners to authorise only addresses they use; it prescribes no MTA-side fix.
Pepsi: Addressed. Impact: low.
As a receiver pepsi-ingress does not serve as an endpoint for the HTTP
forms of the technique. DATA lines must end in CRLF, so the variant that
packs the whole dialogue into one HTTP header and relies on bare LF to separate
message lines fails with 500 5.6.0. As Postfix does, ingress closes the
session with 554 5.5.0 as soon as an HTTP request line or a Host: or
User-Agent: header arrives where a command is expected. A request line is
GET, POST, CONNECT, or another method followed by an HTTP/
version (command::is_http_request, checked in
pepsi-ingress/src/smtp/session.rs). A forwarded HTTP request therefore never
reaches the request body that carries the SMTP transaction. What still works is
a raw TCP tunnel, such as an HTTP proxy’s CONNECT method, which hands the
receiver nothing but SMTP; Pepsi then evaluates SPF correctly against the
proxy’s address. The false pass comes from the domain owner’s over-broad SPF
record (see Overly permissive SPF (+all, shared-provider includes, cloud IP pools)) and the proxy operator’s open
mail port, and
inbound authentication is fail-open unless DMARC_ENFORCE is set, which
the wizard does for a new installation (A remote sender).
Pepsi’s own domains are exposed as senders only if the operator publishes an
SPF record that covers shared address space, which pepsi-setup does not do
(it prints records naming the host itself). See also
HTML forms send cross-protocol commands to SMTP, POP3 and IMAP.
96.3.1.8. Bailiwick and cache-acceptance flaws let resolvers cache out-of-zone records¶
A recursive resolver must decide which records in a response it may cache, and the standards give the bailiwick rule (accept only data within the zone the answering server is authoritative for) but no algorithm. RFC 3833 already noted that records whose data contain a name (CNAME, NS, DNAME, MX) let whoever serves one response introduce names and claim data for them, which relevance checks do not stop, and that DNSSEC validation is the real fix [rfc3833]. MaginotDNS showed that BIND, Knot Resolver, Microsoft DNS and Technitium initialise the bailiwick zone with an ancestor or the root when they act as forwarders whose cache is shared with recursive mode, so a forged delegation for a whole TLD is cached (CVE-2021-25220, CVE-2021-43105, CVE-2022-32983); at least 35.5% of the probed combined servers were vulnerable [li2023]. By differential fuzzing, ResolverFuzz found further acceptance bugs in all six tested implementations: out-of-bailiwick records in forwarding mode, PowerDNS caching every record of a forwarded response, acceptance of large fragmented responses, and caching of unsolicited delegations that keeps revoked domains alive [zhang2024b]. Wu et al. then showed that the zone-based rule itself breaks on shared DNS providers: a customer controlling one subdomain at a dynamic DNS, hosting or CDN platform can make the shared authoritative servers return records for the parent or sibling names, and seven of eight resolvers (including BIND 9, Unbound and PowerDNS), 44.64% of open resolvers and 21 of 30 public services accepted them [wu2026b]. The vendors have since checked owner names against the query name and stopped caching unsolicited NS records; DNSSEC validation protects signed zones.
Pepsi: Partly addressed. Impact: medium.
Pepsi does not resolve recursively. It queries the recursive resolvers listed in
DNS_SERVERS (a consumer’s own section, else [pepsi]; plain, or DNS over
TLS or HTTPS), else the one named in resolv.conf, through
hickory’s stub resolver and through raw queries in pepsi-common/src/dns.rs. Those
raw queries check the transaction id and the question echo and use only the answer
section; hickory’s stub cache keys entries by the query, and a reading of its
caching client found no path that serves additional-section records as answers for
other names (not exhaustively verified).
Pepsi’s own pepsi.dns_address table caches only addresses that it looked up for an MX
host. Where it matters most, Pepsi does not believe the resolver alone: DANE and key
discovery’s OPENPGPKEY/SMIMEA lookups are used only with the AD bit set,
MTA-STS policies come over verified HTTPS, and the manual’s hardened profile asks for
a validating resolver on loopback (The network adversary).
The resolver itself is the operator’s choice and is where these bugs live. A poisoned resolver redirects every unsigned lookup that Pepsi makes: MX hosts for outbound mail (where only MTA-STS or DANE stops interception), SPF and DMARC records and DKIM keys for inbound authentication, and TLSRPT targets (see Mail routing and sender authentication rely on unauthenticated DNS). Operators should run a current, validating resolver dedicated to the host and not shared as a forwarder; Pepsi can only recommend this.
96.3.1.9. DNS label misinterpretation and unvalidated DNS data injected into applications¶
DNS labels may legally contain dots, NUL bytes and arbitrary octets, and TXT-like records carry arbitrary text, so whoever runs an authoritative server can place injection payloads in its own records. Jeitner and Shulman showed that some resolvers decode wire-format names naively, turning a dot inside a label into a separator or treating a NUL as end of string, so that a record served legitimately under the attacker’s domain is re-read and cached as a record for a victim name; about 105,000 open resolvers were vulnerable, off-path defences do not help, and common DNSSEC setups did not prevent it [jeitner2021]. The same paper found DNS data used unchecked elsewhere: NAPTR/SRV data passed to shell tools and format strings in eduroam’s radsecproxy, URLs built from SRV data in OpenJDK’s LDAP discovery, and stub resolvers that returned names with characters invalid in host names: all tested libc implementations except glibc, plus Windows, Go, OpenJDK and Node. Such names enabled terminal escape injection and stored cross-site scripting through a PTR record in a router’s web interface. The remedies are escaping in resolvers and validation of DNS-derived values for the context in which an application uses them.
Pepsi: Partly addressed. Impact: low.
Pepsi treats DNS data as untrusted input in the places where it reuses it. hickory
parses names structurally, so a dot or NUL inside a label stays inside that label, and
renders them with escapes (\. and octal \DDD for control bytes, in
hickory-proto’s label formatting): the PTR name that pepsi-ingress writes into
its Received: comment therefore cannot carry a CR/LF or break out of the comment.
A TLSRPT rua=mailto: address from a TXT record is checked to be a single plain
addr-spec before it is used (validate_rua_mailto in pepsi-tlsrpt) and an
https: target goes through a hardened fetcher; MX host names must parse as DNS
names for rustls before a connection is made; SPF explanation text is not used at all.
DNS-related injection into sender authentication is treated in
Untrusted SPF macro, explanation and trace data from DNS and NUL byte in DKIM selector/domain interpreted differently by DNS.
The residue is the label misinterpretation in the recursive resolver, which Pepsi cannot see: a resolver with this flaw poisons the answers that Pepsi receives just like the flaws of Bailiwick and cache-acceptance flaws let resolvers cache out-of-zone records. Running a current resolver is the operator’s part.
96.3.1.10. Resolvers abort or crash on malformed responses and bad CD-bit caching¶
A resolver waiting for an answer should discard a malformed response, or one with the
wrong transaction id, and keep listening for the genuine one. The TuDoor study found
that 20 of 28 implementations instead aborted the resolution on certain malformed
packets (or ICMP errors) processed before the id check, returning SERVFAIL that
negative caching then prolongs. By spraying a few such packets over the
source-port range, an off-path attacker kills every outstanding query that it
hits within about a second; this worked in BIND, PowerDNS, 17 public services and
stub libraries such as c-ares [li2024].
ResolverFuzz also triggered an assertion failure in BIND’s dispatch code with
mutated queries, crashing the resolver remotely (fixed in BIND 9.18.3)
[zhang2024b]. The RUC attack abuses the Checking Disabled bit: resolvers cache records
fetched for CD=1 queries without validation and later reuse them for ordinary
validating queries, so a forged DNSKEY/DS, a dead nameserver address or a false
“no EDNS0” entry makes a whole signed zone fail for a day or more; 5 of 6 mainstream
implementations, 28 of 29 public services and 65.9% of validating open resolvers were
affected [zhang2025]. BIND, PowerDNS, Technitium, c-ares and others have shipped
fixes; segregating unvalidated cache entries is the general remedy.
Pepsi: Partly addressed. Impact: low.
Pepsi runs no resolver, so the crash and the CD-bit cache reuse are properties of the
operator’s resolver: a failed resolver makes DANE strict defer, DMARC and SPF
report temperror (fail-open) and outbound mail wait, which is a denial of service,
not a misdelivery (Availability). Pepsi never sets CD itself, which unit
tests assert for every query its raw client builds and for the hickory resolver it
configures; its raw queries set AD and DO and accept a SERVFAIL from a
validating resolver as a hard failure precisely so that a bogus answer cannot be
replaced by an unvalidated one from another server.
Pepsi’s own raw DNS client (pepsi-common/src/dns.rs, used for the TLSA,
MX-security, TLSRPT and key-discovery lookups) does not have the TuDoor pattern: a
reply counts only when it decodes, is a response and echoes the query’s random id and
question section, and over UDP udp_exchange drops any other datagram and keeps
waiting for the genuine answer until the query’s deadline, logging one warning per
query that saw such datagrams. Only a matching reply with TC set moves the query to
TCP. A spoofer can therefore delay a lookup to its timeout only by suppressing the
resolver’s answer, not by racing it with garbage.
The hickory stub resolver, used for MX, address, SPF, DKIM, DMARC, ARC and PTR
lookups, skips datagrams with the wrong source, id or question. Released hickory-net
0.26 ends the lookup at a datagram that passes those screens but does not decode (or
whose TSIG does not verify), so one forged datagram carrying the right port and id
turns the lookup into an error without another server being tried. Pepsi builds a
vendored hickory-net with that fixed (vendor/hickory-net, see
vendor/PEPSI-VENDORING.md): such a datagram is skipped like a forged question
section and the wait goes on until the request’s timeout, which a unit test in
pepsi-common checks against a resolver that sends two of them before its answer.
The fix is to be offered upstream; until a hickory release carries it, the vendored
copy stays.
Every off-path vector disappears with the resolver on loopback or reached over DNS
over TLS or HTTPS (tls:// or https:// entries in DNS_SERVERS, see
Most recursive resolvers do not validate DNSSEC), which carries both Pepsi’s own queries and
hickory’s.
96.3.1.11. Malicious content in received TLS reports¶
SMTP TLS Reporting has sending MTAs mail or POST daily JSON reports about their TLS,
MTA-STS and DANE outcomes to the address a domain publishes in its _smtp._tls
record. RFC 8460 warns that these reports are attacker-controllable input to whatever
system the receiving domain uses to process them, so a bug in a report handler can be
exploited by anyone able to send a report, and requires report contents to be treated
as untrusted and never evaluated [rfc8460].
Pepsi: Not applicable. Impact: none.
Pepsi only sends TLS reports (pepsi-tlsrpt); it has no component that
parses or aggregates reports it receives. Reports arriving at the address an operator
publishes with [pepsi-tlsrpt] RUA are ordinary mail: they pass the pipeline like any
other message, their gzip attachment is never decompressed or interpreted by Pepsi, and
what processes them afterwards is the operator’s choice. On the sending side, the
DNS-supplied report target is itself validated before use (see
DNS label misinterpretation and unvalidated DNS data injected into applications); suppression, flooding and redirection of reports are
treated in TLS reports can be suppressed, flooded or redirected.
96.3.2. Cryptographic weaknesses¶
Weak or broken algorithms, parameters and randomness, oracles, malleable encryption and side channels.
96.3.2.2. CBC padding and timing oracles in TLS (Lucky Thirteen, POODLE)¶
TLS’s CBC cipher suites authenticate before padding (MAC-then-pad-then-encrypt), so the receiver must remove padding of unauthenticated data and then check the MAC, and any observable difference between the two failures is a Vaudenay padding oracle. Canvel et al. used it to recover a password from a TLS-protected IMAP session that repeatedly sent the same login [meyer2013], and survey work lists it among the main record-layer attacks together with BEAST and CRIME [clark2013] [rfc7457]. POODLE (CVE-2014-3566) needs no timing because SSL 3.0 does not check padding at all [rfc7457]. Lucky Thirteen (CVE-2013-0169) showed that even implementations following the TLS 1.1/1.2 advice leak through the number of HMAC compression-function calls; a man in the middle who can make the client resend a secret in many sessions recovers it (about 2^23 sessions per block, fewer for base64 credentials), in OpenSSL, GnuTLS, NSS and many others [alfardan2013]. Fixes kept failing: the constant-time rewrite in OpenSSL lost a length check and became a new oracle on AES-NI servers (CVE-2016-2107) [openssl2016]; four libraries with “pseudo constant time” fixes leaked again with SHA-384 suites or through the shared cache (CVE-2018-0497, CVE-2018-0498, CVE-2018-10844 to -10846) [ronen2018]; and an Internet-wide scan found oracles on 1.83% of the Alexa top million, observable through different alerts, TCP RST versus FIN, or timeouts; they came from nearly 100 distinct vulnerabilities in products from Citrix, IBM, Cisco and others [merget2019]. Remote timing attacks on RSA and ECDSA keys belong to the same lineage of side channels in TLS stacks [meyer2013]. The lasting fix is AEAD cipher suites (AES-GCM, ChaCha20-Poly1305) or encrypt-then-MAC, and removing CBC.
Pepsi: Addressed. Impact: none.
rustls has never implemented CBC cipher suites, SSL 3.0 or TLS compression: every
suite it offers for TLS 1.2 and 1.3 is AEAD, and Pepsi enables no others (no
cipher_suites override anywhere in the tree). The MAC-then-encrypt record layer
that these attacks need therefore does not exist on any Pepsi TLS connection, inbound or
outbound, whatever the peer offers. CBC remains relevant to Pepsi only inside S/MIME
messages, which is a different issue: CBC padding and format oracles against unauthenticated S/MIME.
96.3.2.4. Legacy TLS versions and weak cipher suites still accepted (RC4, TLS 1.0)¶
Long after they were known to be broken, mail servers kept accepting obsolete protocol versions and cipher suites. RC4 keystream biases allow plaintext recovery from many encryptions [rfc7457], and RFC 9325 lists NULL, RC4, export-grade and other sub-112-bit suites, static RSA key transport, CBC MAC-then-encrypt, short RSA keys and SHA-1/MD5 signatures as insecure, recommending only TLS 1.2 or later with forward-secret AEAD suites [rfc9325]. The 2015 Internet-wide scans of mail found SSLv2 on up to 42% and SSLv3 on up to 83% of SMTP hosts, RC4 on more than 80%, export ciphers on 73-75% of SMTP hosts – 650,000 of them even inside TLS 1.1 and 1.2 – and anonymous DH widely accepted [mayer2016]; passively, up to 17% of mail connections still negotiated RC4 [holz2016]. A decade later the minimum version is still the problem: in German health care, the weakest MX of 65% of domains accepted TLS 1.0 in 2022 and 43% in April 2025, and since an attacker can block the better MX hosts, it is the weakest MX that counts [petrlic2025].
The attacker is a network adversary who downgrades or simply negotiates the weak option and then decrypts or tampers with the session. Mayer et al. also point out the trap of opportunistic SMTP: if a hardened server and a legacy peer share no suite, many MTAs fall back to cleartext, so unilateral hardening can lower protection [mayer2016]. The fixes are to disable SSLv2/v3, TLS 1.0/1.1 (RFC 8996), RC4 (RFC 7465) and export suites, as BSI TR-02102-2 also requires [petrlic2025] [rfc9325].
Pepsi: Addressed. Impact: none.
Pepsi’s TLS stack is rustls, which implements TLS 1.2 and 1.3 only and has no
RC4, NULL, export, anonymous, static-RSA or CBC suites; there is no option to
re-enable older versions because the library does not contain them (see
RFC Index, RFC 8446). The ingress listeners therefore already meet the
guidance against which Petrlic measures, and the outbound relay cannot be talked
down to a legacy version. Pepsi avoids the cleartext trap that Mayer et al.
describe: a
failed handshake after STARTTLS is a transient error
(pepsi-common::smtp::client::open_session), the next MX is tried and the
message is eventually deferred and bounced, never retried in cleartext. The cost
is availability, not confidentiality: a peer whose only TLS is 1.0 or 1.1 cannot
receive mail from Pepsi.
In the reverse-proxy mode of pepsi-setup the front web server’s defaults
apply. With OpenSSL 3 at its default security level, TLS 1.0/1.1 and RC4 are not
available; the stock HIGH cipher lists of nginx and Apache do still admit TLS
1.2 CBC and static-RSA suites, which is covered under
Missing forward secrecy: stolen keys or resumption state decrypt past traffic and CBC padding and timing oracles in TLS (Lucky Thirteen, POODLE).
96.3.2.5. Missing forward secrecy: stolen keys or resumption state decrypt past traffic¶
With non-ephemeral key exchange (static RSA key transport) the server’s long-term private key decrypts every recorded session, and stolen keys have been used for large-scale monitoring [rfc7457]. Holz et al. found that for some mail protocols more than 30% of connections used no forward-secret suite in 2015 [holz2016]. Even with (EC)DHE, forward secrecy is cut short by the performance shortcuts of TLS: a session cache holds master secrets, a session ticket carries the session keys encrypted under a Session Ticket Encryption Key (STEK) that the server keeps until it rotates it, and a reused ephemeral value ties many handshakes to one secret [rfc9325]. Springall et al. measured this on the Alexa top million in 2016: 22% of trusted sites reused a STEK for at least a week and 10% for a month, 7.2% reused DHE and 15.5% ECDHE values, a single STEK covered 62,176 CloudFlare domains, and 38% of sites had a window over 24 hours in which a later compromise (Heartbleed-style disclosure, seizure, compulsion) decrypts recorded “forward-secret” traffic [springall2016]. They measured HTTPS, but the mechanisms apply equally to IMAPS and SMTP.
The fixes are forward-secret suites only, protection of the private key, and for
resumption: frequent STEK rotation (at least daily), in-memory secrets that are
erased, short cache lifetimes, and in TLS 1.3 resumption with psk_dhe_ke
[rfc9325] [springall2016].
Pepsi: Partly addressed. Impact: low.
All TLS that Pepsi terminates or initiates itself runs over rustls with the
aws-lc-rs provider, whose TLS 1.2 suites are all ECDHE and whose TLS 1.3
handshakes always perform (EC)DHE, so a stolen certificate key allows
impersonation but not decryption of recorded traffic. Resumption follows the
recommendations by default: the ServerConfig built in
pepsi-ingress/src/smtp/mod.rs and pepsi-httpd/src/tls.rs keeps the rustls
default of no stateless tickets (no STEK exists), a 256-entry in-memory session
cache per process, TLS 1.3 resumption with psk_dhe_ke only, and no early
data; nothing is written to disk. The remaining window is the lifetime of a
cached TLS 1.2 session in a running process.
The residue is the optional reverse-proxy mode (pepsi-setup/src/proxy.rs),
in which nginx or Apache terminates TLS with the distribution’s defaults for
pepsi-httpd, including the secure-link portal (The secure-link fallback portal). Those
defaults enable TLS 1.2 session tickets under a key that lives until the server
restarts, and their HIGH cipher lists include static-RSA suites that a TLS 1.2
client may select. Modern browsers use TLS 1.3 with ECDHE, so the exposure is
limited to old clients and an attacker who later obtains the front server’s
memory or key. The site files that Pepsi generates turn session
tickets off (ssl_session_tickets off, SSLSessionTickets off). A
forward-secret cipher list is left to the operator: the generated site shares
the front server’s listening sockets with the operator’s other sites, and the
protocol and cipher choice there is effectively per socket, so Pepsi would be
changing the TLS of sites that it does not own. Instead, pepsi-setup reads the front server’s effective configuration (nginx -T,
or Apache’s configuration tree) and warns when its TLS 1.2 cipher list still
enables static-RSA suites (ciphers.rs, a simplified model of OpenSSL’s
cipher-string rules), naming the suites and how to exclude them (!kRSA), or
says that it could not determine the list.
Stored mail has no forward secrecy in any mail system and is not counted here.
96.3.2.6. Predictable CBC IVs in TLS 1.0 (BEAST)¶
In TLS 1.0 the CBC initialisation vector of a record is the last ciphertext block of the previous record, so it is known before the next record is encrypted. An attacker who can inject chosen plaintext into the connection (in the original demonstration, script in a browser) and observe the ciphertext can test guesses of one block at a time and recover secrets such as cookies (BEAST, CVE-2011-3389, 2011) [rfc7457]. TLS 1.1 introduced explicit random IVs; clients also deployed the 1/n-1 record split, and the general fix is TLS 1.2 or later with AEAD suites.
Pepsi: Addressed. Impact: none.
rustls implements neither TLS 1.0 nor any CBC cipher suite, so no Pepsi
endpoint can negotiate the construction (RFC Index, RFC 8446). In the
reverse-proxy mode the front server, with OpenSSL 3 at its default security
level, does not offer TLS 1.0 either. The chosen-plaintext precondition would in
any case be hard to meet against SMTP, where the attacker does not run code in
the client.
96.3.2.7. DNS source-port and TXID randomisation defeated by side channels or weak PRNGs¶
Since 2008, off-path cache poisoning has been held off mainly by the 32 bits of
entropy in a random UDP source port and transaction ID (TXID). A series of works
removes that entropy without being on the path. SAD DNS (2020) uses the
operating system’s global ICMP rate limit as a side channel to find the
resolver’s ephemeral port, after which only the 16-bit TXID has to be guessed;
over 34% of open resolvers and 85% of popular public services, including Google,
Cloudflare and Quad9, were vulnerable on Linux with BIND, Unbound and dnsmasq
(CVE-2020-25705) [man2020]. After the patch, Man et al. found that the Linux
next-hop exception cache, updated by spoofed ICMP “fragmentation needed” and
redirect messages, reveals ports even of connected sockets, again poisoning BIND
and a home router within minutes [man2021]. TuDoor (2024) showed that Microsoft
DNS accepted a query packet on the socket awaiting a response, exposing its port,
and that several resolvers allocated ports or TXIDs sequentially or copied the
client’s TXID upstream, allowing poisoning in under a second; 33 CVEs were
assigned [li2024]. Ben-Simhon and Klein then predicted both port and TXID of
BIND 9.18-9.21 from its non-cryptographic Xoshiro128** generator, recovering its
state from observed queries or from the order of large RRsets in its answers,
with 92-100% success in default configurations (CVE-2025-40780); on FreeBSD,
SO_REUSEPORT_LB made connected query sockets accept datagrams from anyone,
removing even the need to spoof addresses (CVE-2025-24934) [bensimhon2026].
The attacker must be able to trigger lookups through the resolver and, except
for the FreeBSD flaw, send spoofed packets. The gain is a forged record for any
name that is not DNSSEC-signed, such as an MX, an A record, or a policy or key
record, and the resolver serves it to every client for the forged TTL. The fixes
are kernel patches that randomise the ICMP limit and the exception cache,
IP_PMTUDISC_OMIT,
cryptographically secure port and TXID generation (BIND 9.18.41/9.20.15), the
FreeBSD patch of October 2025, and above all DNSSEC validation [man2020]
[man2021] [bensimhon2026].
Pepsi: Partly addressed. Impact: medium.
Pepsi does not contain a recursive resolver; it sends stub queries to the
resolver named in DNS_SERVERS or /etc/resolv.conf. Its own stub code is
sound: the raw queries in pepsi-common/src/dns.rs take the TXID from the OS
random generator (next_query_id), use a connected UDP socket on a
kernel-chosen ephemeral port, and discard any reply whose ID or question
section differs; hickory-resolver, used for the other lookups, also
randomises port and ID with a cryptographic generator. The manual’s hardened
profile asks for a validating resolver on a trusted path, unbound on
loopback or systemd-resolved with DNSSEC=yes (The network adversary), which
removes the stub-to-resolver leg from an off-path attacker’s reach and makes
signed zones immune; a resolver elsewhere can be reached over DNS over TLS or
HTTPS instead (tls:// or https:// entries in DNS_SERVERS), which
protects that leg the same way.
What remains is the operator’s recursive resolver and every zone that is not
signed. If it is an unpatched BIND or runs on an unpatched kernel, an off-path
attacker can poison the MX or address of a correspondent’s domain, the SPF and
DKIM records that ingress evaluates, or the _smtp._tls record that decides where
TLS reports go. Mail to a poisoned MX is protected only where the peer publishes
an MTA-STS enforce policy or DANE, and ingress authentication is fail-open
(Mail routing and sender authentication rely on unauthenticated DNS, Off-path DNS cache poisoning by forged responses (Kaminsky)).
Operators should run a current, validating resolver on the same host; domain
owners close the residue for their own zone only by signing it.
96.3.2.8. IP fragmentation enables off-path DNS cache poisoning¶
Only the first IP fragment of a DNS response carries the UDP port, the TXID and
the question, so all randomisation defences of RFC 5452 protect only that
fragment. An off-path attacker who can predict the IP ID sends a forged second
fragment ahead of the real one, adjusted so that the UDP checksum still verifies, and
the resolver reassembles a response carrying the attacker’s records. Herzberg and
Shulman demonstrated this in 2013 against Unbound and BIND with real zones such
as org: domain hijacking where DNSSEC validation is partial or permissive,
subdomain injection under NSEC3 opt-out, and name-server hijacking even under
full DNSSEC, because delegation NS and glue records are unsigned [herzberg2013].
DNSSEC itself made the problem worse: without algorithm negotiation a server
returns keys and signatures for every algorithm that a zone uses, so signed responses
often exceed the path MTU and give amplification factors of up to about 100
[herzberg2015]. Zheng et al. (2020) applied the technique to DNS forwarders such
as home routers, which trust their upstream and cache records individually: a
long CNAME chain forces a fragmented response, and a spoofed second fragment
plants records for an arbitrary name; 8 of 16 routers, dnsmasq 2.79 and
Microsoft DNS 2019 were vulnerable, while BIND, Unbound, Knot and PowerDNS in
forwarding mode were not [zheng2020].
The fixes are an EDNS buffer no larger than the path MTU (the 1232-byte DNS Flag Day 2020 default), TCP for large responses, caching forwarded responses as a whole or re-validating CNAME chains, random IP IDs, and complete DNSSEC deployment, which stops poisoning but not blocking [herzberg2013] [zheng2020].
Pepsi: Partly addressed. Impact: medium.
Pepsi’s own raw queries advertise an EDNS payload of 1232 bytes and retry over TCP
on truncation (EDNS_UDP_PAYLOAD and exchange in
pepsi-common/src/dns.rs), so responses to Pepsi are not fragmented on the
stub leg, which in the recommended set-up is loopback anyway
(The network adversary) or runs over TCP as DNS over TLS or HTTPS. Pepsi runs no forwarder and no authoritative server, so the
forwarder and amplification aspects do not apply to it.
The exposure lies, as in DNS source-port and TXID randomisation defeated by side channels or weak PRNGs, with the
recursive resolver that the operator chooses and with unsigned zones. Current Unbound
and BIND default to the 1232-byte buffer, but a deployment whose
resolv.conf points at a router-class forwarder or an old resolver inherits
the attack, and with it forged MX, SPF, DKIM or TLSRPT data for unsigned
domains. Where DANE is in use, pepsi-setup, every DANE worker at start and
pepsi-status report a resolver that does not validate, but nothing checks
the buffer size or whether the resolver is a forwarder. Operators
should run a current validating resolver locally.
96.3.2.10. Exposure to weak TLSA digest algorithms¶
A TLSA record names its matching type: the full certificate or key, SHA-256 or SHA-512 of it. RFC 6698 let a domain publish records with several digests but gave client and publisher no way to agree on the strongest shared one, so a client that accepts a match against any published record remains as weak as the weakest digest that the publisher keeps for older clients. If that digest were broken, an attacker could present a key matching only the weak record and be authenticated. RFC 7671 (2015) therefore added a digest agility rule: per usage and selector, a client should consider only full-value records and those with the strongest digest it supports, and ignore the rest [rfc7671].
Pepsi: Addressed. Impact: none.
pepsi-common::smtp::dane supports exactly the matching types exact (0),
SHA-256 (1) and SHA-512 (2) and ignores any other, so no weak digest is
accepted today. It also implements the agility rule of
RFC 7671 section 9: for each usage and selector, records whose digest is
weaker than the strongest one published for that pair are ignored, and exact
(full-data) records are always matched. A domain that publishes both SHA-512 and
SHA-256 associations is therefore matched on SHA-512 alone, so a break of
SHA-256 would not let a key matching only the SHA-256 record authenticate.
96.3.2.11. Coin key cached with first denomination and reliance on client RNG¶
The 2020 audit of the GNU Taler exchange found that the exchange’s
known_coins table records a coin public key together with the first
denomination and signature it was used with, whether or not that operation
succeeds; a coin public key validly signed under a second denomination is then
handled in an undefined way. No profitable attack was found, but the auditors
suspected that the exchange could be driven into an inconsistent state, a denial of
service. A related recommendation noted that Taler implicitly relies on good
randomness on customers’ devices: a broken generator, as in the 2008 Debian
OpenSSL bug, makes coin keys collide, and colliding coins look like double
spending, so customers could not spend coins they paid for [codeblau2020]. The
auditors proposed keying the table on coin key and denomination hash; an
exchange-provided seed was added in Taler 0.8.
Pepsi: Not applicable. Impact: none.
Pepsi runs no Taler exchange. Its payment features act as a merchant client
(pepsi-stage-anti-spam creates orders at an external merchant backend) and
as a wallet user: pepsi-stage-auto-pay and the wallet self-service run
taler-wallet-cli through pepsi-helper-auto-pay
(pepsi-stage-auto-pay). Coin keys are generated by the wallet,
which is a separate Taler component, from the server host’s kernel random
generator; Pepsi stores no coin keys and keeps no table analogous to
known_coins (its spending ledger is a budget keyed on the message nonce, not
on coins).
96.3.3. Protocol design gaps¶
Weaknesses of the design itself: missing bindings between identities, optional protection that can be stripped, and other design flaws.
96.3.3.1. Opportunistic STARTTLS can be stripped by an active attacker¶
STARTTLS upgrades a plaintext SMTP session to TLS, and the offer (“250 STARTTLS”) and the request travel in the clear before any protection exists. A man in the middle can delete the offer, corrupt the command or the reply so that the handshake fails, or simply present a certificate of its own, and because relays must keep mail flowing to peers that have no TLS, the sending MTA continues in cleartext or accepts the unauthenticated certificate. The specifications said so from the start: RFC 2487 and its successor RFC 3207 require that state learnt before the handshake be discarded and that TLS be configurable as mandatory per host, but explicitly do not want a missing offer to bounce mail [rfc2487] [rfc3207]. RFC 7435 made “some protection most of the time” the explicit design and noted that its unauthenticated encryption and trust on first use give no protection against an active attacker [rfc7435]. SMTP has no way to signal that a next hop must use TLS, so no TLS feature can prevent the downgrade [rfc7672]; textbooks, government guidance and surveys describe the same weakness and the same remedies [malatras2016] [nist2019] [schwenk2022a] [clark2021] [kim2025].
The attack is not hypothetical. In 2014 the EFF reported ISPs in the US and
Thailand stripping STARTTLS from their customers’ SMTP traffic [eff2014], and
Durumeric et al. found 41,405 SMTP servers in 4,714 ASes behind middleboxes
(mostly Cisco ASA/IOS “SMTP inspection”, which overwrites the keyword with
XXXXXXXX); more than 20% of inbound Gmail mail from seven countries, and 96%
from Tunisia, arrived in cleartext as a result [durumeric2015]. Measurements of
the time also show why stripping is rarely even necessary: fewer than 51% of
servers offered STARTTLS and only about 30% of those presented a valid chain
[holz2016]; large providers failed to start TLS after offering it, and
certificate failures were the norm [foster2014]. The attacker gains the content
and metadata of every message on the hop, and can modify it.
The fixes are recipient-side policies that the sender can check: DANE TLSA records in DNSSEC-signed zones, which make TLS mandatory and authenticate the server [rfc7672], and MTA-STS, an HTTPS-served policy that requires PKIX-valid TLS to listed MX hosts [rfc8461]. REQUIRETLS lets an originator demand validated TLS on every hop of one message [rfc8689], and Koerber et al. propose per-message confidentiality levels enforced by the sending MTA [korber2023]. Kim et al. propose publishing a server’s TLS capabilities in Certificate Transparency so that a client can hard-fail without a separate policy channel [kim2025]. All of these protect only mail to domains that publish something; for the rest, end-to-end encryption remains the answer [eff2014] [rfc8689].
Pepsi: Partly addressed. Impact: medium.
Pepsi’s outbound MTA, pepsi-stage-relay-to-internet, uses
opportunistic STARTTLS (TransportMode::OpportunisticStartTls in
pepsi-common/src/smtp/client.rs) with an accept-any certificate verifier for
every peer that publishes no policy, which is the majority of domains, for
every message whose originator did not ask otherwise. An
attacker who strips the offer gets the message in cleartext; one who
substitutes a certificate needs no stripping at all (see
MTAs accept unvalidated certificates and rarely use DANE or MTA-STS). Two things are better than in the
classic MTAs studied above: a failed handshake is never retried in cleartext
(the error falls through to the next MX), and a recipient’s MTA-STS enforce
policy is honoured by default (MTA_STS), as are TLSA RRsets whose records
are all unusable, which RFC 7672 section 2.2 says still make TLS mandatory
(host_tls_plan in pepsi-stage-relay-to-internet/src/delivery.rs). The
smarthost stage defaults to mandatory, verified STARTTLS
(pepsi-stage-relay-to-smarthost). And the originator has
REQUIRETLS (RFC 8689, REQUIRETLS residual weaknesses and TLS-Required override): a message submitted
with the parameter over the TLS listener leaves only over validated TLS to a
DNSSEC- or MTA-STS-validated next hop that advertises the extension, or
bounces (deliver_required in the same file; requiretls_route in the
smarthost stage). An attacker can turn such a message into a bounce, not into
cleartext, whatever the recipient domain publishes.
DANE is enforced in both of the ways RFC 7672 asks for. A destination whose
DNSSEC-signed TLSA records are usable is always contacted with mandatory
STARTTLS (section 2.2), in every DANE mode, so stripping the offer defers the
message instead of sending it in cleartext. And DANE = strict, the default
of both relay stages (code, sample configuration and wizard), defers a message
whose peer presents a certificate matching none of those records (and reports
it to the domain as tlsa-invalid through TLSRPT): a peer that published
DANE to forbid interception cannot be intercepted by an attacker presenting
another certificate. The price is deferred mail to domains with broken TLSA
records (see Stale or mismatched TLSA records break SMTP DANE); DANE = warn is an explicit
opt-out that logs the mismatch and falls back to the verification the hop has
without DANE. REQUIRETLS is the one per-message confidentiality level Pepsi
offers; a finer one, in the sense of Koerber et al., does not exist. Everything
else is the inherited limit of the protocol: untagged mail to domains without
DANE or MTA-STS cannot be protected against an active attacker at the
transport layer, and Pepsi’s answer is end-to-end encryption
(pepsi-stage-encrypt) or the secure-link portal for such
recipients. For mail to a Pepsi domain, pepsi-setup
prints TLSA, MTA-STS and TLSRPT records and pepsi-httpd serves the MTA-STS
policy; whether a sender honours them is up to the sender. Nothing further is
left for Pepsi’s code: what remains is for domain owners, who close the hop to
their domain by publishing DANE or an MTA-STS enforce policy (at the cost of
deferred mail when either breaks), and for sending MTAs, which must honour them.
96.3.3.2. Mail clients and access protocols use cleartext login or strippable STARTTLS¶
Between a mail client and its provider (submission, IMAP, POP3) the same opportunistic design exposes the user’s password, not just the mail. NIST already noted in 2002 that all popular mail protocols send user names, passwords and messages unencrypted by default [tracy2002]. RFC 4954 warns that an attacker can make a server appear not to support AUTH or make every AUTH fail, and that PLAIN reveals the password to an eavesdropper when no security layer is present [rfc4954]; RFC 9051 notes that a cleartext IMAP session lets an on-path attacker inject responses and that a PREAUTH greeting prevents the client from issuing STARTTLS at all [rfc9051]. In 2015 Holz et al. found PLAIN and LOGIN offered by more than 99% of submission servers (84.86% offered nothing else), mechanisms sometimes advertised before STARTTLS, and 71% of clients that did not upgrade to TLS authenticating in plaintext [holz2016].
Poddebniak et al. (USENIX Security 2021) showed that many of 28 tested clients
continued in plaintext when STARTTLS was removed from the capability list or
refused, sometimes in variants missed by earlier tests, and that PREAUTH and IMAP
referrals could be escalated to credential theft [poddebniak2021]. Tang et al.
(NDSS 2025) found that 14 of 30 clients with configuration auto-detect could be
downgraded (6 by an active attacker, 8 sending credentials in cleartext even to a
passive one), that 8 of 49 clients allow strippable opportunistic TLS when
configured by hand, and that many ignore the server’s “TLS required” hints
(LOGINDISABLED, SMTP 530) and send the password at once [tang2025]. The
attacker, for instance on a public Wi-Fi network, obtains the account password
and the mail. RFC 8314 is the agreed fix: implicit TLS on ports 465, 993 and 995,
a per-account minimum confidentiality level in the client, no credentials before
it is met, and eventually no cleartext access at all [rfc8314].
Pepsi: Partly addressed. Impact: low.
Pepsi has no IMAP or POP3 server (mailbox access is the MDA’s, e.g. Dovecot’s),
so its share is submission, where the server side is strict.
pepsi-ingress refuses to start a TCP submission listener
without MODE = tls or starttls (pepsi-ingress/src/config.rs),
advertises AUTH only after TLS is up and answers an AUTH in cleartext with
504 5.5.4 before looking at the credentials, so valid and invalid passwords
are refused identically; an unauthenticated MAIL on a submission listener gets
530, so no message is accepted over a stripped session either. Buffered
plaintext is discarded at STARTTLS (handle_starttls, see
STARTTLS command and response injection via retained plaintext buffers). The wizard writes an implicit-TLS listener
on port 465 next to the STARTTLS one on 587. Pepsi’s own client roles do not fall
back: the smarthost stage requires STARTTLS by default and refuses to send
credentials over an unencrypted channel, and the IMAP reader of
pepsi-whitelist verifies the server certificate and never
continues in the clear after STARTTLS (a deliberate plain setting
warns that the password is sent in the clear).
What remains is on the client side and cannot be fixed by the server: a client
that connects to port 587 and sends AUTH PLAIN with its password before
checking that TLS was negotiated leaks the password to an attacker who strips
STARTTLS, even though Pepsi then refuses it. The SASL mechanisms Pepsi offers
are PLAIN and LOGIN only (over TLS), so a client that skips certificate
validation also hands its password to an interceptor; challenge-response
mechanisms such as SCRAM would limit that, but they need the password database
(Dovecot) to support them. Operators can drop the port 587 listener and tell
users to configure implicit TLS on 465, at the cost of clients that know only
STARTTLS.
96.3.3.3. SMTP has no originator authentication: envelope and header sender forgeable¶
SMTP lets any client that connects to a server name any envelope sender
(MAIL FROM) and write any From:, Reply-To: and display name; neither
identity is authenticated or bound to the content. The current revision of the
SMTP specification still states that “anyone” can do so and defers to
end-to-end signatures for confidence in origin [draft-ietf-emailcore-rfc5321bis].
Sakamuri distinguished domain-level spoofing (forging another domain) from
user-level spoofing (a user of a domain forging another user of the same
domain), and argued that the domain-based schemes of the time could at best
detect the former [sakamuri2005]. NIST lists the consequences: phishing, fraud
and malware under a trusted identity, sent by outside attackers or by rogue
hosts inside an organisation’s address block, and loss of the impersonated
domain’s reputation [nist2019].
The fixes were added on top of SMTP: SPF authenticates the envelope sender’s
domain, DKIM signs the body and From:, and only DMARC alignment ties either to
the visible From: domain [schwenk2022a]. They protect only domains that
publish an enforcing DMARC policy and only at receivers that enforce it, they say
nothing about the individual user, and they have been bypassed repeatedly (see
Missing, invalid or non-enforcing DMARC policies leave domains spoofable, Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment),
Domain-level authentication never identifies the individual sender). For individual senders the
remaining answer is an end-to-end signature (S/MIME, OpenPGP)
[draft-ietf-emailcore-rfc5321bis] [nist2019].
Pepsi: Vulnerable. Impact: medium.
As a receiving MTA Pepsi cannot remove a weakness of SMTP: mail from a domain
without an enforcing DMARC policy can carry any From:, and Pepsi delivers it.
pepsi-ingress verifies SPF, DKIM and DMARC and records the result
in Authentication-Results and state.auth, but it is fail-open by design.
DMARC_ENFORCE defaults to no in the code, so on a configuration that
leaves it unset even a forgery of a p=reject domain, including the
deployment’s own, is delivered with an honest failing result
(A remote sender, The network adversary). The wizard writes yes for a new
installation, and pepsi-setup warns about a configuration that accepts mail
for a domain and leaves the option unset. The reader is told, though. A message
from an unauthenticated session gets an X-Pepsi-Warning field
(served-domain-not-authenticated, dmarc-fail-not-enforced) and the
[external] tag (TAG_EXTERNAL) at the front of its Subject if its
From: claims a served domain without a DMARC, aligned DKIM or aligned SPF
pass behind it, or if its DMARC failure was recorded but not acted on. Forged
copies of the tag are removed from every inbound subject
(pepsi-ingress/src/external.rs). A message in which a stranger forges a
stranger’s domain gets no mark. The stages that make trust decisions
do not take the From: on faith: pepsi-stage-check-whitelist can require
DKIM or ARC pass (dkim_required, default on for automatic entries) and
signature verification, and key harvesting is restricted as described in
Keys of correspondents.
As a submission server Pepsi does prevent user-level spoofing by its own users,
the case Sakamuri found unaddressed: USERNAME_MAP restricts each
authenticated user to their own envelope sender and to the From: addresses
that they are permitted to use (every mailbox of a multi-address From: is
checked), and adds a
Sender: naming the submitter otherwise (pepsi-ingress/src/submission.rs).
Hosts inside the organisation’s address block are not trusted wholesale either:
a MYNETWORKS entry outside loopback must be bound by SENDER_MAP to the
addresses it may send as, or ingress refuses to start (an explicit
<network> * line restores the unrestricted grant). Outgoing mail is DKIM-signed, and
pepsi-setup prints SPF and DMARC records; the DMARC record it suggests for a
domain without one is p=reject; adkim=s, but an existing weaker policy is
the operator’s to tighten. Operators should enable
DMARC_ENFORCE (ARC_TRUSTED_SEALERS lets a listed forwarder’s validated
ARC chain override a failure, so that enforcement need not cost list mail) and keep
their own domain at p=reject; spoofing of domains that publish no
enforcing policy can only be ended by those domains.
96.3.3.4. Mail routing and sender authentication rely on unauthenticated DNS¶
Every decision a mail server makes about another domain starts with a DNS answer: the MX and address records that route mail, the SPF policy, the DKIM public key and the DMARC record that authenticate it, and the MTA-STS and DANE records meant to protect transport. Unless the zone is DNSSEC-signed and the answer validated, an attacker who can forge DNS answers (by cache poisoning, from an on-path position, or by compromising a resolver) controls all of them. Goodrich et al. pointed out in 2005 that a substituted DomainKeys TXT record lets an attacker sign mail with their own key and have it verify for the victim domain [goodrich2005]; Görling noted the same for SPF [gorling2007], and Herzberg’s review showed that DNS poisoning or a man in the middle defeats SPF, Sender ID and DKIM alike and redirects MX lookups [herzberg2009]. Guidance and the DMARC specification itself repeat the point: forged answers can redirect mail, make spoofed mail pass, make legitimate mail fail, block policy discovery or redirect failure reports that may contain message content [malatras2016] [nist2019] [rfc9989].
Dai et al. (SIGCOMM 2021) demonstrated it end to end. They poisoned caches off-path by BGP sub-prefix hijack, the SadDNS side channel or IP fragmentation, triggering the lookups by sending a mail that makes the receiver look names up; the forged records redirected SMTP delivery (including password-reset mail, hence account takeover) and downgraded SPF, DKIM and DMARC. They found 69% of open resolvers shared between applications, so one application can poison records that another consumes [dai2021]. The fix that every work names is DNSSEC signing by domain owners plus validation by receivers; Dai et al. add per-application resolvers and failing closed when authorisation data cannot be obtained, at the cost of availability [dai2021].
Pepsi: Vulnerable. Impact: medium.
Pepsi does not validate DNSSEC itself; it trusts the AD bit of the resolver it
is pointed at (DNS_SERVERS, else the system resolver), and it uses that bit
only where a standard requires it: DANE TLSA and MX security in the relay stages
and DANE key discovery in pepsi-keydisc. MX routing, SPF, DKIM
keys, DMARC records and MTA-STS discovery are ordinary lookups. So an attacker
who controls the answers for an unsigned zone can redirect outbound mail for
that domain (the opportunistic connector accepts any certificate, see
TLS reference identity derived from insecure DNS (MX, SRV names)), make forged mail pass SPF,
DKIM and DMARC at ingress, and thereby satisfy pepsi-stage-check-whitelist’s
dkim_required gate, or hide an MTA-STS policy (MTA-STS first-contact gap and blocking of policy discovery).
Mail to domains with an MTA-STS enforce policy is protected against MX
redirection by the policy’s mx patterns and PKIX validation. Key discovery is
better placed: DANE keys require the AD bit, WKD uses verified HTTPS, and
discovered keys sit on the trust ladder below operator-confirmed ones
(Keys of correspondents).
The deployment’s exposure therefore depends on two things outside Pepsi’s code.
A validating resolver on a trusted path (unbound on loopback, or
systemd-resolved with DNSSEC=yes) turns forged answers for signed zones
into failures; it is an assumption in Security model and part of the hardened
profile (The network adversary), and the manual recommends running one’s own on the
host (Installation), but DNS setup is outside Pepsi’s scope and the
Debian package neither installs nor recommends one. Whenever something depends
on the AD bit (DANE key discovery, or a relay stage with DANE other than
off, which with the strict default is nearly every deployment),
pepsi-setup checks whether the resolver validates. It also names, by IP
address, every resolver that the installation trusts with that validation and
reaches over plain DNS off this host. Every DANE worker warns at start when its
resolver is such a resolver or does not validate, and pepsi-status reports
the same; nothing is refused. A resolver elsewhere can be reached over DNS over TLS or
HTTPS (tls:// or https:// entries in DNS_SERVERS), which protects
the path to it, not the resolver’s own answers.
Unsigned zones, still the majority, stay forgeable whatever Pepsi does;
refusing to act on unsigned answers would stop mail to most of the Internet.
96.3.3.5. Off-path DNS cache poisoning by forged responses (Kaminsky)¶
Classic DNS over UDP authenticates a response only by values that an off-path
attacker can guess: the 16-bit transaction ID, the source port, the question and
the server address. RFC 3833 recorded “ID guessing and query prediction” in 2004
[rfc3833]. Kaminsky’s 2008 attack (CVE-2008-1447) removed the remaining
obstacle, the TTL of the cached record: the attacker makes the resolver look up
fresh random names below the target domain and races each lookup with forged
replies carrying a referral for the whole domain, so it gets unlimited attempts
and eventually replaces the delegation [kaminsky2008]. Mail servers are ideal
triggers, since they resolve attacker-chosen names on HELO, MAIL FROM,
spam checks, bounces and list deliveries; Kaminsky demonstrated account
takeover by poisoning a web site’s resolver for the victim’s mail domain and
requesting a password reset [kaminsky2008]. Phishing surveys list poisoning as
a way to send users who type the right name to the attacker’s server
[goenka2023].
The 2008 patches added source-port randomisation, which cut the attacker’s odds to roughly 1 in 10^8 to 10^9 per attempt. Afek et al. systematised the attacks from 1993 to 2024 and show how side channels (SadDNS), IP fragmentation and out-of-bailiwick acceptance have repeatedly raised those odds again; they list CVEs from CVE-2007-2926 to the dnsmasq bugs CVE-2020-25684 and CVE-2021-3448 [afek2025]. Port and ID randomisation and 0x20 case randomisation only raise the cost; DNSSEC validation removes the attack, and Afek et al. propose forcing suspicious exchanges to TCP in front of the resolver [afek2025] [rfc3833]. The variants that beat the randomisation are treated in DNS source-port and TXID randomisation defeated by side channels or weak PRNGs, IP fragmentation enables off-path DNS cache poisoning and Bailiwick and cache-acceptance flaws let resolvers cache out-of-zone records.
Pepsi: Partly addressed. Impact: medium.
Pepsi contains no recursive resolver, so the cache that is poisoned belongs to
the operator’s resolver. Pepsi’s own stub queries resist off-path forgery as
far as a stub can: the raw queries in pepsi_common::dns take their
transaction ID from the operating system’s CSPRNG (next_query_id), use a
fresh ephemeral UDP socket connected to the server, discard replies whose ID or
question does not match, and retry truncated answers over TCP; the high-level
lookups go through hickory, which randomises IDs and ports the same way. This
leg is short when the resolver runs on loopback, as the hardened profile
recommends (The network adversary), and closed to forgery when it is reached over
DNS over TLS or HTTPS (tls:// or https:// entries in DNS_SERVERS).
What remains is that Pepsi, like every MTA, lets a remote sender choose names
that it will look up (SPF for MAIL FROM and HELO, DKIM d=, reverse
DNS), so it can serve as the trigger for an attack on a resolver that it shares with other
services, and that a poisoned cache has the consequences described in
Mail routing and sender authentication rely on unauthenticated DNS for every unsigned zone. A validating resolver
protects signed zones; a resolver dedicated to the mail host, as Dai et al.
recommend [dai2021], keeps a poisoning triggered through mail from reaching other
applications. Both are operator choices that Pepsi documents; pepsi-setup,
the DANE workers at start and pepsi-status check only whether the resolver
validates and name the ones reached over plain DNS off this host, and only
where DANE is in use (with the strict default, nearly always).
96.3.3.6. On-path DNS interception and resolver tampering¶
An attacker on the path between a client or resolver and the authoritative server needs no guessing: it sees the query and answers first, or intercepts the query in a transparent proxy and answers it itself. Wei and Heidemann’s six-year RIPE Atlas study of queries to the root servers found such spoofing in about 1.7% of observations, more than doubling over the period, mostly by in-path proxies of ISPs and enterprises and also by on-path injection and unauthorised anycast announcements; many clients do not validate DNSSEC, so the forged answers are accepted [wei2020]. For mail the effect was measured directly by Durumeric et al., who found 14,600 open resolvers in 521 ASes returning false MX or address records for large mail providers, pointing to 1,150 impostor servers through which Gmail saw mail transit from 193 countries [durumeric2015]. The attacker redirects mail to a server of its choice, which then needs only a certificate for its own name (see TLS reference identity derived from insecure DNS (MX, SRV names)), and learns who corresponds with whom from the queries. DNSSEC validation detects forged answers; encrypted DNS transports protect only the hop they cover [wei2020].
Pepsi: Partly addressed. Impact: medium.
Pepsi does not validate DNSSEC itself, but it protects the leg to its
resolver. With the recommended validating resolver on loopback
(The network adversary) that leg is local. A resolver elsewhere can be reached over
DNS over TLS (RFC 7858, tls://ADDRESS[:PORT]#NAME) or DNS over HTTPS
(RFC 8484, https://ADDRESS[:PORT][/PATH]#NAME). Such entries in
DNS_SERVERS in [pepsi] apply to every consumer at once. The resolver’s
certificate is verified for NAME against the system roots, a list never mixes
plain and encrypted entries, and there is no fallback to plain DNS
(pepsi-common/src/dns.rs, which also builds the hickory resolvers), so
nobody on that path can forge an answer or the AD bit. Over plain DNS to a
remote resolver, as on a rented server whose resolv.conf names the
provider’s, an attacker on that path can still forge the AD bit and so defeat
DANE and the DANE key source (see Stub resolvers trust an unauthenticated AD bit from the recursive resolver);
pepsi-setup, the DANE workers and pepsi-status name every such
resolver.
What remains is the leg beyond the resolver: an on-path attacker between the resolver and the authoritative servers can only make signed zones fail, but it can still forge every answer for an unsigned zone, with the routing and authentication consequences described in Mail routing and sender authentication rely on unauthenticated DNS. Choosing a local or encrypted validating resolver is the operator’s part, and signing their zones is the domain owners’ part.
96.3.3.7. MTA-STS first-contact gap and blocking of policy discovery¶
MTA-STS is trust on first use. A sender learns that a domain has a policy from
an unauthenticated _mta-sts TXT record and then fetches the policy over
HTTPS; until it holds a cached policy, it delivers as if there were none. RFC
8461 states the consequence: if an attacker blocks the DNS answer or the HTTPS
fetch during first contact or during a refresh, the domain appears to have no
policy and the STARTTLS downgrade succeeds; the attacker may be able to provoke
a first contact by making the sender mail a new domain [rfc8461]. The RFC recommends long
max_age values, proactive refresh well before expiry and alerting on
repeated refresh failures, and notes that DANE does not have this gap
[rfc8461]. Alexander’s 2024 tests showed the gap in practice: the RFC allows the
policy to be fetched asynchronously while the message is delivered, and Gmail
did exactly that, delivering the first message to a test domain to its TLS-less
server and holding back only later ones [alexsci2024].
Pepsi: Partly addressed. Impact: low.
pepsi-stage-relay-to-internet does not have Gmail’s asynchronous
gap: on a cache miss it looks up the TXT record and fetches the policy before it
delivers. Nor does it widen the RFC’s gap by caching a policy only in memory,
where every fresh worker, or every message, would be a “first contact” that an
attacker defeats again and again by blocking the policy fetch and stripping
STARTTLS. Fetched policies are kept for their max_age (capped at a week) in
the pepsi.mta_sts_policy table (schema patch pepsi-0002), shared by every
worker and kept across worker recycling and restarts, and pepsi-queue gc
prunes expired ones; only usable policies are stored, and a database error is
treated as a miss.
What remains is the gap that the standard itself leaves. A TXT lookup error or a
failed HTTPS fetch with nothing cached fails open
(pepsi-stage-relay-to-internet/src/mta_sts.rs), and a forged NXDOMAIN for the
TXT record is cached as “no policy” for five minutes when nothing is stored. As
RFC 8461 section 10.2 suggests, a stored policy is fetched again once half its
lifetime has passed, even if the TXT record has disappeared; this happens on
use and, independently of mail flow, in the hourly pepsi-queue gc. A failed
refresh keeps the stored policy until its max_age runs out, and from the
last quarter of its lifetime each failure is logged as a warning. A domain that
keeps publishing its policy therefore does not fall back to first contact,
however rarely it is mailed. Failures of an
enforce policy are recorded for TLS reporting (pepsi-tlsrpt),
and so is a failed policy fetch at first contact: with [pepsi-tlsrpt]
SEND_REPORTS on, it counts as one sts session with the RFC 8460 result
sts-policy-fetch-error (sts-webpki-invalid when the policy host’s
certificate did not validate), at most once per domain and worker every five
minutes, so a domain owner learns that its policy host was unreachable or
blocked. Only a suppressed or blocked TXT lookup leaves nothing to report. The first contact with a
domain stays open by design of the standard; a peer that publishes DANE in a
signed zone avoids it, since the relay stages enforce DANE (DANE = strict,
the default; see Opportunistic STARTTLS can be stripped by an active attacker).
96.3.3.8. TLS version and cipher-suite downgrade¶
The cause is a handshake that does not authenticate its own negotiation. SSL 2.0 did not protect the cipher-suite list, so an active attacker could strip the strong suites (cipher-suite rollback) or drop ChangeCipherSpec; SSL 3.0 allowed version rollback and key-exchange confusion, where a message signed for one key exchange was read as another [meyer2013]. Later, clients that retried with an older protocol version after a connection error could be pushed down by an attacker who spoofed that error, which is how POODLE reached SSL 3.0 [clark2013]. The attacker gains whatever the weakest version or suite allows, up to decryption or modification of the session. The fixes are an authenticated handshake transcript (the Finished messages), version-rollback protection (TLS 1.3 adds a downgrade sentinel to the server random), no insecure fallback, and retiring obsolete versions [meyer2013] [clark2013]. RFC 9325 (BCP 195) makes this normative for SMTP, IMAP and POP3 too: never negotiate SSL 2.0/3.0, TLS 1.0 or 1.1, do not fall back, and prefer implicit TLS to a STARTTLS upgrade, whose cleartext prelude opens the separate stripping problem [rfc9325] (see Opportunistic STARTTLS can be stripped by an active attacker).
Pepsi: Addressed. Impact: none.
Every TLS endpoint in Pepsi is rustls with with_safe_default_protocol_versions()
(pepsi-ingress/src/smtp/mod.rs, pepsi-httpd/src/tls.rs, the outbound
client in pepsi-common/src/smtp/tls.rs and smtp/dane.rs). That offers
only TLS 1.2 and 1.3, only forward-secret ECDHE suites with AES-GCM or
ChaCha20-Poly1305, and implements the transcript MACs and the TLS 1.3 downgrade
sentinel; there is no code path that could negotiate SSL, TLS 1.0/1.1, RC4, CBC
or export suites (see Legacy TLS versions and weak cipher suites still accepted (RC4, TLS 1.0)). The outbound
client never retries a failed handshake with a lower version, and it does not
retry in cleartext either: a TLS failure in
pepsi-stage-relay-to-internet is a transient error that moves to the next MX
or defers the message (delivery.rs; the only fallback, for an MTA-STS
testing policy, is to another opportunistic TLS attempt, as RFC 8461
requires).
The price is compatibility: a peer that offers only TLS 1.0 or 1.1 cannot
exchange mail with Pepsi over TLS at all, and an outbound message to such an MX
is deferred and finally bounced rather than sent in cleartext. Stripping of the
STARTTLS offer itself, which needs no version downgrade, is the subject of
MTAs accept unvalidated certificates and rarely use DANE or MTA-STS.
96.3.3.9. TLS renegotiation and triple-handshake injection¶
TLS renegotiation did not bind a new handshake to the one before it
(CVE-2009-3555): a man in the middle could open its own session, send a prefix
of its choosing, and then splice the victim’s handshake in as a renegotiation, so
that the server read the attacker’s data as part of the victim’s authenticated
session [rfc7457] [meyer2013]. The renegotiation indication extension
(RFC 5746) closed that, but the triple-handshake attack (CVE-2014-1295)
showed that two connections could still be made to share a master secret
through session resumption, breaking safe renegotiation and the tls-unique
channel binding that SASL mechanisms rely on; the extended master secret
(RFC 7627) fixed it [rfc7457]. The same survey groups related transport
failures with it: the predictable PRNG keys of the Debian OpenSSL bug, sslstrip,
and handshake-cost denial of service (THC-SSL-DoS) [meyer2013]. Preconditions
are an active attacker and an endpoint that renegotiates or uses a channel
binding derived from an unbound handshake.
Pepsi: Addressed. Impact: none.
rustls, the only TLS stack in Pepsi, does not implement renegotiation in
either direction, so a renegotiation prefix cannot be spliced into an ingress,
httpd or relay session. TLS 1.2 sessions use the extended master secret, and
TLS 1.3 binds resumption to the full transcript. The only channel binding Pepsi
uses, for the SCRAM-*-PLUS and NTLM mechanisms of the smarthost client, is
tls-server-end-point (RFC 5929, pepsi-common/src/smtp/sasl.rs), which
hashes the server certificate and was never affected by the triple handshake.
Of the attacks grouped with it, key generation comes from the aws-lc-rs
provider and the operating system RNG, and handshake-cost denial of service is
bounded by the ingress and httpd per-address connection limits
(Availability, TLS handshake computational denial of service). SSL stripping is treated
in SSL stripping and certificate-warning click-through.
96.3.3.10. Cross-protocol confusion between services sharing a certificate (ALPACA)¶
TLS authenticates a host name, not the application protocol or port. When a web
server and a mail or FTP server hold certificates valid for the same name (one
multi-name or wildcard certificate, or the same name on several ports), a
network attacker can redirect a browser’s HTTPS connection to the other service;
the handshake succeeds and the substitute server interprets the HTTP request in
its own protocol. Brinkmann et al. (ALPACA, 2021, CVE-2021-3618) built three
attacks on this: upload (the request with its cookie is stored on an FTP
server for later retrieval), download (attacker-prepared content stored on an
IMAP, POP3 or FTP server is served back as the web origin’s) and reflection
(an error reply that echoes the invalid command is rendered as HTML with
script). 13 of 25 SMTP, IMAP, POP3 and FTP servers were exploitable by at least
one method, Sendmail on its STARTTLS port among the reflecting ones, and about
119,000 web servers shared a certificate with an exploitable application server
[brinkmann2021]. Older relatives are virtual-host confusion, where a TLS session
cache shared between virtual hosts lets a connection resume at a host other than
the one authenticated [rfc7457], and the redirection of an MTA-to-MTA relay
connection to a submission port, where the relaying MTA’s authenticated identity
could be attached to mail it merely relays; RFC 4954 counters that with
AUTH=<> [rfc4954]. The general fix is strict ALPN and SNI: servers abort a
handshake whose ALPN offer or server name they do not recognise, and clients of
every protocol send ALPN [brinkmann2021] [rfc9325].
Pepsi: Addressed. Impact: low.
The exploitable behaviours that ALPACA needs on the mail side are absent.
pepsi-ingress answers every unrecognised command with a fixed string
(500 5.5.2 Error: command not recognized, pepsi-ingress/src/smtp/command.rs)
and never echoes client input, so there is no reflection; SMTP offers no command
that returns stored content, and Pepsi serves no IMAP or POP3, so there is no
download. pepsi-httpd advertises ALPN http/1.1 only, so rustls
refuses a client that offers ALPN without it. The submission-port confusion of
RFC 4954 does not arise: ingress accepts a MAIL FROM AUTH= parameter
but ignores it (command.rs), so an asserted identity is never adopted, and
pepsi-stage-relay-to-internet never authenticates to an MX, so a redirected
relay connection to a submission port simply fails. Virtual-host confusion
needs SSL 3.0 fallback, which rustls does not implement, and rustls
refuses to resume a session under a server name other than the one it was
established for.
The redirected browser itself is turned away at the SMTP port. A TLS
ClientHello whose ALPN offer names only HTTP-family protocols (http/1.1,
h2, h3 and their relatives) gets a no_application_protocol alert
(MailAcceptor in pepsi-ingress/src/smtp/mod.rs); a hello without ALPN,
or with any other identifier, proceeds, and ingress selects no protocol, so no
identifier whose client support is unknown goes on the wire. In cleartext, or
from an HTTP client that sends no ALPN, the session ends with 554 at the
first HTTP request line or Host:/User-Agent: header
(command::is_http_request, as Postfix does; see
HTML forms send cross-protocol commands to SMTP, POP3 and IMAP), and the tenth line that is no command
at all ends it with 421 (MAX_UNRECOGNISED_COMMANDS). pepsi-httpd
serves a certificate only for SNI names that it is configured for and fails the
handshake otherwise (SniResolver in pepsi-httpd/src/tls.rs); a client
that sends no SNI still gets the default certificate. pepsi-ingress does
not enforce SNI by design: MTAs send the MX name, the domain or nothing, and
refusing an unknown name would refuse legitimate mail. The certificate that the
mail and web services share is discussed in Ambiguous wildcard and multi-name certificate matching.
96.3.3.11. SSL stripping and certificate-warning click-through¶
When a client first reaches a service over an unprotected protocol that merely
points to TLS, such as an http:// URL or a link or redirect on a plain page,
an active attacker can rewrite the pointer so that the client never upgrades,
and then relay the session in cleartext (sslstrip) [rfc7457]. The related
user-interface attacks rely on users who do not notice the missing indicator,
who click through certificate warnings, or who are shown spoofed browser
chrome; years of false-positive warnings have taught users to give in
[clark2013]. The attacker obtains credentials and content despite TLS being
available. The remedies are mandatory-TLS policies that the client remembers (HTTP Strict Transport
Security, RFC 6797, and its preload list) and fewer, better warnings
[rfc7457] [clark2013]. The SMTP analogue of stripping is discussed in
Opportunistic STARTTLS can be stripped by an active attacker.
Pepsi: Partly addressed. Impact: low.
Pepsi’s web surfaces are pepsi-httpd: the secure-link portal, the
administrative console, the public mailing-list pages with member logins, WKD
and the MTA-STS policy. They are served over TLS with certificates that
pepsi-setup obtains from Let’s Encrypt, so users are not trained to accept
warnings, and the session cookies are __Host- cookies marked Secure,
HttpOnly and SameSite=Strict (pepsi-httpd/src/web/session.rs), so a
stripped connection does not carry them. The links that Pepsi mails out (secure-link,
list confirmation) are https:// URLs.
pepsi-httpd sends Strict-Transport-Security:
max-age=31536000 (one year) on every response of a TLS listener (add_hsts
in pepsi-httpd/src/router.rs), without includeSubDomains or preload,
which bind every host under the domain and are left to the operator. A browser
that has once reached the portal, console or list host over HTTPS therefore
refuses a stripped http:// connection for a year. What remains is the first
visit, which only preloading would cover, and deployments behind a reverse
proxy: a MODE = plain listener sends no HSTS (it cannot tell that the
client used TLS), so the front server has to add the header. The nginx and
Apache sites that pepsi-setup writes do so (pepsi-setup/src/proxy.rs),
and a hand-written front server must. pepsi-setup check verifies this: it
fetches every HTTPS name under which pepsi-httpd is reached (certificate hosts,
mta-sts., openpgpkey., autoconfig.) and reports an HSTS
[MISMATCH] when the header is missing, malformed or shorter than six months
(pepsi-setup/src/hsts_check.rs). A link in a
message that travelled in cleartext can still be rewritten (see
MTAs accept unvalidated certificates and rarely use DANE or MTA-STS); pepsi-httpd refuses the handshake for
an SNI name that it is not configured for and serves its default certificate only
to a client that sends no SNI (Cross-protocol confusion between services sharing a certificate (ALPACA)).
Users who click through a
certificate warning in their own browser or mail client remain outside Pepsi’s
control.
96.3.3.12. Compelled or covert provider disclosure of keys and IP logs¶
Whoever runs a mail service can be ordered, bribed or compromised into handing over what it holds. In 2013 the US government compelled Lavabit to surrender the TLS private keys that all of its roughly 400,000 users shared (five key pairs, one per protocol); the court noted that the key lets its holder read traffic, decrypt recorded sessions that lacked forward secrecy, and impersonate the server. Lavabit handed them over and closed [lavabit2014]. End-to-end encryption does not protect metadata the provider necessarily sees: in 2021 Proton was ordered under Swiss law to log the IP addresses of one account, which identified a climate activist; Proton recommends its onion service for users who need anonymity [proton2021]. RFC 7624 classes these as static key exfiltration, dynamic exfiltration of per-session keys (for example through a backdoored random number generator) and content exfiltration of data at rest, by willing or unwitting collaborators [rfc7624]. The “Keys Under Doormats” report argues that any mandated exceptional-access mechanism makes this worse: escrow keys defeat forward secrecy, add untestable complexity, and become concentrated targets that have been abused before (the Athens affair, Telecom Italia) [abelson2015].
Pepsi: Partly addressed. Impact: medium.
Pepsi limits what a seized TLS key yields. rustls negotiates only ephemeral
(EC)DHE suites, so the server’s private key decrypts no recorded session; it
allows future impersonation only, which certificate revocation and the operator
can end. Keys are per deployment, not shared across a provider’s customers.
Pepsi has no exceptional-access mechanism. The opt-in mail_log ([pepsi]
MAIL_LOG, off by default) stores no client addresses, and log retention is
bounded by pepsi-log-prune.timer (Operating Pepsi).
The residue is the provider position itself, which Pepsi’s gateway model takes
on deliberately (Gateway custody (custody = local, the MTA key)). For identities in gateway custody the server
holds the private key, wrapped under a KEK in secrets.d (The private-key custody boundary);
an operator compelled to cooperate can decrypt and sign, and the queue and the
mailbox hold plaintext. Only client custody (Client custody (custody = client, the MUA key)), with
pepsi-stage-reencrypt sealing filed mail to the client key, keeps content
out of the operator’s reach, and even then the operator can substitute the
published key for future mail. Metadata cannot be withheld from the operator:
ingress sees the client’s IP address and writes it into the journal (the
Received: field of submitted mail omits it under the default
RECEIVED_PRIVACY of a submission listener, see
Received and other outgoing headers expose sender IPs, clients and contacts), and an operator can be ordered to
start logging more. Pepsi
offers no onion-service or anonymising submission path. Users who need
protection against their own provider must hold their keys themselves and reach
the server through an anonymity network; this cannot be solved by the server.
96.3.3.13. Keys published in DNS are only as trustworthy as the zone operator¶
DANE moves trust from certification authorities to the DNS hierarchy: a TLSA, SMIMEA or OPENPGPKEY record is exactly as trustworthy as whoever can change the zone and its DNSSEC keys. A rogue or coerced DNS administrator can change address and TLSA records together and send clients to an unauthorised server that appears authorised; if TLSA updates are authenticated more weakly than address updates, the weaker path suffices; and DNSSEC-backed keys bypass the look-alike checks that some CAs apply [rfc6698]. Anyone who obtains a DNSSEC private key for the domain or a parent, by coercion, theft or brute force, can replace an OPENPGPKEY record and read future mail encrypted to it, which is why RFC 7929 says such keys should not protect sensitive information without out-of-band verification and why an MTA must queue rather than send when the answer is Indeterminate or Bogus [rfc7929]. RFC 7671 adds registrar-level takeover (a rogue registrar transfers the domain and its DS record), replay of old, still-validly signed TLSA records after a key compromise, and long TTLs that keep stale data cached; it recommends registrar locks, short signature validity and short TTLs [rfc7671].
Pepsi: Vulnerable. Impact: medium.
Pepsi follows the RFCs on the mechanics. pepsi-keydisc refuses an
OPENPGPKEY or SMIMEA answer without the resolver’s AD bit and requires the key’s
User ID to name the address (pepsi-keydisc/src/dane.rs); TLSA records are
likewise ignored unless authenticated (pepsi_common::dns::tlsa_lookup). But
an AD-validated DANE key is rank 2 on the trust ladder, directly below an
operator’s manual entry (pepsi-common/src/keystore/rank.rs,
Keys of correspondents), and maps to a valid signature verdict. So whoever
controls a correspondent’s zone can substitute the key that Pepsi encrypts to
and the TLSA record against which its relay authenticates: the domain owner, its
DNS host, its registrar, or an attacker holding one of their keys. There is no out-of-band
check, and a key stays cached for CACHE_TTL (24 h by default) regardless of
the record’s own TTL.
For a correspondent whose mail is decrypted by their provider anyway, the zone
holder could read it regardless, so nothing is lost. The loss is real for a
correspondent who holds their own key and whose DNS is run by a third party, and
for Pepsi’s own users, whose published TLSA, WKD and DANE records depend on the
operator’s DNS and registrar accounts. This is inherent in DANE and has no fix
inside Pepsi. Operators can lock their registrar, sign with short RRSIG
lifetimes, and raise [pepsi-keydiscovery] MIN_TRUST or pin keys manually for
correspondents who need more. Users can verify fingerprints out of band.
96.3.3.14. DANE-TA usage bypasses revocation and policy constraints¶
A TLSA record with certificate usage 2 (DANE-TA) makes the certificate it names a trust anchor for the service. Trust anchors are not subject to revocation checks, so if that certificate, or an intermediate it was taken from, has been revoked, a client that follows the record no longer notices. An intermediate CA whose certificate carries policy restrictions can also issue itself an unrestricted certificate and have customers publish it as a DANE-TA anchor, escaping the restrictions of its parent. The result is acceptance of chains that ordinary PKIX validation would reject; the precondition is control of the TLSA record or of such an intermediate. RFC 6698 leaves it to domain administrators to publish only reliable anchors, subject to local client policy [rfc6698].
Pepsi: Partly addressed. Impact: low.
Pepsi’s DANE verifier (pepsi-common/src/smtp/dane.rs) implements usage 2 as
RFC 7672 prescribes for SMTP: the end-entity certificate must chain to the
anchor through webpki path validation, be within its validity period, carry
server-auth key usage and be valid for the MX or smarthost name, and the record
counts only if its RRset is DNSSEC-authenticated. Usages 0 and 1, which would
combine DANE with public-CA policy, are ignored as RFC 7672 requires, so there is
no PKIX policy for a DANE-TA anchor to escape: in SMTP the domain owner’s TLSA
record is the policy.
The revocation of the leaf under a DANE-TA anchor is honoured when the
server staples it: on a usage-2 match the verifier evaluates the stapled OCSP
response (pepsi-common/src/smtp/ocsp.rs, RFC 6960) as the public-CA path
does, and a verified revoked answer from the anchor’s CA defeats the match
(strict refuses the session; warn hands it to the verification the hop
has without DANE, which refuses a validated certificate with that staple too).
No staple, or one that does not verify, leaves the match standing; no responder
is queried and no CRL fetched for a TLS peer (S/MIME signatures, by contrast,
are checked against fetched CRLs, Revocation not checked or soft-failed by clients). Usage 3
(DANE-EE) is exempt on purpose: RFC 7672 section 3.1.1 makes its certificate a
mere carrier of the published key, whose validity is not consulted.
The anchor’s own revocation is never checked, and webpki does not process
certificate policy constraints: a revoked anchor keeps working until the domain
owner withdraws the TLSA record, as RFC 6698 intends. Exploiting that needs the
anchor’s private key and an on-path position, and the owner of the zone can end
it at any time; withdrawing compromised anchors promptly is the domain owner’s
task.
96.3.3.15. Unauthenticated or failed denial of existence suppresses DNS records¶
Without authenticated denial of existence an attacker can remove records from a
DNS response. This matters wherever an absent record triggers a fallback
instead of a failure, as when a missing MX falls back to the address record or
a missing policy record means “no policy”; wildcards also make denial proofs
fragile [rfc3833]. Blechschmidt and Stock (2023) found both halves in practice.
A provider’s signed _openpgpkey/_smimecert zones contained a faulty NSEC3
record that proved the zone empty, which an attacker could replay to make any
published key appear absent. And openpgpkey-milter, with the SMIMEA milter
derived from it, sent the message unencrypted when the key lookup returned
SERVFAIL, although it correctly deferred on a Bogus answer; causing a SERVFAIL
only needs a denial-of-service attack on the recipient domain’s name servers.
The authors’ patch makes the milter fail temporarily instead; GnuPG aborts on a
lookup failure and was not affected [blechschmidt2023]. The attacker gains an
encryption or transport-security downgrade by disturbing DNS for the recipient
domain.
Pepsi: Partly addressed. Impact: low.
Pepsi never treats an unauthenticated answer as a key: pepsi-keydisc refuses
AD-clear OPENPGPKEY and SMIMEA answers outright, and tlsa_lookup ignores an
AD-clear TLSA set. On the relay path the TLSA case follows RFC 7672: under
DANE = strict a failed MX-security or TLSA lookup defers the message
(host_tls_plan and mx_secure in
pepsi-stage-relay-to-internet/src/delivery.rs, the same in the smarthost
stage), and a host whose TLSA RRset exists but is unusable still has to offer
STARTTLS.
On the transport path DANE = strict is the default, so a
failed TLSA lookup defers the message rather than proceeding without DANE; the
cost is deferred mail when a correspondent’s DNS is merely broken, and an
operator who prefers delivery sets DANE = warn per relay stage.
Implicit-MX fallback on a missing MX record is required by RFC 5321.
On the encryption path a lookup failure is not mistaken for “no key”.
pepsi-keydisc classifies a SERVFAIL, timeout or DNSSEC-bogus answer to
the OPENPGPKEY or SMIMEA query, and a WKD host name that does not resolve, by
also asking the domain’s MX and A/AAAA records (pepsi-keydisc/src/dnsfail.rs,
the settle rule keydisc_dns_settle in procedures.sql). If nothing about
the domain answers, the recipient is unreachable and pepsi-stage-encrypt
defers the message, as the openpgpkey-milter patch does with its temporary
failure, and bounces it at its MAX_LIFETIME, sending a DELAY DSN on the way when one
was asked for. If the MX or address records answer while the key records keep
failing over three rounds within about an hour, the recipient’s DNS is
inconsistent: the message goes to the secure-link portal, or bounces when none
is configured, and the sender is told why. One lost packet only delays the
message. The sender can accept cleartext anyway with the [clear-ok] subject
keyword or the CLEAR_ON_DNS_FAILURE per-address setting
(A key lookup that fails in the DNS). Two cases are deliberately left as “no key”:
a WKD fetch that fails over HTTPS rather than in the DNS, which is common and
harmless, and a forged NXDOMAIN or empty answer for a zone without DNSSEC, which
cannot be told from a real one. The second case is the residue that this issue
describes; a replayed faulty NSEC3 proof is the signed-zone form of the same
thing.
ENCRYPT = required closes that residue too (secure link or bounce, never
cleartext). No resolver can tell such a forged denial from a real one, so
nothing is left for Pepsi’s code; signing their zones is what domain owners
can do.
96.3.3.16. DNSSEC key compromise cannot be revoked; synchronised expiry of signatures¶
DNSSEC signatures cannot be withdrawn before they expire. Yang et al. (2010) point out that when a zone key is compromised, an attacker on the resolution path or able to poison caches can keep replaying the old key and its signed DS or DNSKEY records, ignoring TTLs, until those signatures expire, which may take days to a month; the only revocation mechanism, RFC 5011, is optional and was not implemented by every TLD. Forged records are accepted for the zone and all its descendants during that window. They recommend short signature lifetimes, standby keys and distributed key monitoring. The same paper shows that signing a zone in one pass makes all its signatures expire together, so every cache re-queries at once (a peak of about 1380 times the average load in their example), and that dynamic updates push operators to keep signing keys online on every authoritative server, including third-party secondaries; they propose randomised expiry times and an online-signed subzone for dynamic data [yang2010].
Pepsi: Vulnerable. Impact: low.
Pepsi does not sign zones or serve DNS, so the load spikes and online-key
exposure concern the operator’s DNS host, not Pepsi. Pepsi does rely on
DNSSEC through its validating resolver for DANE transport authentication and
for DANE key discovery (Keys published in DNS are only as trustworthy as the zone operator), and it
inherits the revocation gap: a TLSA or OPENPGPKEY RRset signed with a key that
has since been compromised still validates until its RRSIG expires, and Pepsi
caches a discovered key for CACHE_TTL (24 h) on top of that. Nothing in the
DNS lets a validator learn of the compromise earlier.
Operators shorten the window for their own zones by using short signature
validity periods with frequent re-signing, which their DNS software controls;
pepsi-setup prints the records but does not sign them. For other domains no
fix exists below a change to DNSSEC itself.
96.3.3.18. REQUIRETLS residual weaknesses and TLS-Required override¶
RFC 8689 lets an originator tag a message REQUIRETLS so that every relay
must use DNSSEC- or MTA-STS-validated MX lookups and certificate-validated TLS,
or refuse to send it. Its own security considerations list what remains. A
malicious MTA on the path can claim support and strip the tag, though it sees
the plaintext anyway; bounces may be lost, or leak, when they cannot be returned
with REQUIRETLS; mediators that re-originate a message, such as list servers,
forwarders and client-side Sieve rules, may not carry the requirement over. The
companion TLS-Required: No header field, which anyone composing the message
can set, tells relays to ignore the recipient domain’s DANE and MTA-STS policy,
so a sender can override the recipient’s transport protection. The RFC points to
end-to-end encryption for content that MTAs must not see, and to recipient domains
refusing mail not received over STARTTLS [rfc8689].
Pepsi: Addressed. Impact: low.
Pepsi implements both halves of RFC 8689 (pepsi_common::requiretls;
Require TLS for one message (RFC 8689)). Ingress advertises REQUIRETLS only once a session
is TLS-protected and refuses the parameter in cleartext (530 5.7.10), so
a tag is never accepted on a hop that already broke it; the message is tagged
state.tls_required and every split or clone keeps the tag. The relay
stages send a tagged message only to a next hop whose name DNSSEC or an
MTA-STS policy validates (or that the configuration names), over mandatory
STARTTLS with the certificate authenticated by DANE or PKIX, and only if the
hop advertises the extension after the upgrade, passing the parameter on.
When no MX host qualifies, the message bounces with 5.7.30 or 5.7.10;
the DSN carries the headers only and is itself tagged and returned under the
same requirement (pepsi-stage-bounce). The override is honoured as the RFC
says and no further. A lone TLS-Required: No field makes the recipient’s
DANE and MTA-STS policy advisory for that message in direct delivery; it is
read only from the message as it arrived and only when the parameter is
absent. A failed handshake is still not retried in cleartext, smarthost
settings stay in force, and such sessions are kept out of TLSRPT so that the
recipient’s policy is not blamed for a failure that the sender asked to ignore.
What remains is what the RFC lists: a relay beyond the next hop that lies
about its support sees the plaintext anyway; a bounce whose return path offers
no validated TLS is lost (its postmaster copy with it); and a message that a
mediator composes afresh, such as a list digest or a vacation notice, starts
without the tag, whereas per-member copies and alias expansions keep it (ROADMAP,
Known limitations). pepsi-sendmail cannot request the parameter over the
UNIX submission socket.
96.3.3.19. TLS reports can be suppressed, flooded or redirected¶
SMTP TLS Reporting (RFC 8460) has sending MTAs send daily aggregate reports
of their TLS, DANE and MTA-STS outcomes to the addresses that a receiving domain
publishes in a _smtp._tls TXT record. The RFC’s security considerations note
that the attacker whom the reports are meant to reveal can suppress them: whoever can
strip STARTTLS or block MTA-STS policy discovery can equally block the TLSRPT
lookup or the HTTPS submission, and the rua endpoint can be flooded with
bogus reports until it stops accepting. Reporters may skip HTTPS certificate
validation when submitting, a deliberate trade-off. The report URIs need not lie
inside the policy domain and no delegation check exists, so a domain owner can
point reports at an unwitting third party, and an attacker who can poison DNS
can publish a bogus record and receive statistics about a domain it does not own.
Reports also disclose details of the reporter’s configuration. The RFC suggests
a long TTL or DNSSEC for the record and specifies no verification of
redirection targets [rfc8460].
Pepsi: Partly addressed. Impact: low.
As a reporter, pepsi-tlsrpt sends reports only when [pepsi-tlsrpt]
SEND_REPORTS is on (off by default), at most one per policy domain and day.
HTTPS reports go through the hardened pepsi-keydisc fetcher: certificates
verified, no redirect followed on the POST, a 30 s deadline, a 64 KiB
response cap, and rua URLs resolving to loopback, private or link-local
addresses refused (pepsi-tlsrpt/src/lib.rs). Mailed reports
pass through the pipeline and are signed. The rua lookup is deliberately not
DNSSEC-gated (pepsi-tlsrpt), so a poisoned record can redirect
one domain’s daily report; that discloses which TLS outcomes Pepsi saw with that
domain’s MX hosts, and an attacker controlling many domains can aim one report a
day per domain at a third party. A report goes to at most
five rua destinations, so one record cannot fan a report out to an
unbounded list. Both residues are minor.
As a report recipient, a Pepsi domain’s own monitoring can be blinded exactly as
the RFC describes, by blocking the senders’ lookup or submission or by flooding
the operator’s rua mailbox; Pepsi does not parse incoming reports (their
content is discussed in Malicious content in received TLS reports). This is inherent in
the protocol. Operators reduce it by DNSSEC-signing the zone that holds the
_smtp._tls record that pepsi-setup prints and by not treating a quiet report
stream as evidence of safety.
96.3.3.20. Provider-side encryption at rest leaves data readable by the provider¶
Most cloud services encrypt stored data with keys that the provider generates and holds. That protects against a thief who obtains only the stored ciphertext, but the provider, and anyone who compromises or compels it, can read everything. Backendal, Haller and Paterson (2024) make this point for Google Drive, iCloud, Dropbox and OneDrive, and note that even Apple’s optional end-to-end mode excludes shared documents and sends plaintext checksums for deduplication; the remedy is client-side encryption with keys that only the users hold, which is hard to get right, as their attacks on Mega and Nextcloud showed [backendal2024]. Server-side mail storage is the same pattern.
Pepsi: Partly addressed. Impact: medium.
Pepsi keeps provider-held keys out of the stored data where it can. Private keys
in the database are wrapped under a KEK kept outside it in secrets.d, so a
database copy alone yields none (Somebody holding a copy of the database, The private-key custody boundary).
Secure-link messages are stored under a key derived from a PIN that is never
stored and a pepper outside the database (The secure-link fallback portal). For a user who
holds a client-custody key, pepsi-stage-reencrypt seals decrypted inbound
mail to that key before it is filed, and mail already encrypted to it passes
through unopened, so the operator cannot read it (Client custody (custody = client, the MUA key)).
For everything else Pepsi is a provider in exactly the sense of the article
(Gateway custody (custody = local, the MTA key)). The queue in pepsi.workqueue is plaintext,
gateway-custody keys are used by the server, and filed mail is plaintext unless the
recipient has a client key, because [stage-reencrypt] ON_NO_CLIENT_KEY
defaults to plaintext. The threat model says so and trusts the operator.
Users who need more must register a key held by their own client, and operators
can encrypt the database volume at rest and set ON_NO_CLIENT_KEY = bounce.
That setting drops, rather than bounces, a message whose content came out of an
S/MIME EnvelopedData container, which has no integrity protection. Two bounds keep decrypted plaintext from piling
up: pepsi-queue gc bounces (or, for content from an AES-CBC
EnvelopedData, drops) a message held at a quarantine stage longer than
[pepsi-queue] QUARANTINE_MAX_AGE_DAYS (14 days by default), and
pepsi-setup schema --backup-dir keeps only the newest --backup-keep
dumps (2 by default).
A gateway that decrypts, filters and files mail for users without keys cannot
avoid seeing it.
96.3.3.21. Account hijacking via public disposable inboxes¶
Most disposable e-mail services keep public inboxes: anyone who knows or guesses the address can read its mail, and several keep messages longer than they claim. Hu, Peng and Wang (2019) used seven such services as a honeypot and collected 2.3 million messages in three months, including registration, password-reset and one-time-code mail for social networks, PayPal, healthcare.gov, a military personnel portal and cryptocurrency services. Anyone can request a password reset for such an account and read the link from the public inbox, taking over the account and its data. The authors suggest isolating inboxes per session or warning users clearly that the inbox is public [hu2019].
Pepsi: Not applicable. Impact: none.
Pepsi offers no disposable or public inboxes. Local delivery files mail only into the mailbox of an authenticated local account (Maildir or LMTP). The places where Pepsi shows mail to someone other than the mailbox owner are the secure-link portal and the mailing-list archives; they are reached through a per-message link and PIN, or show only mail posted to a list. An operator who configures a catch-all alias directs unknown addresses to a mailbox that the operator chose, not to the public.
96.3.4. Missing or incorrect checks¶
A signature, certificate, policy or input that is not checked, or checked wrongly.
96.3.4.1. MTAs accept unvalidated certificates and rarely use DANE or MTA-STS¶
SMTP between MTAs is fail-open. STARTTLS is opportunistic: the sender uses it
if the receiver offers it, does not validate the certificate, and continues in
cleartext if the offer is missing, so an active attacker can strip the offer or
terminate TLS with any certificate. Measurements over a decade agree. In 2014
Facebook saw 58% of its notification mail encrypted but only 30% over a
validated certificate [facebook2014]. In 2015, 82% of top-million mail servers
offered STARTTLS but only 35% could be authenticated, 41,405 servers sat behind
middleboxes that overwrote the STARTTLS keyword, and more than 20% of Gmail’s
inbound mail from seven countries arrived stripped [durumeric2015]; 19 of 22
providers accepted a revoked, expired, self-signed and mismatched certificate
[foster2015]. Later scans found 96% of MXs offering STARTTLS but 30% failing
validation, none of 47 large providers refusing a bad certificate, and MTA-STS
honoured by only six [blechschmidt2023]; none of 29 providers rejected a bad
certificate, only four fetched TLSA records, most resolvers did not validate
DNSSEC, and two DANE validators skipped PKIX for PKIX-EE records [lee2020];
only 31.7% of 436 regular providers refused delivery on a mismatching TLSA
record and 41.5% delivered despite a broken DNSSEC chain [holzbauer2022]. The
JRC’s MECSA data show 70-72% valid certificates and few domains with
DNSSEC-protected TLSA or MTA-STS [ignacio2019] [kambourakis2020], practitioners
judge transport confidentiality only marginally better than cleartext
[holstchristensen2021], and among German medical institutions under 1% of
domains have working DANE on every MX [lange2023] [petrlic2025]. The proposed
remedies are DANE with DNSSEC validation, MTA-STS with reliable policy caching,
correct receiver certificates, and remembered STARTTLS capability as in
TrustBase [oneill2016].
Pepsi: Partly addressed. Impact: medium.
Pepsi has the mechanisms and defaults them on. On the receiving side
pepsi-setup obtains a publicly valid certificate for the MX name and prints
the 3 1 1 TLSA, MTA-STS and TLSRPT records to publish; ingress offers TLS 1.2
and 1.3 only. On the sending side pepsi-stage-relay-to-internet discovers and
enforces MTA-STS by default (MTA_STS = yes), so a domain with an enforce
policy cannot be downgraded. It implements DANE-EE and DANE-TA
(pepsi-common/src/smtp/dane.rs), requires STARTTLS from a host whose
TLSA RRset is unusable (RFC 7672 section 2.2), never retries in cleartext after
a TLS failure, and never lets warn-mode DANE replace an enforcing MTA-STS
policy. DANE is enforced by default: DANE = strict is
the default in the code, the sample and the wizard, so a certificate that
matches none of a domain’s DNSSEC-authenticated TLSA records, or a failed TLSA
lookup, defers the message (as RFC 7672 requires, and as Postfix’s dane
level does), and a mismatch is reported to the domain as tlsa-invalid (RFC
8460). DANE = warn, which hands a mismatching certificate to the
verification the hop would have without DANE, remains as an explicit opt-out.
Every hop verified against the public roots (MTA-STS, DANE’s PKIX fallback)
also has the SCTs of its certificate checked against the Certificate
Transparency log list, softly: a failure is logged, never refused ([pepsi]
CT_CHECK); a stapled OCSP response is evaluated on every hop, and a verified
revoked fails a hop whose certificate is validated. The threat model states the posture plainly
(An active network attacker, The network adversary).
What leaves deployments exposed is that delivery is opportunistic by
default. A recipient domain with no MTA-STS enforce policy and no usable
TLSA record gets OpportunisticStartTls with the accept-any verifier
(TlsVerify::Insecure); an active attacker can strip STARTTLS or present
any certificate. That is still most domains (Opportunistic STARTTLS can be stripped by an active attacker,
MTA-STS scarce, in testing mode, misconfigured or not enforced), and refusing them would stop mail to them.
Under warn, a usable TLSA RRset must not replace the configured PKIX
verifier of pepsi-stage-relay-to-smarthost, or an on-path attacker with any
certificate could impersonate a smarthost that publishes TLSA records and
collect the mail and the relay AUTH password. The DANE verifier takes a
fallback (dane_connector, DaneVerifier): a
warn-mode mismatch is decided by the smarthost’s TLS_VERIFY policy, so
DANE never leaves a hop weaker than DANE = off; a unit test with a rogue
self-signed certificate pins it.
DANE also depends on a validating resolver reached over a trusted path, because
Pepsi trusts the AD bit (Stub resolvers trust an unauthenticated AD bit from the recursive resolver);
pepsi-setup’s preflight, every DANE worker at start and pepsi-status
warn when the resolver does not validate, and they name every resolver that is
trusted with validation and reached over plain DNS off this host. The hardened profile in
The network adversary (validating resolver, DANE = strict, MTA-STS on, own TLSA
and MTA-STS records) is what an operator can do today; the rest depends on the
recipient domains publishing a policy.
96.3.4.2. TLS clients skip certificate or host-name verification¶
The classic TLS libraries (OpenSSL, GnuTLS) leave chain validation, checking of its result and host-name matching to the calling application, and many non-browser programs and the HTTP and mail libraries wrapping them omit one of the steps, switch verification off to tolerate self-signed certificates, or set the options wrongly [bates2014]. The problem persists in mail clients: of 49 clients tested in 2025, 19 accepted at least one invalid chain (self-signed, expired, a bad signature, or a certificate for another name), 18 matched host names improperly, some only by prefix, and only 12 checked revocation, often behaving differently per protocol and TLS mode within one client [tang2025]. The TLS best current practice therefore requires RFC 6125-style host-name validation and full path validation, and notes that revocation checking is weak in practice, because OCSP clients soft-fail and an on-path attacker simply suppresses stapling [rfc9325].
An attacker with nothing but a network position presents a self-signed or foreign certificate, or a revoked one whose key was stolen, and reads and modifies the “protected” session, including credentials. CertShim [bates2014] retrofits verification onto dynamically linked programs. The real fix is libraries that verify by default and applications that do not turn it off.
Pepsi: Partly addressed. Impact: low.
All of Pepsi’s TLS clients use rustls with the webpki verifier, which
validates the chain and matches the reference name against subjectAltName
by default. Replacing it takes an explicit dangerous() call, and those in
pepsi-common::smtp::tls, dane and http_client install Pepsi’s own
verifiers:
the Certificate Transparency wrapper around webpki (a soft check of the
certificate’s SCTs, [pepsi] CT_CHECK), the DANE verifier, and the one
accept-any verifier of the opportunistic connector. The verifying connector
(TlsVerify::System, system roots via rustls-native-certs plus an
optional TLS_CA) is the default for these clients: the smarthost
(pepsi-stage-relay-to-smarthost, TLS_VERIFY defaults to
yes; an entry’s TLS_CA_BUNDLE selects TlsVerify::Bundle, whose
trust store is that PEM file alone), the LMTP target, the MTA-STS policy fetch, WKD/VKS key discovery
(pepsi-keydisc/src/http.rs; [pepsi-keydiscovery] TLS_CA_BUNDLE narrows
its trust to a PEM file of anchors), the IMAP reader of
pepsi-helper-mailbox-scan, and every other HTTPS request. Those other
requests (payment backend, telemetry, OAuth token refresh, list template
fetches and Mailman imports, the MTA-STS probe of pepsi-setup) all take
their TLS configuration from pepsi_common::http_client. None of these
clients disables verification.
Three gaps remain. First, direct-to-MX delivery without an MTA-STS policy or
usable DANE records deliberately accepts any certificate, as every
opportunistic MTA does. That is the subject of MTAs accept unvalidated certificates and rarely use DANE or MTA-STS
and Opportunistic STARTTLS can be stripped by an active attacker, not a verification bug. Second,
TLS_VERIFY = no exists for smarthosts and LMTP targets with private
certificates, and with it the SASL credentials go to whoever answers. The
importers of pepsi-setup mention the option when an imported setup used
it. Third, revocation is checked only from what the server staples: every
connector of pepsi-common::smtp::tls evaluates a stapled OCSP response
(smtp/ocsp.rs, RFC 6960) and fails a validated session on a verified
revoked, but queries no responder, fetches no CRL and does not demand a
staple (no must-staple), so an attacker holding a stolen, revoked certificate
for a smarthost, WKD or MTA-STS policy host simply staples nothing and is
accepted until the certificate expires. The HTTP client gets the same
verifier (pepsi-common/src/http_client.rs: webpki against the system
roots, the stapled-OCSP check and the soft Certificate Transparency check),
with the same limits. The lists that pepsi-keydisc fetches into pepsi.crl_cache
serve S/MIME signers and ingress client certificates only; rustls can take
CRLs, so handing it those lists for the few configured hosts would be possible
at the cost of network dependencies. Short-lived certificates do more against
this than soft-fail OCSP.
96.3.4.3. TLS reference identity derived from insecure DNS (MX, SRV names)¶
Checking a certificate only means something if the name against which it is checked came from a source that the attacker cannot influence. Mail clients and MTAs often derive the expected name from DNS: the target of an MX or SRV record, or a CNAME-canonicalised host. Without DNSSEC an attacker who forges that answer names a host of its own, for which it holds a perfectly valid certificate, and the check passes. RFC 6125 [rfc6125] and its successor RFC 9525 [rfc9525] therefore require reference identifiers to be built from the source domain that the user meant to reach, or from a delegation established by configuration or DNSSEC. RFC 9525 also forbids falling back to the subject Common Name. RFC 7817 [rfc7817] applies the rule to submission, IMAP and POP: only the user’s mail domain, the configured host name without CNAME canonicalisation, or a DNSSEC-validated value may serve. For MTA-to-MTA mail the recipient domain is impractical as an identity, because providers cannot hold certificates for every hosted domain, so the MX name is the only candidate, and it is trustworthy only when the MX RRset is DNSSEC-validated [rfc7672]. The same point appears in the TLS best current practice [rfc9325].
The attack redirects a client to an attacker-chosen server and passes every certificate check. Its precondition is the ability to forge the delegating DNS answer (an on-path or cache-poisoning attacker, see On-path DNS interception and resolver tampering).
Pepsi: Addressed. Impact: none.
pepsi-stage-relay-to-internet authenticates an MX host by name only where
the name itself is authenticated. Under an MTA-STS policy, the policy was
fetched over verified HTTPS from mta-sts.<recipient domain>, so the source
domain vouches for the mx patterns. Hosts not matching them are dropped
before connecting, and the verifying connector then checks the certificate
against that permitted MX name (RFC 8461). DANE is applied only when
dns::mx_is_secure found the MX RRset AD-authenticated (delivery.rs,
host_tls_plan). A DANE-TA match is checked against that secured MX name
and a DANE-EE match against the key alone, as RFC 7672 prescribes. Without
either, the stage does not pretend to authenticate anything (see
MTAs accept unvalidated certificates and rarely use DANE or MTA-STS). Every other TLS client takes its
reference name from configuration (smarthost HOST, LMTP HOST, LDAP and
VKS URLs, the IMAP server of pepsi-whitelist import) or from the mail
address itself (WKD’s openpgpkey.<domain> and <domain>). rustls/webpki
never consults the Common Name.
For the clients of Pepsi’s users, the autoconfiguration document
(pepsi-httpd endpoints/autoconfig.rs) is served only over HTTPS from
autoconfig.<domain> or the mail domain, so the host name that it hands a mail
client comes from an authenticated source rather than an SRV lookup. Whether
a client then verifies that name is up to the client (see
TLS clients skip certificate or host-name verification). The remaining dependence on a
trustworthy AD bit is discussed under Stub resolvers trust an unauthenticated AD bit from the recursive resolver.
96.3.4.4. Ambiguous wildcard and multi-name certificate matching¶
Before 2011 the specifications disagreed on where a * may stand in a
presented name: in a partial label, in a non-left-most label, over a public
suffix, several times, or inside an IDN label. Clients consequently disagreed
on what a certificate covers, and the differences could be exploited
[rfc6125]. A wildcard certificate also vouches for every single-label host in
a domain, including rogue or buggy ones. Published attacks combined it with
cleartext-to-HTTPS hijacking or cross-site scripting. A certificate that names
many hosts or serves several protocols (SMTP and HTTP, say) is only as strong as
the weakest server holding its key, and enables cross-protocol redirection
[rfc9525] (see Cross-protocol confusion between services sharing a certificate (ALPACA)).
The fixes are to allow a wildcard only as the complete left-most label, at most once, never inside A-labels or U-labels, and to let protocols forbid wildcards altogether. Servers sharing names should have a common strong minimum configuration and enforce SNI and ALPN [rfc9525].
Pepsi: Partly addressed. Impact: low.
Certificate matching is done by rustls-webpki in every Pepsi TLS client, and it
implements exactly the RFC 9525 rule: a single wildcard, only as the whole
left-most label, never matching the bare parent and never in the Common Name.
Pepsi’s own wildcard matcher, for MTA-STS mx patterns
(pepsi-stage-relay-to-internet mx_match and
pepsi_common::mta_sts::mx_covers), likewise matches exactly one non-empty
leading label, as RFC 8461 requires. pepsi-setup obtains certificates by
HTTP-01, which cannot issue wildcards, so a default installation holds none.
The multi-name residue is narrowed by separate keys. pepsi-setup
(tls.rs, collect_consumers) requests a mail lineage under the ingress
HOSTNAME for the SMTP listeners, covering the MX names of the MTA-STS
policy, and a web lineage <HOSTNAME>-web with a key of its own for the
HTTPS listeners, covering HOSTNAME, the WKD (openpgpkey.<domain>) and
autoconfiguration hosts; each mta-sts.<domain> host has a lineage of its
own. Only the mail key is pinned by a TLSA record, so a key disclosed by the
more exposed web tier authenticates no SMTP session to a sender that enforces
DANE. An installation whose HTTPS listener still shares the mail lineage is
split by the next pepsi-setup run. The cross-protocol redirect itself is
refused by the TLS layer on both sides: pepsi-httpd enforces ALPN
(http/1.1 only) and fails the handshake for an SNI name that it is not
configured for, and pepsi-ingress refuses a ClientHello whose ALPN offer
names only HTTP protocols (Cross-protocol confusion between services sharing a certificate (ALPACA)).
What remains is in the operator’s hands. The web certificate names
HOSTNAME, because the portal and add-in URLs are served there, so a sender
or mail client that authenticates the MX by PKIX alone (MTA-STS, submission)
would still accept the web key; an operator who serves the web under a name of
its own can give the HTTPS listener a certificate without HOSTNAME through
TLS_CERT, which pepsi-setup leaves alone. An operator may equally supply
a wildcard certificate, for mail or web, through TLS_CERT; Pepsi does not
stop that, and such a certificate shares its names and key with whatever else
holds it.
96.3.4.5. Stub resolvers trust an unauthenticated AD bit from the recursive resolver¶
Most end hosts do not validate DNSSEC themselves. They hand every query to a recursive resolver (assigned by DHCP, an ISP or a data centre) and believe what it says, including the Authentic Data (AD) bit that claims the answer was validated. The 2004 DNS threat analysis already named the “betraying” recursive server, buggy, compromised or deliberately rewriting, as equivalent to an interceptor, and noted that TSIG on the channel does not make an untrustworthy server trustworthy [rfc3833]. A stub that delegates validation inherits whatever trust anchors and policy the cache has. The cache cannot be told to drop an answer that the stub would reject, so bad data stays pinned until its TTL expires [yang2010]. The TLSA specification spells out the consequence for DANE: a client that accepts the AD flag over an unprotected path can be spoofed trivially, and even a protected path does not help if the validator is compromised. Caching TLSA results beyond the TTL causes failures after a rollover [rfc6698].
An attacker on the path between the host and its resolver, or one who controls the resolver, sets the AD bit on forged MX, TLSA or key records and turns them into “validated” data, which defeats DANE and anything else gated on DNSSEC. The recommended fix is validation on the host itself (a local validating resolver), or a channel to a trusted validator that is itself authenticated.
Pepsi: Partly addressed. Impact: medium.
Pepsi deliberately trusts the AD bit rather than validating DNSSEC itself
(pepsi-common::dns: raw queries with RD, AD and EDNS DO set, reading
authentic_data from the reply). The module documentation and
Security model state the assumption that the resolver validates and is
reached over a trusted path such as loopback, and the hardened profile in
The network adversary lists a validating resolver on a trusted path first. The AD
bit gates three things: DANE for pepsi-stage-relay-to-internet and the
smarthost stage (tlsa_lookup, mx_is_secure), and DANE key discovery
(OPENPGPKEY/SMIMEA, which is in the default
[pepsi-keydiscovery] SOURCES). An AD-set DANE key ranks 2 on the trust
ladder and is one of the few sources that can produce a valid signature
verdict (Keys of correspondents). A forged AD bit can therefore make Pepsi
encrypt to an attacker’s key, or report a forged signature as valid and so set
state.signature_verified. It can also make a forged TLSA record
authenticate an attacker’s MX or smarthost, since a matching record
authenticates the peer in every DANE mode.
The assumption is checked and stated, deliberately not enforced. The resolvers
are a section’s DNS_SERVERS, else [pepsi] DNS_SERVERS, else
/etc/resolv.conf (dns::name_servers), which on a typical rented server
names the provider’s resolver across the data-centre network over plain UDP.
A DNS_SERVERS list may instead reach a resolver over DNS over TLS
(tls://ADDRESS#NAME) or DNS over HTTPS (https://ADDRESS/PATH#NAME). The
channel is then authenticated by the resolver’s certificate for NAME against
the system roots, and there is no fallback to plain DNS. That is the “channel to
a trusted validator that is itself authenticated” above, and nobody on the way
can set the AD bit that it carries. pepsi-setup’s pre-flight check
(preflight::check_dnssec_for_dane) runs whenever anything depends on the AD
bit, that is, for DANE key discovery or for a relay stage with DANE other
than off, which with the strict default is nearly every deployment. It
warns, per resolver set, when a resolver does not set AD on a signed answer, and
names the option that turns the dependence off. pepsi-setup run and
check also state plainly that the operator trusts the configured resolvers
with DNSSEC validation; they list by IP address every such resolver that is
reached over plain DNS and is not on loopback
(preflight::resolver_trust_notice; silent when there is none). Every relay
worker with DANE on, and pepsi-keydisc@dane, logs a warning when it starts
if its resolver is such a resolver or does not set the AD bit on a signed probe
answer (dns::warn_about_ad_bit). The assumption therefore shows up in every
DANE consumer’s service log, and pepsi-status lists the same in its “DNSSEC
resolver” section. The manual says that DNS setup is outside
Pepsi’s scope and recommends running one’s own validating recursive resolver,
such as unbound, on the host (Installation, Security model).
Pepsi still uses an off-host resolver’s AD bit: the maintainers decided against refusing AD-gated decisions from a non-loopback resolver and against validating in process (which would cost trust-anchor maintenance and more code on the delivery path), because choosing the resolver is the operator’s decision. Attacking this requires a position on the resolver path or control of the resolver, which keeps it at medium. The operator closes it by running a local validator; the part that concerns the path is also closed by an encrypted entry for a validating resolver that the operator trusts. The cause is a design choice shared with Postfix and documented. Pepsi caches no TLSA answers itself, so the stale-cache part of [rfc6698] does not apply.
96.3.4.6. Unsigned or stale delegation glue trusted by resolvers¶
DNSSEC signs the child’s data and the parent’s DS record, but not the parent’s NS and glue (name-server address) records of a delegation. The design assumes that whoever redirects queries still cannot forge signed child data. That fails once a child zone’s key has leaked, because the attacker forges a referral and serves validly signed false data from a server of its choosing [yang2010]. For unsigned zones, glue alone decides where resolution goes. A 2024 study found 23 % of glue records in 1,096 TLD zones outdated but still served, because registrars and registries do not remove glue when a name-server address changes or a domain expires. Resolvers cache and use such glue even for out-of-bailiwick delegations, and fall back to it when the validated name servers fail. An attacker who acquires a stale glue address, typically by renting it from a cloud provider, answers authoritatively for every domain delegated to that name server. All 9 tested implementations (including BIND 9 and Microsoft DNS), more than 90 % of stable open resolvers and 14 public resolvers were susceptible. About 6.4 million domains were at risk of hijacking and 785,000 of denial of service [zhang2024].
The attacker gains covert control of all records of the affected domains, including MX and TXT, towards vulnerable resolvers, without touching the victims’ registrar accounts or name servers. Fixes are on the DNS side: registries cleaning up glue (.org and .info agreed to), and resolvers that query the name server’s own address instead of trusting sibling glue (Unbound and Technitium already do this; Microsoft planned a patch).
Pepsi: Partly addressed. Impact: medium.
Pepsi contains no recursive resolver. It asks the configured one, so whether
stale glue is followed is decided by the resolver the operator runs. What Pepsi
controls is how much a hijacked answer is worth. For a DNSSEC-signed domain a
validating resolver rejects the hijacker’s unsigned or wrongly signed records.
Pepsi then defers delivery, or (under DANE strict) refuses to fall back
(DNSSEC misconfiguration breaks the chain of trust (missing DS, bogus zones)). For a recipient with an MTA-STS
enforce policy the hijacker also needs a certificate valid for an MX name
that the cached policy permits. So the hardened profile in The network adversary
contains the attack wherever the peer has published something to check
against. That profile combines a validating resolver such as unbound on
loopback, which does not trust out-of-bailiwick glue, with DANE and MTA-STS.
For the large majority of domains that publish neither, a hijacked MX
receives the mail, and hijacked SPF, DKIM key or DMARC records let forged mail
from those domains pass pepsi-ingress’s authentication
(Mail routing and sender authentication rely on unauthenticated DNS). This is inherited from the DNS
ecosystem: registries and resolver vendors have to remove the stale glue.
Pepsi can only recommend a resolver that ignores sibling glue; its manual
recommends unbound on loopback without mentioning glue handling.
96.3.4.7. Registrars accept unauthenticated or faulty DS/CDS updates¶
The DS record at the parent is the anchor of a domain’s DNSSEC chain of trust, yet registrars accept it through weak channels. Chung et al. bought domains from the leading registrars in 2017. Of 12 registrars with a web form for owner-supplied DS records, 10 did no check that the DS matched the domain’s DNSKEY. Several took DS updates by unauthenticated e-mail, one from an address other than the registrant’s, and over chat one registrar installed the authors’ DS on somebody else’s domain. Registrars that fetch the DNSKEY themselves open a window in which an attacker controlling DNS answers can get a wrong key installed [chung2017a]. Automation through CDS/CDNSKEY (RFC 7344, RFC 8078) was barely deployed in 2021, and where it was, it had faults: CDS records for zone-signing keys, CDS records with no matching DNSKEY (a key tag of 0 from one DNS host), and registry processors that rejected valid record sets or acted on stale cached data for days [beijnum2021].
A forged request to such a registrar replaces a victim’s DS record. That either makes the domain bogus (unreachable for validating resolvers) or, combined with control of DNS answers, installs the attacker’s own key and so takes over the domain’s DNSSEC-authenticated identity, including its TLSA and key records. A faulty automated update does the first by accident. The recommended fixes are DS validation against the served DNSKEY, authenticated update requests, and validated CDS processing.
Pepsi: Not applicable. Impact: none.
Pepsi is not a registrar or registry and accepts no DS or CDS records. It
neither publishes DS records nor talks to registrars: pepsi-setup prints
the records that an operator must publish in their own zone (DKIM, SPF, MTA-STS,
TLSRPT, TLSA, key records), and the parent side is entirely between the
operator and their registrar. The effect on a deployment is the general one of
DNSSEC misconfiguration breaks the chain of trust (missing DS, bogus zones) and Keys published in DNS are only as trustworthy as the zone operator:
whoever can change the DS controls everything that Pepsi or its peers accept as
DNSSEC-validated for the domain. Operators who publish TLSA or DNS key
records should choose a registrar that authenticates DS changes and protects
the account with a second factor.
96.3.4.8. Over-broad client-certificate trust and missing issuer and key-usage checks¶
TLS client-certificate authentication is often configured so that the trust store accepts far more than the operator intends. Parsovs studied Apache mod_ssl and the Estonian ID-card deployments in 2014. mod_ssl trusts every chain that ends at any certificate in its CA file, and builds it with extra intermediates that the client supplies. Following the CA’s own instructions to list the root plus the intended intermediate therefore also accepts certificates from every other intermediate under that root, including test or differently purposed CAs. Applications then typically check only the subject name. Several IIS-based services accepted certificates whose key usage allowed only non-repudiation, and one bank verified neither key usage nor the signature on the client certificate [parsovs2014].
An attacker holding any certificate from a weaker or unrelated branch of the same hierarchy, and in the worst case none at all, authenticates as another user whose subject name it knows. The recommended fixes are to keep no spare CA certificates in the trust store, check the issuing intermediate at application level, limit the verification depth and verify key usage and revocation.
Pepsi: Addressed. Impact: none.
pepsi-ingress offers client-certificate authentication on listeners that
set TLS_AUTH_CLIENT or TLS_AUTH_CLIENT_CA (both off by default,
pepsi-ingress). The TLS layer accepts any certificate
(PermissiveClientCertVerifier in smtp/clientcert.rs) so that an
unrecognised client can fall back to SASL, but rustls still verifies the
handshake signature, so possession of the key is always proven; the bank’s
failure cannot occur. The decision is then made over what was presented.
TLS_AUTH_CLIENT pins individual client keys by SPKI hash, which is narrow
by construction, and a hash that turns out to name a CA in the chain authorises
nothing, because an anchor given by hash alone has no checkable constraints.
TLS_AUTH_CLIENT_CA takes the CA certificates, and a presented
certificate is accepted only on a full RFC 5280 path to one of them through
pepsi_crypto::trust::validate: validity, basicConstraints with the path
length (the anchor’s own included, RFC 5937), key usage, name and policy
constraints, the unrecognised-critical-extension rule and key strength. The
leaf must carry id-kp-clientAuth explicitly (neither an absent extension
nor anyExtendedKeyUsage counts), the digitalSignature bit, and must not
be a CA. Revocation is checked against the lists that pepsi-keydisc keeps:
every certificate of the path that names a distribution point must be covered by
a current list that its issuer signed, a listed serial is a refusal, and no list at
hand is a refusal too (451 on a submission listener until the list is
fetched). This is the one revocation check in Pepsi that fails closed. So the
mod_ssl shape, where listing the root plus the intended intermediate admits
every other intermediate under that root, does not arise: the operator lists
the issuing CA itself, and a path length or name constraint on it is enforced.
Over-breadth of the grant is closed as well. A certificate authenticates
only what [pepsi-ingress] SENDER_MAP binds its key or CA to, and an
unbound certificate authenticates nothing, so a pin is never a blanket relay
grant; pepsi-setup validate refuses a configuration with a pin or CA that
SENDER_MAP binds to nothing (check_bound_client_certificates), while a
running pepsi-ingress only warns about it. A CA-issued certificate that
names a mailbox (rfc822Name SAN, or the subject’s emailAddress) may
send as that mailbox alone, so one line cert:<CA> * serves an organisation
whose CA puts each user’s address into their certificate, and an address
that another line names exactly is out of every wildcard’s reach. The residue is
the deliberate one: a pinned key is bound
by the operator’s line, not by what its (possibly self-signed) certificate says
about itself, and a CA-issued certificate that names no mailbox gets the CA’s
whole grant.
96.3.4.9. Reverse DNS (iprev) checked but not enforced¶
Forward-confirmed reverse DNS (FCrDNS, “iprev” in RFC 8601) asks whether the connecting address has a PTR name that resolves back to it. Arouna et al. (2025) inferred prospective sender addresses from SPF policies and found only about a quarter (two thirds of those with any PTR record) to be FCrDNS-configured. Postfix and Exim compute iprev by default but do not act on it without extra configuration. All ten large providers tested checked iprev, but eight of them still delivered mail from a sender without valid FCrDNS; only Gmail and Zoho rejected it [arouna2025].
Hosts without matching forward and reverse DNS, typically compromised end-user or cloud machines used by spammers, can therefore deliver mail almost everywhere, so iprev filters little in practice. The paper prescribes nothing but observes that most legitimate senders already pass, so receivers could require it. iprev is a reputation signal, not authentication of the sender, and an attacker who controls a PTR zone and an A record passes it.
Pepsi: Addressed. Impact: low.
pepsi-ingress computes the verdict once per TCP session
(pepsi_common::auth::Authenticator::iprev) and records it in
state.origin.iprev and the Authentication-Results header
(The message state). Acting on it is the operator’s choice. With
[pepsi-ingress] IPREV_ACTION = reject, an unauthenticated session on a
non-submission listener whose verdict is a definite fail has its recipients
refused at RCPT with 550 5.7.25 (RFC 7372), so the sending MTA
reports it and nothing is dropped silently or bounced to a forged
sender; <postmaster> stays reachable, and a temperror or permerror
never refuses. The default is none, which only records: broken reverse DNS
is evidence about a sender’s DNS, not about its message, small legitimate
sites have it, and Pepsi’s spam defence is designed around other signals
(whitelists, pay-to-send). pepsi-stage-if can still route on
origin.iprev after DATA. As a sender, Pepsi does its part.
pepsi-setup checks the host’s own PTR and FCrDNS, also through public
resolvers (pepsi-setup), because Gmail and others refuse mail
without it.
96.3.5. Deployment, configuration and credentials¶
Configuration errors, abandoned resources and weak, reused or stolen secrets.
96.3.5.1. DNSSEC misconfiguration breaks the chain of trust (missing DS, bogus zones)¶
A DNSSEC zone is validatable only while its keys, signatures, every authoritative server and the DS record at the parent stay consistent, and they are managed by different parties. Measurements since 2008 find the same two failure modes. The first is a chain that was never established: about 30 % of signed .com/.net/.org domains had no DS at the parent [chung2017], more than 68 % of misconfigurations in another scan were signed zones with no DS, and five hosting ASes accounted for 60 % of those [adrichem2015]. Registrars that do not support DNSSEC, or charge for it, and the manual DS hand-over left 40 % of Cloudflare-signed domains without a DS [chung2017a]. The second is a chain that breaks and makes the zone bogus: missing, expired or invalid RRSIGs, a DS with no matching DNSKEY, inconsistent authoritative servers, stale trust anchors and errors in ancestor zones (28 % of certain failures) [deccio2011] [wander2017]. In a 2025 longitudinal study, 25.6 % of domains showed at least one DNSSEC error. 81 % of valid-to-bogus transitions followed name-server changes or rollovers, 18 % of domains ever bogus were still bogus at the end, and operators often “fixed” breakage by removing DNSSEC [ashiq2025b]. Earlier work added availability failures from DNSKEY responses too large for the path MTU, isolated “islands of security” before the root was signed, and stale but still validly signed infrastructure records that an injector could replay until their signatures expired [osterweil2008] [osterweil2009].
No attacker is needed. A bogus zone fails (SERVFAIL) for every client behind a validating resolver, taking DANE, DNS-published keys and mail delivery with it (74 % of misconfigured .se domains were unreachable through Google Public DNS). A zone without DS silently gets no protection while its owner believes it is signed. The proposed fixes are monitoring from outside, automated signing and DS publication by hosting providers and registrars, tools such as DFixer, and resolver-side soft anchoring.
Pepsi: Partly addressed. Impact: low.
As a sender Pepsi fails closed in the right places. A bogus MX or TLSA answer
comes back as SERVFAIL from a validating resolver (pepsi-common::dns,
secure_query), and the relay stages defer rather than deliver: always for
the MX lookup itself, and for the TLSA lookup under DANE = strict, the
default (the explicit opt-out DANE = warn proceeds
without DANE). A peer whose zone lacks
a DS is simply insecure, and DANE is not applied. Nothing better is possible
there.
For its own domains Pepsi signs no zones, so the residue is detection.
pepsi-setup re-asks the MX, TXT, A/AAAA and PTR records of every served
domain through public validating resolvers (outside.rs, [pepsi]
PUBLIC_RESOLVERS). A bogus own zone therefore shows up as SERVFAIL, with the
RFC 8914 reason when the resolver gives one. pepsi-setup also
asks the public validating resolvers for the AD bit on every published TLSA
RRset and on the MX RRset of each accepted domain, and tells the answers apart
by response code and Extended DNS Error (pepsi_status::own_dnssec::classify):
a SERVFAIL naming a DNSSEC failure (EDE 6 to 12: DNSSEC Bogus, Signature
Expired, DNSKEY Missing, …) is reported as a broken chain that validating
resolvers refuse, for the MX RRset whether or not TLSA is published; an
answer without the AD bit is “published but not DNSSEC-validated”, which also
catches a signed zone without a DS at the parent (see
Stale or mismatched TLSA records break SMTP DANE); no reply proves nothing and is not reported.
Between setup runs, pepsi-status has an “Own DNSSEC” section that asks the
local validating resolver the same about every served domain’s MX RRset and
its MX hosts’ TLSA records (validated, insecure, bogus with the
EDE, servfail), so monitoring that runs pepsi-status --json can alert
on a bogus chain, and the daily pepsi-setup-check.timer fails on one. The
DNS itself stays the operator’s responsibility.
96.3.5.2. Most recursive resolvers do not validate DNSSEC¶
DNSSEC protects only clients whose resolver checks the signatures, and most do not. Measurements of caching resolvers found about 4.8 % validating in 2013 [yu2013]. Fewer than 3 % of web clients failed to load names with bogus signatures, protection being concentrated in a few ISPs such as Comcast [lian2013]. 83 % of observed resolvers set the DO bit, but only 12 % validated and 3,635 resolvers returned answers for deliberately broken zones [chung2017]. In 2023, fewer than 18 % (IPv4) and 38 % (IPv6) of open non-forwarding resolvers validated, and only around 40 % of closed resolvers reachable through networks without inbound source address validation did [nosyk2023]. Requesting DNSSEC records is not the same as validating them, so DO-bit counts overstate deployment. One ISP’s validator even inverted the RRSIG label check, and signed zones failed more often because large responses forced TCP fallback through broken middleboxes [lian2013].
For a client behind a non-validating resolver a correctly signed zone is worth nothing. An on-path or cache-poisoning attacker substitutes records, and any mechanism bootstrapped from DNSSEC, DANE above all, offers no protection. No paper offers a remedy beyond deploying validation at resolvers (and inbound source address validation).
Pepsi: Partly addressed. Impact: low.
Pepsi fails safe with a non-validating resolver, and says so. Answers without
the AD bit are never treated as authenticated: tlsa_lookup returns “no
DANE” and mx_is_secure returns false. DANE key-discovery results without
AD are refused, and the trust mapping in pepsi-keymat (trust_source_of)
turns an AD-clear DANE row into an untrusted source. The raw query code
retries over TCP on truncation, so large signed answers survive. That a
resolver does not validate is made visible wherever DANE is in use, since the
protection would otherwise disappear without anyone being told. Every DANE
consumer (pepsi-stage-relay-to-internet, pepsi-stage-relay-to-smarthost
and pepsi-keydisc@dane) asks its resolver for the signed ietf.org
SOA when its worker starts (dns::warn_about_ad_bit,
dns::resolver_validates). It logs a warning when the answer lacks the AD
bit or does not come, next to the warning about a resolver off this host.
pepsi-setup’s pre-flight runs the same probe and names, by IP address,
every resolver off this host that the installation trusts. pepsi-status
reports each resolver set with its consumers in a “DNSSEC resolver” section,
so a resolver put into resolv.conf after setup shows up on a running
host. Peers with DNSSEC-signed TLSA records behind such a resolver can
still be intercepted like any opportunistic peer
(Opportunistic STARTTLS can be stripped by an active attacker), but not unnoticed.
What Pepsi can own is the path to a validating resolver elsewhere. Without a
local validator the only trustworthy path to an AD bit would be loopback, so an
operator whose host cannot run one would get warnings and no DANE. A
DNS_SERVERS entry (in [pepsi] for every consumer at once, or in a
stage’s section) may name a resolver reached over DNS over TLS (RFC 7858,
tls://ADDRESS[:PORT]#NAME) or DNS over HTTPS (RFC 8484,
https://ADDRESS[:PORT][/PATH]#NAME), its certificate verified for NAME
against the system roots. Such a resolver’s AD bit is as trustworthy as the
resolver itself: the off-host warnings leave it out, while the validation probe
still runs, because an encrypted channel does not make a resolver validate. A
list never mixes plain and encrypted entries and never falls back to plain DNS,
so the encryption cannot be silently lost; an unreachable resolver is a failed
lookup, which every consumer treats as temporary.
The structural fix is the operator’s, as under
Stub resolvers trust an unauthenticated AD bit from the recursive resolver: Pepsi does not validate in process (a
design decision), DNS setup is outside its scope, and the manual recommends
running one’s own validating recursive resolver, such as unbound, on the
host, or reaching a validating resolver that one trusts over DNS over TLS or HTTPS
(Installation). The hardened profile in The network adversary depends on the
operator providing one.
96.3.5.3. Mistimed or noncompliant DNSSEC key rollovers make zones bogus¶
A DNSSEC key rollover is a sequence of stages in which new keys and signatures are introduced and old ones withdrawn. Each stage is safe only once the publication delay (all authoritative servers serve the new zone) and the propagation delay (caches have expired the old records, governed by the largest TTL) have passed. Best-practice documents give only abstract timing. Müller et al. measured rollovers from many vantage points and found that removing an old key while resolvers or forwarders still cache signatures made with it, or swapping the DS before resolvers hold the new key, leaves validating resolvers unable to build a chain. Such mixed caches do occur, and a few resolvers strictly reject a zone not signed with every algorithm in its DNSKEY set during an algorithm rollover. Failed rollovers have made entire TLDs (.nl) unresolvable for validating users [muller2019a]. A long-term study of zone operators found that most KSK transitions and the vast majority of ZSK transitions did not follow the RFC procedures, with expired or not-yet-valid signatures, unsigned keys and rollbacks to earlier keys. Errors peaked whenever inexperienced operators rushed to deploy, and KSK transitions coordinated with the parent DS grew more error-prone over 2011 to 2020 [osterweil2022].
The result is denial of service. For minutes to days every user behind a validating resolver (over 70 % of users in Sweden) cannot resolve the zone or anything under it, including mail records whose authenticity depends on DNSSEC. Alternatively, old keys stay usable longer than intended. The remedy is to wait out both delays at every stage, double-sign throughout algorithm rollovers, and verify from external resolvers before each step. The authors release tooling for this.
Pepsi: Partly addressed. Impact: low.
Pepsi does not sign zones or roll DNSSEC keys. That is done by whatever DNS
software or provider hosts the operator’s zone, so the error itself is outside
Pepsi. Its consequences reach a deployment in two ways. A peer’s botched
rollover makes that peer’s MX or TLSA answers bogus, and Pepsi defers the mail
(and retries until MAX_LIFETIME) instead of delivering it unauthenticated,
which is the behaviour RFC 7672 asks for. A botched rollover of the
operator’s own zone makes two things unreachable: inbound mail from validating
senders, and the TLSA, MTA-STS and DNS key records that Pepsi relies on.
pepsi-setup’s outside check through public resolvers (outside.rs)
reports such a zone as SERVFAIL with the resolvers’ reason, which is exactly
the external verification that the papers recommend; a SERVFAIL with a DNSSEC
Extended DNS Error on the MX or TLSA RRset is reported as a broken chain
(DNSSEC misconfiguration breaks the chain of trust (missing DS, bogus zones)). The daily pepsi-setup-check.timer runs
that check and fails on such a finding, and pepsi-status’s “Own DNSSEC”
section asks the local validating resolver the same whenever monitoring runs
it, so a botched rollover is noticed within a day at most, but not prevented.
An operator rolling keys should still run pepsi-setup check after each
stage.
96.3.5.4. Stale or mismatched TLSA records break SMTP DANE¶
DANE couples two independently managed objects: a TLSA record in a
DNSSEC-signed zone and the certificate or key on the mail server. Nothing keeps
them in step. In 2015, 7 to 13 % of TLSA records were invalid, mostly because
a certificate or a record was renewed without the other, and a third of TLSA
responses were large enough to fragment [zhu2015]. A 2020 study of SMTP DANE
found 36 % of TLSA records for MX hosts unvalidatable (signed zones without a
DS above all) and 14 % not matching the served certificate. 94 % of domains
that rolled keys suffered at least one period of failure, because the new key
and its record went live together instead of the record being published a TTL
ahead [lee2020]. Two years later more than 87 % of key changes in every
management category were still done wrongly. The main driver is automated
certificate issuance: about 94 % of DANE-EE certificates came from public CAs,
mostly Let’s Encrypt, whose client certbot generates a new key pair at every
renewal by default. A 3 1 1 record therefore breaks every few months,
and DANE-TA records pinned to the issuing CA broke when Let’s Encrypt switched
intermediates [lee2022]. A 2024 survey adds that one in three TLSA record sets
is served without DNSSEC and only about 70 % match the served certificate
[tehrani2024].
A mismatch is an operator-caused denial of service: DANE-validating senders defer and eventually bounce mail to the domain. The persistent breakage teaches operators and senders to tolerate failures or to switch DANE off, leaving the transport open to downgrade. Unsigned TLSA records protect nothing. The fixes are to publish the next key’s record at least a TTL before the switch (or keep the key across renewals), retire old records only afterwards, prefer SPKI selectors, and monitor continuously.
Pepsi: Partly addressed. Impact: low.
Pepsi avoids the exact failure that the 2022 study found, a certbot that generates
a new key pair at every renewal behind a printed 3 1 1 (DANE-EE, SPKI,
SHA-256) TLSA record: pepsi-setup passes --reuse-key when it obtains or expands a
certificate (run_certbot in pepsi-setup/src/tls.rs), and on every run
sets reuse_key = True in the certbot renewal configuration of each lineage
that the configuration uses (ensure_reuse_key), so an existing installation is
repaired by re-running pepsi-setup run (pepsi-setup(1)). Its
run and check also compare every published TLSA RRset with the
certificate chain that the listener actually loads (pepsi-setup/src/tlsa_check.rs),
the way a receiver does (RFC 7672: DANE-EE against the leaf, DANE-TA against the
chain, either selector, SHA-256 or SHA-512), and warn when usable records are
published and none matches, when none is usable, or when a DANE-TA anchor cannot
be judged from the served file. So an operator-made mismatch, a hand-installed
certificate or a restore onto a new key is reported instead of silently bouncing
off DANE-enforcing senders. A deliberate key change still needs its record
published a TTL ahead; pepsi-setup prints no “current + next” pair and has
no rollover workflow of its own (a design decision: certbot’s key is kept with
--reuse-key), and the manual gives the procedure instead
(Changing the key behind a TLSA record): create the next key beside the current one, publish
its 3 1 1 record alongside the current record, wait out the TTL, switch the
services to the new key, then remove the old record. What remains is
that this is a manual procedure, and that the check reports a stale record but
cannot publish the fix.
On the sending side Pepsi avoids the opposite weakness, the mismatch tolerance
that the papers warn about: DANE = strict is the default (pepsi-common::smtp::dane), so a mismatch
defers the message, as RFC 7672 requires; the price is deferred mail to peers
with stale records, which they learn about through TLSRPT (tlsa-invalid).
DANE = warn stays as an explicit opt-out, and falls back to the
verification the hop has without DANE (TLS_VERIFY for a smarthost,
opportunistic TLS for direct MX delivery), so it is never weaker than DANE =
off.
96.3.5.5. MTA-STS scarce, in testing mode, misconfigured or not enforced¶
MTA-STS lets a recipient domain demand that senders deliver only over
PKIX-authenticated TLS to the MX hosts that its HTTPS-served policy lists, and
otherwise not at all [rfc8461]. It protects only where three separately
managed pieces agree, where the policy is in enforce mode, and where the
sender implements it. The three pieces are the _mta-sts TXT record, the
policy host mta-sts.<domain>, and MX hosts with valid certificates matching
the policy. Every measurement finds all of these scarce. In 2021 only 219
domains had a working policy, half of them in testing mode, which enforces
nothing. Only Gmail and SocketLabs were seen evaluating policies, and some
policies used invalid modes or mx entries that matched no MX [tatang2021].
In 2024, 19.5 % of published deployments were ineffective (no address for the
policy host, invalid certificates, MX hosts without TLS or with mismatching
names, MX hosts missing from the policy), 45 % of valid policies were in
testing mode, and only 0.13 % of domains had a correct enforced policy
[uriports2024]. In 2025, 29.6 % of 68,030 domains with a record were
misconfigured, 85 % of them at the policy server, often because mail and
policy hosting were outsourced to different parties. On the sending side
93.2 % of tested domains accepted any certificate and only 19.6 % validated
MTA-STS [ashiq2025]. Tuta Mail, Yahoo, Fastmail and the transactional
providers Amazon SES, Mailgun and SparkPost delivered to a test server without
TLS despite an enforcing policy. Gmail delivered the first message before its
policy fetch completed, which RFC 8461 permits [alexsci2024]. Even a correct
policy is weakened by a broad mx pattern such as *.example.com, which
admits any host of the domain holding a valid certificate, and by any
mis-issued certificate for an MX or the policy host [rfc8461].
A policy that cannot be fetched or validated silently degrades to
opportunistic TLS, so an active attacker between the MTAs strips STARTTLS or
substitutes a certificate. The authors highlight password-reset and
“magic link” mail from transactional providers, whose interception means
account takeover [alexsci2024]. An enforcing policy that matches no MX is
instead a self-inflicted denial of delivery. The remedies are sender support,
enforce mode, TLSRPT monitoring, hosted or automated policy generation,
precise mx patterns, and proactive policy refresh.
Pepsi: Partly addressed. Impact: low.
On the publishing side Pepsi avoids the measured misconfigurations by
construction. [pepsi] MTA_STS_MODE defaults to enforce.
pepsi-httpd serves the policy (endpoints/mta_sts.rs) with the
certificate that pepsi-setup obtained. The mx set is per domain, from exact
names unless the operator writes a wildcard (pepsi_common::mta_sts), and
pepsi-setup checks it against the live MX records, checks that
mta-sts.<domain> resolves, fetches the policy over verified HTTPS
(mta_sts_check.rs) and prints the TLSRPT record. As a sender
pepsi-stage-relay-to-internet evaluates MTA-STS by default
(pepsi-stage-relay-to-internet). It refuses to deliver under
enforce to an unlisted or unverifiable MX, validates testing policies
for TLSRPT, and lets DANE in warn mode override an enforced policy only
with PKIX validation intact.
Fetched policies are stored for their max_age, capped at seven days, in the
pepsi.mta_sts_policy table (mta_sts.rs, schema patch pepsi-0002),
shared by all workers and kept across recycling and restarts. The residue is
the first contact with a domain: a fetch that fails with nothing stored fails
open, as RFC 8461 allows (MTA-STS first-contact gap and blocking of policy discovery). A stored policy is
refreshed once half its lifetime has passed, both on use and proactively, as
the remedy above and RFC 8461 section 10.2 ask: the hourly pepsi-queue gc
fetches every due policy whether or not its domain is mailed
(MtaSts::refresh_stored), and a failed refresh keeps the stored policy
until its max_age runs out. A domain that keeps publishing a policy
therefore never lapses back to first contact; the cap keeps a poisoned policy
from being pinned for long once its host stops serving it (see
MTA-STS policy poisoning causes denial of mail delivery). The ecosystem residue, recipients
without a policy or with a testing one, is discussed in Opportunistic STARTTLS can be stripped by an active attacker
and can only be fixed by those domains. Web PKI dependence with revocation
checked only from a stapled OCSP response is shared with
TLS clients skip certificate or host-name verification. Nothing in this issue is left for
Pepsi’s code: what remains is the other mail providers’ deployment.
96.3.5.6. Dangling DNS records to released resources enable takeover¶
A DNS record is an unauthenticated pointer: nothing checks that the address, third-party service account or domain that it names still belongs to the zone owner. When the resource is released and the record stays, whoever obtains the resource next controls what the name resolves to. Liu, Hao and Wang named these records “Dares” and described three takeover routes: cloud IP addresses re-allocated from a shared pool, abandoned service accounts (hosting, CDN, and for MX a mail delivery service) that do not verify domain ownership, and expired domains named by CNAME, MX or NS records, often secondary MX or NS entries kept for failover. They confirmed 467 exploitable cases in 277 Alexa top-10,000 domains [liu2016]. Borgolte et al. showed that cycling cloud allocations recovers a stale address for about 31 USD and in under 70 seconds, faster than common TTLs, and that automated domain validation then issues a trusted certificate for the name; they found over 700,000 domains pointing to free cloud addresses and proposed an ACME challenge that requires continuity with previously logged certificates [borgolte2018]. A detector over passive DNS found 317,000 unsafe dangling names, including 1,974 dangling NS records that hand over whole zones [unit422021], and a three-year study found the first large-scale abuse in the wild: 20,904 hijacked cloud resources, subdomains of 31 % of the Fortune 500, mostly through deterministic, user-chosen resource names [friess2024].
For mail the decisive variant is the SPF reference. In the “SubdoMailing”
campaign an actor re-registered domains that brands’ CNAMEs or SPF include:
and a: terms still named, added more than 17,000 sending addresses of its own
to the brands’ authorised senders, and sent millions of messages a day that
passed SPF and DMARC under more than 8,000 well-known domains [guardio2024b].
A dangling MX lets the attacker receive the domain’s mail; a dangling NS gives
the whole zone, including MX, TXT and TLSA. The fix lies with the domain
owner: remove records together with the resource, audit SPF terms and
delegations, and watch Certificate Transparency; CAA does not help, since the
attacker can use a permitted CA [friess2024].
Pepsi: Partly addressed. Impact: low.
Pepsi does not run DNS, so a dangling record in an operator’s zone is outside
its code, but it is affected from three sides. Its own domains:
pepsi-setup (pepsi-setup) checks the live records that it
prints for each served domain: that the single v=spf1 record lists every sending
address, flagging a second SPF record (the typical migration leftover) and
+all (check_spf in pepsi-setup/src/lib.rs), and that MTA-STS mx
lines match the live MX set. It also warns about dangling
targets (pepsi-setup/src/dangling.rs): an MX host that has no address, and
an SPF include: or redirect= whose target publishes no SPF record (or
more than one), which RFC 7208 makes a permanent error that voids the domain’s
whole policy (NS hosts, served-host CNAMEs and SPF a:/mx: terms are
covered too, see below). It cannot flag a target that still resolves but has
changed hands, which lets a third party send mail that passes SPF as the
operator’s domain, receive part of its mail, or serve its MTA-STS policy or
WKD keys. As a receiver:
pepsi-ingress cannot tell an SPF pass earned through a hijacked
include: from a genuine one; that pass then counts as authentication for
DMARC and for BOUNCE_UNAUTHENTICATED in pepsi-stage-bounce.
The whitelist’s dkim_required rule and DKIM alignment are not affected by a
hijacked SPF include, but are by a hijacked NS delegation. As a key consumer:
pepsi-keydisc trusts WKD at a high rank (Key management), so a
correspondent’s dangling openpgpkey CNAME lets the new holder obtain a
domain-validated certificate and publish a key that Pepsi will encrypt to
(CA compromise, coercion and mis-issuance of certificates).
What remains is mostly a matter of DNS hygiene by operators and
correspondents, which no receiver can verify. pepsi-setup catches the
leftovers that no longer resolve, the common case after a migration; a name
that has already been re-registered resolves normally and looks legitimate
from here. The check also covers NS hosts with no address,
CNAMEs at mta-sts., openpgpkey. and autoconfig. whose target has no
address, and SPF a:/mx: terms naming a host with no address or MX
(pepsi-setup/src/dangling.rs), reporting only a definite “no such record”.
Enabling DMARC_ENFORCE does not
help, because the forged mail passes DMARC.
96.3.5.7. BGP hijacking of mail infrastructure lacking ROA/ROV and redundancy¶
Delivering mail to a domain takes three network steps: resolving its MX records, resolving the MX host names, and reaching the MX addresses. Whoever controls, or hijacks by BGP, a network on which all name servers or all mail servers of a domain depend can drop, redirect or observe that traffic. Bartoli mapped these dependencies for government mail domains in Italy, Germany, the UK and the US and found little redundancy: roughly 44 % (Italy) and 55 % (Germany) of mail domains have all their mail servers in one network, AS-level redundancy for reaching mail servers is almost absent, dependencies concentrate in a few, partly foreign, cloud and DDoS-protection providers, and for more than half of the domains in every dataset none of the networks involved is covered by a Route Origin Authorization [bartoli2023]. ROAs do not stop path manipulation and only help where receiving ASes validate origins. Chen et al. showed that even then, partial Route Origin Validation leaves “stealthy” hijacks: an ROV-enabled AS drops the invalid route but forwards traffic to a downstream legacy AS that took it, so the victim’s control-plane view looks clean while data is diverted. They captured 318 high-confidence incidents in two months of 2025 and estimate a 14.1 % overall success probability, up to 99.5 % for targeted cases [chen2026b].
The attacker gains denial of service for a domain’s mail, or an on-path position on DNS and SMTP from which opportunistic TLS can be stripped and domain-validated certificates obtained. Remedies are more ROA and ROV deployment, maximal-length prefix announcements, monitoring routing-table discrepancies, and spreading name and mail servers across networks [bartoli2023] [chen2026b]. Transport security with DANE or MTA-STS then at best turns interception into denial of service.
Pepsi: Vulnerable. Impact: medium.
Pepsi cannot influence routing. A hijack of its own prefix makes it unreachable
for the affected senders, who queue and retry, and lets the attacker receive
mail for its domains from senders that do not authenticate the hop; without
DANE or MTA-STS published by the operator, that is most senders. A hijack of
a peer’s prefix intercepts Pepsi’s outbound mail to that peer wherever the peer
has published no policy; a peer’s DNSSEC-signed TLSA records are enforced
under the default DANE = strict, so for such a peer the hijack becomes a
deferral rather than an interception (An active network attacker). The setup wizard configures a single MX host, so
redundancy across networks is entirely the operator’s choice. Certificates
obtained by pepsi-setup through certbot’s HTTP-01 challenge are themselves
open to the same hijack (CA domain validation subverted via BGP and DNS attacks).
The defences available are those of the hardened profile in The network adversary:
DANE = strict on the relay stages (the default), MTA-STS left on, and publishing one’s own
TLSA, MTA-STS enforce and TLSRPT records, all of which pepsi-setup
prints. Beyond that, operators should sign ROAs for the prefixes in which their
MX and name servers live, and place a secondary MX and name server in another
AS. None of this prevents the outage; it converts interception into deferral,
at the price that the strict default carries: deferred mail to domains with broken
TLSA records (Stale or mismatched TLSA records break SMTP DANE).
96.3.5.9. Weakest-link CA trust and interception roots allow forged certificates¶
A PKIX client accepts any certificate that chains to any root in its trust store, so the system is as strong as the weakest authority in that store and the weakest local root that someone installed. Huang et al. measured this on Facebook’s users with a client-side probe: 0.2 % of 3.4 million TLS connections carried a forged certificate, mostly from antivirus products, corporate filters and firewalls, parental control software, adware and malware, some with 512-bit keys or no host-name match; one appliance vendor shipped the same interception CA key in every device, so anyone could intercept its users [huang2014a]. RFC 7672 explains why inter-domain SMTP cannot fix this with a curated CA list: an MTA has no user to override failures, so the list would have to be comprehensive, and then any one compromised or hostile CA can issue for any MX; DANE-EE and DANE-TA records remove the CAs from the decision, leaving DNSSEC as the trust anchor [rfc7672]. The IAB’s pervasive-surveillance threat model adds that attackers in the network core can combine traffic redirection with inducing any one of many trusted CAs to issue a credential (“the weakest link”) [rfc7624].
The gain is a man-in-the-middle position on a TLS session that the client reports as authenticated. Defences surveyed are pinning, Certificate Transparency, notaries and DANE; none helps against a root installed locally on purpose [huang2014a].
Pepsi: Partly addressed. Impact: medium.
Pepsi’s outbound TLS verification (pepsi_common::smtp::tls::connector)
trusts the operating system’s root store, loaded with rustls_native_certs,
plus an optional TLS_CA. It therefore inherits whatever roots the host’s
administrator or software installed, and every public CA. This applies to
MTA-STS-enforced delivery and the policy fetch itself, to smarthost connections
with TLS_VERIFY unless the entry names a TLS_CA_BUNDLE, which replaces
the store for that smarthost, and to the HTTPS lookups of pepsi-keydisc (WKD, VKS),
whose keys rank high enough to produce valid verdicts (Key management).
Pepsi checks Certificate Transparency only to warn: a certificate that was not
logged is reported and used all the same
(Log equivocation and unenforced Certificate Transparency). Where the peer publishes
DNSSEC-signed TLSA records, pepsi-stage-relay-to-internet uses DANE
instead of the CAs and enforces it under the default DANE = strict; only
the warn opt-out keeps PKIX for a mismatch
(pepsi-stage-relay-to-internet). Pepsi’s own
MX publishes a 3 1 1 (DANE-EE) record when the operator copies it from
pepsi-setup, so DANE-validating senders do not depend on CAs for mail to it.
What remains is that a CA misissuance or a locally trusted interception root
allows interception of any hop protected only by PKIX, which includes WKD and
every MTA-STS domain without DANE. Operators should run Pepsi on a host without
interception roots, keep DANE = strict (The network adversary), and may
restrict a smarthost hop to its own CA with TLS_CA_BUNDLE and the key-discovery
fetches to a PEM bundle of anchors with [pepsi-keydiscovery]
TLS_CA_BUNDLE. A Pepsi-specific trust store that ignores locally added roots
would close the interception-root half at the cost of breaking sites that
relay through a TLS-inspecting proxy on purpose. The CA problem itself is a
property of the Web PKI (CA compromise, coercion and mis-issuance of certificates).
96.3.5.10. Large DNSSEC and TLSA responses fragment and are dropped¶
DNSSEC signatures make responses large (840 bytes on average in SURFnet’s
traces), and with EDNS0 they travel over UDP, where about 36 % were fragmented
at an MTU of 1232 bytes. Many firewalls drop IP fragments, and many resolvers
then fail to fall back correctly (retrying without EDNS0, advertising buffer
sizes that they cannot receive, or not retrying over TCP). Van den Broek et al.
estimate that about 10 % of resolvers suffer fragmentation failures, which make
signed zones unresolvable for their clients, in reported cases even the root
[broek2014]. They recommend that authoritative servers cap EDNS0
responses at 1232 bytes so that larger answers are truncated and retried over
TCP. For DANE, Zhu et al. found 33 % of TLSA responses above 1,500 bytes,
because of several records per name, exact-match records holding whole
certificates, and extra DNSSEC data; such responses may be dropped, force TCP
fallback, or open fragmentation-based poisoning [zhu2015].
The effect is a denial of service caused by DNSSEC deployment itself: a DANE-validating sender cannot obtain the records and must defer, and operators are tempted to tolerate validation failures.
Pepsi: Partly addressed. Impact: low.
Pepsi’s own DNS client in pepsi_common::dns (used for TLSA, MX security,
TLSRPT and DANE key-discovery lookups) advertises an EDNS UDP payload of 1232
bytes and repeats a truncated query over TCP; to a resolver reached over DNS
over TLS or HTTPS it never uses UDP at all. The records that pepsi-setup asks an operator to
publish are compact: one TLSA 3 1 1 (a SHA-256 of the key) per port, not a
full certificate. A TLSA or MX-security lookup that fails defers delivery
under DANE = strict and proceeds without DANE under warn
(host_tls_plan in pepsi-stage-relay-to-internet/src/delivery.rs), which
is RFC 7672’s rule for the strict case.
What remains is outside Pepsi’s code. The hardened profile in
The network adversary puts a validating resolver on loopback. If the recursive
resolver that Pepsi relies on sits behind a firewall that drops fragments, and
the resolver fails to retry over TCP, signed answers come back as errors, and
with DANE = strict mail to DANE domains is deferred. The operator should make sure the resolver can
receive large answers (UDP buffer 1232, TCP to upstream allowed). The
pepsi-setup outside checks re-ask public resolvers and report their
extended DNS errors, which helps to diagnose this.
96.3.5.11. Malicious packages under confusing names (typosquatting, dependency confusion)¶
Ladisa et al. organised 107 attack vectors on open-source supply chains, linked to 94 real incidents, into one attack tree whose goal is to get malicious code into an artefact that downstream users build or run [ladisa2023]. The most frequent vector in the incidents is the simplest: publish a new package under a name that is confused with a popular one (typosquatting, combosquatting, brandjacking), or under the name of an organisation’s internal package on a public registry that the build resolves first (dependency confusion). The code then runs at install or build time, or only under certain conditions, in the environment of everyone who picks the package up; the attacker needs only a registry account. Safeguards are on the consumer side: careful selection and pinning of dependencies, vetted internal mirrors, scoped names, and sandboxed builds.
Pepsi: Partly addressed. Impact: low.
Pepsi’s Cargo.lock lists about 640 crates, about 560 of them from crates.io.
Dependency confusion has no foothold: the workspace’s own crates are path
dependencies (publish = false), and cargo deny check (one of the
project’s required gates) denies any registry other than crates.io and any
unknown git source ([sources] in deny.toml), wildcard version
requirements, and crates with known advisories. Every build uses --locked,
so Cargo.lock and its checksums fix exactly which package versions are
built, and a typosquatted crate can enter only when a developer adds or updates
a dependency and does not notice the name. The three dependencies that the
project patches are vendored in the tree (vendor/mail-auth,
vendor/hickory-net, the vendor/taler-rust submodule).
cargo vet --locked (supply-chain/, a gate of make check and of
CI) is the review record: a crate name or version that no audit and no
exemption covers fails the gate, so a confusable name entering with a
dependency change is a recorded decision rather than an unnoticed one. CI
builds inside a podman container (contrib/ci/), but developers’ local
builds run build scripts and procedural macros unsandboxed, and cargo-deny
only catches a malicious crate once an advisory exists. A malicious crate
without an advisory is therefore caught only by the review that cargo vet
forces. That review is a practice, not code still to be written; nothing
further is left for Pepsi’s code, and what remains is the registry’s
(crates.io’s handling of confusable names) and the open problem of trusting an
unread dependency at all.
96.3.5.12. Subversion of legitimate packages in source, build or distribution¶
The second branch of the supply-chain attack tree injects code into a package that users already trust [ladisa2023]. In the source, the code enters through hypocrite merge requests, code hidden with homoglyphs or bidirectional control characters, a maintainer who is socially engineered, replaced or impersonated with reused credentials, or a compromised version-control system; during the build, through compromised build servers, maintainer workstations or shared build resources; during distribution, through taken-over registry accounts, compromised registries or mirrors, re-registered names or URLs of abandoned projects, and man-in-the-middle or DNS attacks on downloads. Every downstream user then runs the attacker’s code, and build-time injection is particularly hard to detect for compiled languages. The safeguards are spread over all stakeholders: multi-factor authentication for maintainers and registries, protected branches and review, ephemeral isolated builds, signed artefacts, reproducible builds, bills of materials and composition analysis; the developers surveyed mostly did not know whether they were protected.
Pepsi: Partly addressed. Impact: medium.
A malicious release of any of the roughly 560 crates.io crates in Pepsi’s
Cargo.lock reaches Pepsi when the lock file is next updated; Cargo.lock checksums protect
against a tampered download or mirror, not against a malicious version
published by a legitimate (or hijacked) maintainer, and cargo deny
advisories react only after discovery. Which processes the code runs in
depends on the crate: a general-purpose crate such as an async runtime or
serialisation library is linked into the setuid helpers,
pepsi-stage-encrypt and pepsi-stage-decrypt (which hold the
key-encryption key) and the root-run pepsi-setup. The privilege separation
described in The privilege split and A compromised component bounds a
compromise of one process, not of a crate that every process links; the threat
model states this as its own adversary (A compromised dependency).
Against the update that carries the malicious version, cargo vet --locked
is a gate of make check and of CI: every third-party crate version must be
covered by an audit or by an exemption, so an update enters only through a
certified diff review or a deliberate exemption. An audit is either the
project’s own or one imported from the public sets of Mozilla, Google, the
Bytecode Alliance, ISRG, Zcash, Embark Studios, Fermyon and Ariel OS, which are
pinned in supply-chain/imports.lock. The crates nobody has read are exempted, not audited
(the threat model gives the count), which is where the residue lies: an
exemption records that the version was accepted unread. Against subversion of
the project’s own build and distribution, releases are signed (tarballs with
the release manager’s OpenPGP key, Debian packages with the taler-systems
release key), and the release build is reproducible (paths remapped,
toolchain pinned, SOURCE_DATE_EPOCH the commit date, the tarball
deterministic). A CI job builds it twice and compares, so a published binary
can be checked against the source (The supply chain).
Removing the residue is not possible for any project of this size. What
remains for Pepsi’s developers is the open work the roadmap records: reading
the exempted crates and replacing their exemptions with cargo vet certify
audits, and keeping the dependency count down; crates.io’s own controls
(two-factor authentication, trusted publishing) are the library maintainers’ to
use.
96.3.6. Resource exhaustion and abuse¶
Exhaustion, amplification and the abuse of a service to attack others.
96.3.6.1. Open relays launder spam and forged mail¶
Early SMTP servers accepted mail from any client for any destination, and the
identities a client gives in HELO and MAIL FROM are freely forgeable, so
they cannot authorise relaying. Spammers used such open relays to hide their
origin and multiply their capacity; RFC 2505 told MTAs to authorise relaying only
by recipient domain or by the client’s address or verified name, never by
HELO or MAIL FROM, to strip every form of source routing (@a,@b:u@c,
the % hack, UUCP ! paths) before testing a recipient, and to record the
client in Received lines [rfc2505]. RFC 5068 completed this for submission:
authenticated submission on port 587, authorisation of every authenticated
identity, traceability, and never relaying unauthenticated mail to other domains
on any port [rfc5068]. NIST’s 2002 guideline still found that most servers’
defaults did not require authenticated relay [tracy2002]. At Langley Air Force
Base in 1997, insecurely configured sendmail relays carried pornography, hate
mail and a forged message apparently from the US President, unnoticed because
logging had been minimised [bass1998]. A sinkhole relay run in 2007 was found
by spammers’ relay tests quickly and then carried about a million spam messages
a day from 150 countries; 75 % of the sources were already blocklisted, so the
relay laundered them through a clean address [pathak2008].
The gain is the relay’s capacity and reputation, and an untraceable origin for spam and forged mail; the relay’s owner is blocklisted and blamed.
Pepsi: Addressed. Impact: none.
pepsi-ingress accepts a recipient outside the served domains only from an
authenticated session and otherwise answers 550 5.7.1 Relaying denied
(pepsi-ingress/src/smtp/session.rs). A session is authenticated by SASL
AUTH, a TLS client certificate, SO_PEERCRED on the local socket, or a
MYNETWORKS address. An SRS
address outside the served domains is relayed only when its HMAC verifies.
Source routes are stripped as RFC 5321 requires (strip_source_route in
pepsi-ingress/src/smtp/command.rs) and the recipient is judged by its final
domain; a % in a local part is not interpreted as a route by any stage, so
user%elsewhere@served.example is an unknown local user, not a relay. The
submission listener requires TLS and authentication, an authenticated user may
use only the envelope senders that USERNAME_MAP permits, and the Received
field records ESMTPA; the client address is recorded in the ingress journal,
and in the Received field too unless the listener’s RECEIVED_PRIVACY
(on by default for submission) leaves it out (pepsi-ingress).
The wizard never trusts loopback unless asked (TRUST_LOOPBACK, default no),
and the local socket identifies each caller by uid instead. A MYNETWORKS
entry outside loopback authenticates its hosts only for the senders that
SENDER_MAP binds to it, and ingress and pepsi-setup validate refuse an
entry that no network key of the map covers, so a too-wide range is not a blanket
relay grant. The remaining exposure is an operator who binds a wide range with
<network> * on purpose, or a compromised local account, which can send as
itself within the per-uid limits in Availability.
96.3.6.2. Mail bombing and mailbox flooding (incl. chain bombs)¶
Mail bombing floods a victim’s mailbox or server with volume. Bass et al.
described the techniques that hit Langley Air Force Base in 1997. Chain bombs
exploit sendmail’s processing of RFC 821 source routes
(@MTA1,@MTA2:user@host) to make one queue of bombs flood every MTA along a
route in turn, so that operators had to purge queues by hand and blocking the
apparent source only blocked legitimate relays. The other techniques were
error-message bombs through innocent MTAs, subscription bombing via list servers
without authentication, and freely available tools to automate all of these
[bass1998]. NIST’s guidance lists the same threats: direct floods, subscribing
the victim to many lists, provoking many replies to the victim’s address, and a
single server as a single point of failure [nist2019]. Langley’s remedy was a
queue-only MTA with a rules-based filter that silently jailed matches; repeated
identical sender/recipient pairs proved the most stable signature, and a control
chart of jailed mail gave early warning [bass1998]. NIST recommends filtering
repeated identical messages, size limits, anti-spam techniques and distributed
servers [nist2019].
Pepsi: Partly addressed. Impact: medium.
Chain bombs do not work: pepsi-ingress strips source routes and routes on
the final domain, as RFC 5321 requires, and does not relay for unauthenticated
clients (Open relays launder spam and forged mail). Pepsi is also hard to use as an amplifier
against someone else: bounces to senders that did not authenticate are dropped
(BOUNCE_UNAUTHENTICATED = drop), unknown recipients are refused at RCPT
rather than bounced (VERIFY_RECIPIENTS), automatic replies follow RFC 3834
and per-correspondent windows (and, with the per-stage
REQUIRE_AUTHENTICATED, off by default, go only to a sender whose SPF or
DMARC passed), list subscriptions need confirmation, each
web form sends at most two mails an hour to any one address, and one
submission account may address at most USER_RECIPIENTS_PER_HOUR (500)
recipients an hour across all its sessions, so a stolen password is a weak
bombing tool (Availability,
Mailing lists). A list’s confirmation request by e-mail does go to the
address that is to be subscribed; whether repeated requests to many lists are
rate-limited per target beyond the per-list autoresponse_grace_period was
not verified.
As a victim, Pepsi bounds what a flood costs the host through per-address connection and session limits, the 25 MiB size limit, the queue and disk admission ceilings, and fair scheduling that queues a sender’s burst behind itself. A mailbox quota (pepsi-quota) caps what lands in one mailbox. Nothing stops a flood of individually acceptable messages to one mailbox from many sources: there is no filter for repeated identical messages, and the quota, once reached, defers or refuses legitimate mail too. That is the state of the art rather than a Pepsi defect; operators can add a filtering milter, and the whitelist and pay-to-send stages (Supported Features) make flooding a protected mailbox cost the sender.
96.3.6.3. Resource exhaustion of SMTP servers¶
Accepting, queuing and processing a message costs a mail server far more than it costs the sender to submit it, so little bandwidth suffices to saturate a server’s disk, and botnet floods are hard to tell from legitimate surges by signatures or addresses; Still and McCreath found that general DDoS research hardly addresses SMTP and that payment and proof-of-work schemes need Internet-wide deployment [still2011]. Pathak et al. showed how cheap it is for process-per-connection MTAs: a single client holding a few hundred connections made about 20 % of 800 tested servers refuse a second client, because the process cap (100 in Postfix’s default) was exhausted, and mail to invalid recipients (19 to 25 % of a university’s mail) occupies those slots for nothing; they proposed an event-driven front end that validates recipients before committing a process [pathak2007]. Qualys’s audit of OpenSMTPD found that the size limit was enforced on body lines only, so a message made of headers alone could fill the queue partition [qualys2015].
The attacker needs no special position, only the ability to open SMTP connections, and gains a denial of service for legitimate senders or a full disk.
Pepsi: Partly addressed. Impact: low.
pepsi-ingress is asynchronous (one task, not one process, per connection)
and every resource a client can make it spend is bounded
(Availability): MAX_CONNECTIONS with eviction of the most idle
connection of the busiest address range, at most MAX_CONNECTIONS_PER_IP
(16) per range and a per-/32 connection rate, MAX_MESSAGES_PER_SESSION,
MAX_INVALID_RECIPIENTS (10) unknown recipients per session, recipients
checked at RCPT, and MAX_MESSAGE_SIZE counted over everything between
DATA and the final dot, so headers count. Lines are limited to 4 KiB for
commands and 1 MiB for data, the header block to MAX_HEADER_FIELDS fields of
at most MAX_HEADER_FIELD_SIZE each, the tenth unrecognised command closes the
session with 421, and COMMAND_TIMEOUT/DATA_TIMEOUT bound each
read. Behind ingress, [pepsi] MAX_QUEUE_ROWS, MAX_QUEUE_BYTES and
MIN_FREE_SPACE make ingress answer 452 4.3.1 before the database or
disk fills, and a client on a downloaded IP blocklist with ACTION = reject
(pepsi-reputation) is refused at RCPT before any DATA.
What remains is the volumetric case the threat model puts out of scope: a
botnet with many address ranges can occupy all MAX_CONNECTIONS slots, and a
flood that drives the queue to its ceiling makes ingress defer everyone,
legitimate senders included. Both are deferrals, not loss. A connection counts
as idle while it waits for client input, that is, for a command or for the next
bytes of a DATA/BDAT body, and an idle connection is evicted first when
the server is full. A client that trickles a body is therefore evictable too,
and an oversized DATA body is drained for at most another
MAX_MESSAGE_SIZE before the connection is closed with 552. A whole session is bounded by SESSION_TIMEOUT
(30 m by default), which nothing the client sends resets: at its next read past
the deadline the session is closed with 421 4.4.2. There is no minimum
transfer rate, and none is needed: a slot is scarce only at the
ceiling, where a slow client is the first to be evicted, and below it a client
that sends one byte per timeout interval holds a slot that nobody else is
waiting for, until the session deadline. Local connections are capped at half
of MAX_LOCAL_CONNECTIONS per uid. When the local range is full, a newcomer
from a uid with fewer connections evicts an idle connection of the uid that
holds the most, if that connection has sent no command line for five seconds.
Distributed floods
need capacity or filtering in front of the MTA, which no single server can
provide.
96.3.6.4. Synchronised SMTP reflection amplification via timeouts (CoordMail)¶
SMTP lets the client set the pace: the client decides when to send each
command, in particular the end of DATA, and servers wait minutes per command.
Li et al. combined the two into CoordMail: the attacker drives many sessions with
different “middleware” (accept-then-bounce servers, open relays, forwarding
services) to the point just before acceptance, then completes them all at once,
timed so that the bounces or forwarded copies converge on a victim’s MX in one
pulse [li2026]. Reflection latency was stable to below 500 microseconds; they
found 10,079 suitable bounce servers, 584 open relays and 6 forwarding
providers, measured a concentration efficiency of 3,801 with 20 connections
and, in the lab, a 2.5 Gbit/s burst from 1,000 connections. Existing defences
barely help: about 78 % of the reflected bounces pass SPF or DKIM, blocklists
listed 5.3 % of the bounce servers, and only DMARC enforcement would stop about
95 % of the reflected mail.
Remedies are on both sides: middleware should add a random delay before
emitting reflected mail (0 to 30 s cut amplification about 15-fold), reject
undeliverable recipients in the session instead of bouncing later, close open
relays, validate forwarding targets and limit reflected volume; receivers can
enforce DMARC and drop sessions from reflecting servers after RCPT.
Coremail and 22 other operators planned fixes.
Pepsi: Addressed. Impact: low.
As middleware, Pepsi offers little to reflect and reflects it at a moment that
the attacker does not choose. It is not an open relay, it refuses unknown
recipients at RCPT for every domain whose mailboxes it can verify
(VERIFY_RECIPIENTS, pepsi-ingress), and
pepsi-stage-bounce drops a bounce whose original sender did not authenticate
(BOUNCE_UNAUTHENTICATED = drop, pepsi-stage-bounce), so the
attacker cannot name the victim as the bounce target without passing the
victim’s SPF or DKIM. Bounces do not quote a message that arrived encrypted, and
a bounce of a bounce is never sent. Everything that Pepsi reflects is held
before the next stage sees it: a DSN, the copy that an alias or a .forward
resends, and every row of a list’s fan-out. The hold lasts for a time drawn
afresh and uniformly from zero to [pepsi] REFLECTION_HOLD_MAX (30 s by
default, the window that the paper measured as cutting concentration about
fifteen-fold; 0 s disables), so
the pipeline’s latency does not set the moment the reflection leaves
(pepsi_common::reflection, Unknown recipients and backscatter). On the receiving side
of the same attack, pepsi-ingress bounds a whole session by
SESSION_TIMEOUT (30 m), reset by nothing the client sends, so a transaction
cannot be parked just before the end of DATA for as long as the attacker
needs to line the others up. Automatic replies are not held; they are limited
per sender instead.
As a victim, Pepsi’s per-range connection limits do not help against thousands
of independent reflectors. The one receiver-side defence that the paper found
effective is DMARC_ENFORCE; the wizard writes it, but it is off in the
code, so an older configuration must set it (The network adversary). The queue
admission ceilings turn a pulse into deferrals rather than a full disk.
96.3.6.5. Short-lived BGP hijacks to send untraceable spam¶
BGP lets an AS announce address space that it does not own. Ramachandran and Feamster observed spammers announcing large, often unused blocks such as /8s, sending from addresses scattered through them, and withdrawing the route shortly afterwards (“spectrum agility”): about 1 % of the spam at their sinkhole (up to 10 % at times) came from routes that lasted under a day, and only half of those sources were on any of eight blocklists [ramachandran2006]. Vervier et al. confirmed the practice over 18 months, identifying more than 2,000 malicious hijacks of dormant address space (about 20 % of allocated IPv4 space is not announced), with one AS hijacking 793 prefixes; none was covered by a ROA, and hijack detectors that watch owners’ own announcements cannot see hijacks of unannounced space [vervier2015].
The spammer gains fresh, clean, untraceable addresses, defeating IP blocklists, reputation and per-address rate limits; the same capability serves DDoS and interception. Origin validation would have invalidated 92 % of the observed hijacks, and AS0 ROAs for unused space would help [vervier2015].
Pepsi: Partly addressed. Impact: low.
Pepsi’s own spam defences do not rest on the sending address: its gates are
sender authentication, the whitelist, the secretary and pay-to-send
(Supported Features), none of which a fresh address passes. The IP blocklists that
pepsi-reputation iplists update downloads for ingress are a marker
(ACTION = mark, routed on by pepsi-stage-if) unless an operator sets
reject; the shipped Spamhaus DROP list names hijacked and leased netblocks
in particular, but a route that lives for hours is gone before an hourly
download sees it, and every list shares the blind spot that the paper measured.
What else keys on the address are the ingress connection and
authentication-failure limits and the dispatcher’s fair scheduling (by
connecting address, IPv6 by /64), so a sender with a hijacked block counts as
many senders (Availability). A hijack of a legitimate sender’s
prefix would also pass that domain’s SPF, which only DKIM-based checks catch.
Routing security is for network operators; Pepsi cannot detect a hijacked
source.
96.3.6.6. Direct-to-MX bot spam and IP spoofing evade port-25 blocking and reputation¶
Infected hosts that are not meant to be mail servers can connect straight to receiving MX hosts on port 25 and send spam under their access provider’s reputation, with nobody accountable. M3AAWG’s best practice is to offer authenticated submission on ports 465 and 587, block outbound port 25 except from authorised relays, block inbound port 25 to customer hosts, and enforce source-address validation [m3aawg2023]. Qian et al. showed why outbound blocking alone fails: in “triangular spamming” a high-bandwidth host spoofs the source address of a relay bot and the bot only forwards the server’s replies, so it never sends to port 25 itself. 97 % of networks that block outbound SMTP let such replies in, IP reputation is attached to the bot, and the real sender stays hidden; the fixes are blocking inbound traffic from source port 25 and stateful filtering, and receivers can detect it by probing whether the client’s port 25 is blocked [qian2010a].
Pepsi: Partly addressed. Impact: low.
As a provider of mail service, Pepsi follows the recommended model: the
submission listener requires TLS and authentication, the MX listener relays for
nobody unauthenticated (Open relays launder spam and forged mail), and local programs submit
through pepsi-sendmail with SO_PEERCRED identity rather than over
loopback port 25. As a receiver it cannot tell a spoofed TCP source from a real
one and does not try (no client-port probing or fingerprinting); the
consequence is limited because, as under Short-lived BGP hijacks to send untraceable spam, its
spam gates do not rely on the client’s address; only its rate limits, fair
scheduling and the downloaded IP blocklists (a marker by default) do. Port-25
and anti-spoofing filtering belong to access networks.
96.3.6.7. KeyTrap: algorithmic complexity DoS in DNSSEC validation¶
DNSSEC identifies a key in a signature only by zone, algorithm and a 16-bit key tag, which is not unique, and RFC 4035 and RFC 6840 tell a validator to try every matching key and every signature until one validates. Heftrig et al. showed that a zone combining many colliding keys with many invalid signatures makes one response cost a number of verifications that grows with their product (SigJam, LockCram, KeySigTrap; HashTrap does the same with DS digests): up to a 2,000,000-fold increase in CPU instructions, stalling BIND9 for up to 16 hours [heftrig2024]. All tested validating resolvers, libraries and public DNS services were affected; the umbrella CVE is CVE-2023-50387, and the requirement dates back to 1999. A busy validator stops answering everybody, including from its cache, and one request every seven seconds kept it down. The attacker needs only a signed domain and a way to make the victim resolver look it up; the authors name links in e-mail and making a mail server send a bounce. Patches released from February 2024 combine limits on validation failures with limits on key tag collisions; a complete fix would need the standards revised.
Pepsi: Partly addressed. Impact: medium.
Pepsi does no DNSSEC validation itself: its own queries
(pepsi_common::dns) read the AD bit of the configured resolver, and the
resolver that mail-auth uses for SPF, DKIM and DMARC is created with hickory’s
default options, which do not validate. So Pepsi has no KeyTrap code path. It
is, however, an excellent trigger: every inbound message makes ingress look up
the attacker’s SPF, DKIM and DMARC records, and outbound mail and key discovery
look up MX, TLSA and WKD names that the attacker can choose. The hardened profile
asks for a validating resolver on loopback (The network adversary); if that
resolver is unpatched, an attacker with one signed zone and port 25 can take it
down and with it every DNS-dependent step of Pepsi: authentication results
become temperror, and delivery and DANE lookups defer. Mail is deferred, not
lost (Availability).
The remedy is for operators to run a resolver release with the KeyTrap fixes and
keep it updated; the resolver is a dependency of the deployment that Pepsi
neither ships nor inspects beyond the probe of whether it validates (by
pepsi-setup, the DANE workers at start and pepsi-status). pepsi-setup could warn when the configured
resolver reports an unpatched version, but resolvers often hide it.
96.3.6.8. Resolver resource exhaustion (cache flush, CNAME chains, retry bypass)¶
Recursive resolvers put too few bounds on what one query from an attacker who also runs an authoritative zone can make them do. Afek et al.’s CacheFlush answers with a referral of about 2000 name-server names or a long CNAME chain, which the resolver caches in full, so a few thousand queries a second insert millions of records and evict legitimate entries: 95.7 % cache misses for a popular name in their test, and an 88.3 % drop in benign throughput even with a 2 GB cache; along the way they found quadratic CNAME-chain validation (CVE-2023-4408) and cache over-allocation leading to memory exhaustion (CVE-2023-2828) in BIND [afek2024]. Li et al. found that BIND, Unbound and Knot re-entered the “send a new query” state on certain malformed responses before the retry limit was checked, issuing e.g. 100 queries instead of 13 [li2024]. Zhang et al.’s differential fuzzer found seven classes of missing limits in six resolvers, among them self-referencing CNAMEs followed many times, caching of all authority-section records, query loops via forwarded RD=0 queries, long waits after malformed replies, and a TCP retry amplification in Knot [zhang2024b]. Most were fixed by the vendors; the residual mitigations are caps on referral size and chain length.
Pepsi: Partly addressed. Impact: medium.
As under KeyTrap: algorithmic complexity DoS in DNSSEC validation, the vulnerable component is the
recursive resolver that the operator runs, and Pepsi is a convenient trigger:
any remote sender can make ingress resolve names in a zone of its choosing.
Pepsi’s own lookups are bounded, so one message costs a bounded number of
queries. The bounds are SPF’s ten-lookup limit, DNS_TIMEOUT per query and
VERIFY_TIMEOUT over all authentication work, a fixed set of queries for
TLSA/MX security, and key discovery that answers each address once and
remembers failures (Availability). A flood of messages, each naming a fresh attacker
zone, can still drive a vulnerable resolver into the effects above, degrading
Pepsi’s authentication and delivery to deferrals. The in-process hickory caches
are of bounded size. Operators should run current resolver releases with the
vendors’ fixes; Pepsi cannot fix a resolver, and a rate limit on DNS work per
sending address would only shift the problem to many addresses.
96.3.6.9. DNS reflection amplification¶
DNS answers are much larger than the queries that elicit them and travel over UDP, whose source address is not verified, so an open DNS server is an amplifier: an attacker sends small queries with the victim’s address as source, and the server floods the victim with answers. RFC 3833 lists this among the threats to the DNS and notes that DNSSEC makes it worse, because signed responses are larger and validation is more expensive; it also records DNSSEC’s own weaknesses – complexity at zone cuts, hierarchical trust, signatures that depend on absolute time – as open issues [rfc3833]. Mitigations are response rate limiting on authoritative servers, closing open recursive resolvers, and source-address validation in networks.
Pepsi: Not applicable. Impact: none.
Pepsi contains no DNS server: its DNS code (pepsi_common::dns, hickory’s
stub resolver) only sends queries to the resolvers configured in
/etc/resolv.conf or DNS_SERVERS. The validating resolver recommended by
the hardened profile (The network adversary) is the operator’s, installed on
loopback, where it cannot be used as a reflector. Pepsi’s published records
(one TLSA 3 1 1 per port, DKIM, SPF, MTA-STS and TLSRPT TXT records) are
served by the operator’s authoritative DNS, whose rate limiting is the
operator’s concern. The DNSSEC weaknesses in the same RFC are treated under
DNSSEC key compromise cannot be revoked; synchronised expiry of signatures and Keys published in DNS are only as trustworthy as the zone operator.
96.3.6.10. MTA-STS policy poisoning causes denial of mail delivery¶
MTA-STS asks sending MTAs to cache a recipient domain’s policy for up to its
max_age (at most a year) and to keep using the cached copy even when the
_mta-sts TXT record disappears or the policy can no longer be fetched. That
persistence is what protects against downgrade, and it is also the weakness
named in the specification’s own security considerations [rfc8461]. An
attacker who can briefly change the victim domain’s DNS publishes a long-lived
enforce policy whose mx patterns match only a host of the attacker’s
choosing, and obtains a certificate for the policy host. An attacker who
controls the mta-sts.<domain> web host can do the same, for instance on a
platform that hands out user subdomains. Every sender that fetches the policy in that window caches it and
afterwards refuses to deliver to the real MX hosts, long after the victim has
repaired its DNS.
The gain is a long-lasting, selective denial of mail delivery to the victim
domain (not interception, since the senders still require a valid certificate
for the MX they deliver to). The only remedy that the RFC offers is for the victim
to publish a new policy, with a new id and a valid certificate for the
policy host, which senders pick up on their next lookup.
Pepsi: Partly addressed. Impact: low.
As a sender, pepsi-stage-relay-to-internet (mta_sts.rs) stores policies
in the pepsi.mta_sts_policy table, shared by its workers, and caps a
policy’s lifetime at seven days (MTA_STS_MAX_CACHE) whatever max_age it
advertises, so a poisoned policy cannot pin delivery for a year. On every use of
a cached policy the stage re-reads the TXT id; a changed id triggers a
refetch, so the RFC’s remedy (publishing a new policy) takes effect at the next
message rather than at expiry. A message whose MX matches none of an enforced policy’s patterns
is deferred, not delivered elsewhere, and bounced only after MAX_LIFETIME
(pepsi-stage-relay-to-internet).
What remains is inherent in the standard: if the victim merely deletes the TXT
record instead of publishing a new id, the stored poisoned policy is kept
until the seven-day cap (worker recycling and restarts do not drop it) unless
the refresh at half its lifetime fetches a usable policy from the victim’s own
mta-sts host, and mail to that domain is deferred meanwhile; with a
MAX_LIFETIME shorter than the cap some of it bounces. Shortening the cap
would reduce this further at the cost of the downgrade protection that policy
persistence provides (MTA-STS first-contact gap and blocking of policy discovery). As the recipient side, a
Pepsi operator protects their own domains by keeping control of the DNS zone
and of the mta-sts host that pepsi-httpd serves; the threat model notes
that an active attacker can always cause a denial of service
(The network adversary).
96.3.6.11. TLS handshake computational denial of service¶
A TLS server performs a private-key operation (and, with client authentication, certificate verification) for every full handshake, while a client can open connections and abandon them almost for free. The catalogue of TLS attacks [rfc7457] lists this asymmetry as an observed denial-of-service vector by single clients and botnets, without a protocol-level resolution. Client certificate authentication makes it worse: with permissive server settings an attacker can force many expensive RSA verifications per handshake, and handshakes can be held open almost indefinitely with empty fragments or slow renegotiation, tying up server memory [parsovs2014]. The fixes in practice are handshake timeouts, per-source connection limits, disabling client-initiated renegotiation and cheap (ECDSA) server keys; a large enough botnet still exhausts any server.
Pepsi: Partly addressed. Impact: medium.
pepsi-ingress admits a connection before any TLS work through the
per-source-range limits in pepsi-ingress/src/conn.rs: a token bucket on new
connections per IPv4 address or IPv6 /32 (CONN_RATE_PER_SECOND,
CONN_RATE_BURST, default one per second), at most
MAX_CONNECTIONS_PER_IP (16) concurrent connections per range, and a global
MAX_CONNECTIONS (1024) with eviction of the most idle connection of the
greediest range. The handshake itself, both implicit TLS and STARTTLS, is
bounded by TLS_HANDSHAKE_TIMEOUT (default 30 s), separately from the
300 s COMMAND_TIMEOUT that paces commands: a peer that opens a connection
and sends no ClientHello, or trickles one, is disconnected after 30 s.
pepsi-httpd bounds its handshake at 30 s too and
limits concurrent connections per client address (MAX_CONNECTIONS_PER_IP,
IPv6 per /64). rustls supports no renegotiation at all, which removes the
slow-renegotiation and repeated-verification variants, and client certificates
are requested only on listeners that configure TLS_AUTH_CLIENT or
TLS_AUTH_CLIENT_CA.
These limits are listed in Availability.
What remains is the generic case: a distributed attacker with many source
ranges can still keep the CPU busy with handshakes, and senders will defer their
mail meanwhile (mail is delayed, not lost). The threat model declares
volumetric flooding out of scope and expects it to be handled in front of the
MTA. An operator under attack can shorten TLS_HANDSHAKE_TIMEOUT further
(a working client completes a handshake in a few round trips), and an ECDSA
server certificate (the certbot default) keeps the per-handshake cost low.
96.3.7. Information leaks and tracking¶
Unintended disclosure of content, metadata or the reader’s activity.
96.3.7.1. Recipient address harvesting via VRFY/EXPN, RCPT replies and bounces¶
SMTP tells an unauthenticated client, per address and before any message is
accepted, whether a mailbox exists. VRFY and EXPN do so explicitly (and
EXPN reveals list membership), a 550 no such user reply at RCPT TO
does so implicitly, 251/551 replies reveal forwarding targets, and a
non-delivery report saying “user does not exist” does so after the fact. The
SMTP specification and NIST’s mail server guideline both name this as an
information disclosure, together with banners that reveal server software and
version, and recommend disabling VRFY/EXPN (answering 252), hiding
version details and closing sessions after many invalid recipients
[draft-ietf-emailcore-rfc5321bis] [tracy2002].
The oracle is used at scale. Spam botnets relay the receiving server’s per-recipient replies to their command-and-control servers to clean their address lists; Stringhini et al. observed Cutwail, Lethic, Grum and Bagle consuming that feedback and proposed deliberately false “no such user” replies to bots identified by blocklists or SMTP dialect fingerprinting [stringhini2012]. In 15 months of bounces at a large Chinese provider, Li et al. found attackers mailing about 4,000 generated addresses at targeted organisations to discover valid usernames (0.91% guessed correctly), and senders spamming from leaked address lists [li2024b]. The gain is valid addresses for spam and targeted phishing, and the server software for exploit selection.
Pepsi: Partly addressed. Impact: low.
pepsi-ingress answers VRFY with 252 2.1.5 Cannot verify, but will
accept message and EXPN with 502, so mailing-list membership is never
exposed (pepsi-ingress/src/smtp/session.rs). The greeting and HELP name
the software (“Pepsi”) but no version. A Received: field carries a for
clause only when the message has a single recipient, so blind-copy recipients
are not disclosed to each other.
The RCPT oracle is deliberate. With the default VERIFY_RECIPIENTS =
auto, an address at a served domain that nothing on the host vouches for is
refused with 550 5.1.1 instead of being bounced later to a forged sender
(backscatter, Bounces, auto-replies and MDNs reflected at forged return addresses). Dictionary attacks
are slowed, not prevented: after MAX_INVALID_RECIPIENTS (10) unknown
recipients in one session the connection is closed with 421, and new
connections are metered per source range (Availability), so a
botnet with many addresses still enumerates freely. Over-quota refusals at
RCPT (MAILBOX_OVER_QUOTA) additionally reveal that a mailbox exists and
is full, and a RCPT carrying an RFC 7293 RRVS= date is refused with
550 5.7.17 when the login was reassigned after that date, which answers a
question about the mailbox’s history (metered through
MAX_INVALID_RECIPIENTS, as section 13.1 of that RFC asks).
VERIFY_RECIPIENTS = off removes the oracle at RCPT but moves it
to the bounce, which BOUNCE_UNAUTHENTICATED = drop sends only to
authenticated senders, so an attacker who uses their own authenticated domain
still learns the answer. Pepsi does not implement false feedback to suspected
bots; that would trade harvesting resistance for the risk of rejecting
legitimate mail. A public Web Key Directory is a further, documented
existence oracle for addresses that publish a key (Key management).
96.3.7.2. Received and other outgoing headers expose sender IPs, clients and contacts¶
RFC 5321 section 4.4 requires every SMTP server to prepend a Received:
field whose from clause names the client’s host name and IP address. On the
submission hop this writes the user’s current IP address, and so their
approximate location and network, into every message they send; the field
travels to every recipient and into public list archives, and RFC 5321 offers no
sanctioned way to omit it. Josefsson and Nordberg proposed that
privacy-conscious submission servers drop the from clause while keeping the
rest for loop detection [draft-josefsson-email-received-privacy]; the IAB’s
pervasive-surveillance threat model uses the same field as an example of how IP
addresses can be mapped to e-mail identities even when every hop is encrypted
[rfc7624].
Clients and servers add more: Nurse et al. analysed 225 header blocks sent from enterprises and found server host names, IP addresses and MTA software in every one, the employer inferable in 78%, internal network configuration in 37%, the sending device’s IP in 35%, the mail client in 28%, security products in 26%, the device OS in 24% and internal user names in 14%, all available to anyone who gets a single reply [nurse2015]. Beyond headers, content encryption leaves the envelope (who writes to whom, when, how much) visible to the transport and the provider, which only anonymity systems address [unger2015]. Recommended fixes are to omit the submission client’s address, strip non-essential client headers and minimise metadata in general.
Pepsi: Partly addressed. Impact: low.
RECEIVED_PRIVACY is on by default for every SUBMISSION listener and the
local submission socket. On a listener with this option, pepsi-ingress
writes its trace field without a from clause at all, Received: by
<HOSTNAME> (pepsi-ingress) with ESMTPSA ... (received_header in
pepsi-ingress/src/smtp/session.rs, The submitter’s address stays out of the message), as
[draft-josefsson-email-received-privacy] proposes and large providers do, and
removes the client’s User-Agent and X-Mailer fields with it
(strip_client_headers). No recipient or list archive learns the submitting
client’s IP address, reverse name, EHLO name or mail client from a message that
a user sent. Loop detection is unaffected, since MAX_SELF_HOPS counts the
by clause; the ingress journal still records the client for abuse handling,
and the opt-in mail_log records no client addresses. An MX listener keeps
the full from clause by default, which the next hop’s abuse handling
needs, and either default can be turned around per listener.
What still passes through: the client’s own Message-ID (its right-hand
side is usually the submission host or a client-chosen name, not the user’s
machine), the ESMTPSA keyword and TLS parameters (which say that a user
authenticated, not who or from where), and the headers that Pepsi adds to
identify itself, such as Pepsi-Origin and the (pepsi-ingress) comment. None
of these is left for Pepsi to remove. Pepsi-Origin is needed, and the
ESMTPSA keyword is standard trace data that names no one; the comment only
names the software. The Message-ID is the mail client’s choice, and
rewriting it at submission would break the sender’s own threading: the copy in
their Sent folder keeps the original identifier while replies would reference
the new one. Choosing an identifier that reveals nothing is the client vendors’
part. An
anonymous mailing list goes further: pepsi-stage-list-post (cleanse)
removes Received, the X-Originating-* family, every other X-
header and the original Message-ID. Envelope metadata toward the transport
and the provider remains a stated limitation (What Pepsi does not protect; see also
Cleartext metadata, headers and lengths of encrypted mail).
96.3.7.3. NSEC/NSEC3 zone walking enumerates names and key-record addresses¶
DNSSEC proves that a name does not exist by signing the gap between two names that do. With NSEC records these gaps form a chain, and following it lists every name and record type in a zone (“zone walking”), giving spammers probable addresses and scanners the internal topology [yang2010]. NSEC3 hashes the names, but the hashes are open to offline dictionary attacks: enumerating all top-level zones in 2017, Wander recovered 79% of the names behind NSEC3 hashes with GPU cracking and found that the hash iteration count made no significant difference [wander2017]. Only online signing with minimally covering (“white lies”) denial records prevents enumeration.
This matters for e-mail because the per-address key records live in DNS.
OPENPGPKEY and SMIMEA records are published under the SHA2-256 hash of
the local part, and both RFCs state that this hash is not a security feature:
the domain is not hashed, so one precomputed table of common local parts serves
every domain, and in an NSEC-signed zone a walk yields all key owner names for
matching against it [rfc7929] [rfc8162]. The result is a list of valid
addresses (with keys) for spam or phishing; NSEC3 makes this harder but does not
prevent it.
Pepsi: Partly addressed. Impact: low.
Pepsi does not run the DNS zone, but it generates these records:
pepsi-keys dns and pepsi-setup run print OPENPGPKEY and SMIMEA
records for every published, active identity, and tell the operator to publish
them only in a DNSSEC-signed zone, which is what makes walking possible. Only
identities with the published flag are printed, so an address appears only
if its owner or the operator chose to publish its key. The other records Pepsi
asks for (MX, DKIM selectors, _mta-sts, _smtp._tls, TLSA,
openpgpkey.<domain>) reveal nothing secret.
The residue is inherited from the standards and from the operator’s zone
configuration: in an NSEC-signed zone every published key address is
enumerable, and in an NSEC3 zone common local parts are recoverable. The
manual and pepsi-keys/src/dns.rs do not claim that the hashed owner name
hides the addresses that a zone serves: Key management explains NSEC walking,
the NSEC3 dictionary attack and that only online signing with minimally covering
records (“white lies”) resists enumeration, so a published key record discloses
that its address exists. The printed records carry the same advice as a
comment (keystore::ZONE_WALKING_NOTE): under NSEC every published address
can be listed, NSEC3 hashes fall to a dictionary, online signing with minimal
covering records (RFC 4470/7129) resists the walk, and an address list that must
stay private is published by WKD only, which answers guesses but cannot be
listed. Pepsi does not check the zone’s signing mode: the zone, and the choice,
are the operator’s.
96.3.7.4. Client certificates sent in cleartext in TLS 1.2 handshakes¶
Up to TLS 1.2, a client certificate is sent unencrypted during the handshake. Personal certificates name their holder, so a passive observer identifies and tracks the user; RFC 8314 notes this for mail submission and access [rfc8314], and Parsovs showed it for Estonian national ID cards, whose certificates carry the holder’s name and personal identity code and which browsers send without warning [parsovs2014]. The same paper found that the trust checks run before the client proves possession of the key, so differing alerts let anyone enumerate the server’s trusted CAs and verification settings. The fixes are TLS 1.3, which encrypts the client certificate, or requesting the certificate only in an encrypted renegotiation, and presenting a certificate only when the user has authorised it for that server.
Pepsi: Addressed. Impact: low.
pepsi-ingress requests a client certificate only on listeners that set
TLS_AUTH_CLIENT or TLS_AUTH_CLIENT_CA, and there only from a client
whose ClientHello lists TLS 1.3 in its supported_versions extension: the
acceptor reads the ClientHello first (MailAcceptor in
pepsi-ingress/src/smtp/mod.rs) and
answers such a client from a TLS-1.3-only configuration that requests the
certificate, where it travels encrypted. A TLS 1.2 client is served from a
configuration that requests none, so it completes the handshake without
disclosing a certificate and can authenticate with SASL instead; the event is
logged, so an operator whose device stops authenticating sees why. The
verifier accepts any well-formed certificate during the handshake and decides
authorisation afterwards, and it names the configured CAs as hints, so a
client holding several certificates presents the right one; that tells a
connecting party which CAs the listener trusts, which is a fact about the
server’s configuration, not about any user, and the pinned keys are not
revealed. On the client side, pepsi-stage-relay-to-smarthost and
pepsi-stage-relay-to-lmtp present a TLS_CLIENT_CERT; that is a machine
certificate of the Pepsi host, whose disclosure reveals no user.
What remains is an explicit opt-out: a listener with TLS_AUTH_CLIENT_TLS12 =
yes requests the certificate under TLS 1.2 as well, for devices that speak
nothing newer, and their certificates then cross the network in the clear.
96.3.7.5. Encrypted backups leak via size, deduplication, compression and indexes¶
Fabrega et al. introduced injection attacks on end-to-end encrypted applications: the attacker sends the target chosen messages, which become part of the target’s application state, and then observes the size of the target’s encrypted backups, which they can read (for example through a compromised cloud storage account) but not decrypt [fabrega2024]. Four leaks were shown. WhatsApp stores each unique attachment once, so a backup that grows by less than an injected file’s size shows that the target already had it (about log16(n) backups decide which of n candidate files). WhatsApp compresses its message database before encryption, so an injected string that repeats an honest message compresses better, giving a binary-search dictionary attack on received text. Its SQLite full-text index changes size depending on which terms were received. And Signal’s per-row frames with plaintext length headers revealed the number of contacts, conversations and messages. The proposed fixes are no deduplication across senders, no compression of mixed attacker and victim data, rebuilding indexes on restore instead of backing them up, and hiding frame boundaries (adopted by Signal).
Pepsi: Addressed. Impact: none.
Pepsi produces no encrypted backup of a mailbox or database that combines
attacker-injected and honest content under one encryption. Where it stores
ciphertext, each message is sealed on its own: pepsi-stage-reencrypt seals
each delivered message separately to the recipient’s client key, the
secure-link portal stores one AEAD ciphertext per message in
pepsi.secure_message, and Pepsi’s own encryption path does not compress
before encrypting (pepsi-crypto only decompresses what senders compressed).
The shared workqueue_body deduplicates bodies between sibling rows of one
message inside the database, which is not observable from outside and is
plaintext to a database reader anyway. The mailing-list archive and its search
indexes are plaintext by design (Archives).
An observer of stored ciphertext still sees the number, sizes and arrival times
of individual encrypted messages (Maildir file names even carry ,S=<size>).
That is the metadata that every encrypted mailbox exposes, and it is covered by
Cleartext metadata, headers and lengths of encrypted mail. Backups of the PostgreSQL database
(pepsi-setup schema --backup-dir, of which the newest two are kept by
default) are compressed but not encrypted by Pepsi;
their protection is the operator’s, and their content is plaintext to their
reader in any case (Somebody holding a copy of the database).
96.3.8. Misleading display and user decisions¶
Indicators and displays that mislead, and decisions a user cannot be expected to get right.
96.3.8.1. Recipient cannot see whether a message travelled over TLS¶
Encryption between MTAs is opportunistic: STARTTLS may be missing or
stripped by an attacker, and the message then travels in the clear. The sender
cannot see this unless they test the next hop beforehand, and the recipient has
no indication at all; the Received: field is unstandardised, often omits TLS
details, and can be altered in transit. Petrlic and Stiegler cite Google’s
figure of about 10% of mail reaching Gmail unencrypted, and a study in which only
1% of about 4,000 German health institutions’ servers met the data protection
authorities’ requirements (TLS 1.2+ and DANE) for high-risk mail. For a
recipient who may have to show under the GDPR that sensitive data reached them
adequately protected, this is a compliance gap as well as a security one. Their
prototype lets the sender choose a confidentiality level, has each
participating MTA test the next hop and record the result in DKIM-signed
transparency headers, and shows the recipient a per-hop traffic light in an
Outlook add-in [petrlic2023]. It covers only participating MTA-to-MTA hops,
and an attacker on a compromised MTA still reads the mail unnoticed.
Pepsi: Partly addressed. Impact: low.
pepsi-ingress records the negotiated TLS version and cipher of the hop that
delivered the message to it in its Received: field (tls_comment,
following RFC 8314 section 4.3), and the ARC stage seals the header block
that contains it, so the recipient’s mail system can see and, with ARC, trust
how the last hop into Pepsi was protected. Outbound, the relay stages record
every TLS session outcome for TLS reporting (pepsi.tls_session), which the
operator sees but the sender does not. The sender can make transport protection
mandatory for peers that publish MTA-STS enforce or (with DANE =
strict) DANE records (The network adversary), and can make it irrelevant with
end-to-end encryption, which pepsi-stage-encrypt and the secure-link portal
provide.
A sender can require validated TLS for the whole path of one message with
REQUIRETLS (RFC 8689, both halves implemented; see
REQUIRETLS residual weaknesses and TLS-Required override for its own limits), which bounces the message
rather than let a hop go in the clear. What is missing is the rest: there is no
way to learn afterwards that a hop was in the clear, and no transport indicator
reaches the recipient’s client, since mail clients do not display
Received: fields. Pepsi’s own client extensions (the Outlook add-in’s read
pane and the Thunderbird MailExtension) show the gateway’s verdict outside the
message area, but they read only X-Pepsi-Crypto and X-Pepsi-Warning,
not how the message travelled. Nothing further is left for Pepsi’s code: Pepsi
sees only the hop into it, so an indicator built from that would claim more
than it knows. Reporting the protection of every hop to the recipient needs a
standard, and showing it needs the clients.
96.4. Sender authenticity and mail flow¶
SPF, DKIM, DMARC, ARC and BIMI, and the paths that re-send mail: forwarding, mailing lists, auto-replies and bounces, as well as spam and phishing filtering.
96.4.1. Implementation defects¶
Memory safety, injection, parser differentials and logic errors in a particular implementation.
96.4.1.1. HELO/MAIL FROM confusion between SPF checker and DMARC module¶
SPF may evaluate two identities, the HELO name and the MAIL FROM domain,
while DMARC aligns only the MAIL FROM domain with the From: header, using
HELO only when the reverse-path is empty. When the SPF checker and the DMARC
module are separate components that disagree about which identity was checked, an
SPF pass for one identity is credited to the other. Chen, Paxson and Jiang showed
two variants in 2020 [chen2020]. In the first, the attacker uses a MAIL FROM
in a non-existent subdomain of the impersonated domain, which has no SPF record.
The SPF component then falls back to the attacker’s own HELO and reports
“pass”, while the DMARC module still aligns the impersonated MAIL FROM domain.
In the second, the attacker writes a MAIL FROM that one component parses as
empty (an unbalanced comment) and the other as an address. Either way any sender
passes SPF-based DMARC for an arbitrary domain. Tutanota was vulnerable to the
second variant, and the first was recorded as CVE-2019-20790 for the combination
of pypolicyd-spf 2.0.2 and OpenDMARC through 1.3.2/1.4.x [cve-2019-20790].
Upstream at first disputed it as working as designed; Debian fixed its opendmarc
package. The rule is that the DMARC evaluator may use only an SPF result for the
identity that it aligns.
Pepsi: Addressed. Impact: none.
SPF, DKIM and DMARC run in one process, in Authenticator::checks
(pepsi-common/src/auth.rs), on top of the mail-auth library, and the results
are passed between them as typed values, not as text. SPF is called through
SpfParameters::verify_mail_from, which checks the MAIL FROM domain only. The
library’s other entry point, which first checks HELO and returns that result
when it fails, is not used. The domain handed to DMARC is computed from the same
MAIL FROM string by the same rule (the part after the last @). When the
reverse-path is null, both take the HELO name, which is what RFC 7208 section
2.4 and RFC 7489 section 3.1 prescribe. There is one MAIL FROM string and one
way of reading it, so in the second variant the components have nothing to
disagree about either:
ingress extracts the path between the angle brackets, strips any source route and
refuses control characters (pepsi-ingress/src/smtp/command.rs), and every
consumer then works from that stored string. An operator who adds an external
SPF or DMARC checker through pepsi-stage-milter takes on that
component’s behaviour. Pepsi does not combine results from such a filter with its
own.
96.4.1.2. Multiple or duplicate From headers evade DMARC and DKIM checks¶
DMARC is defined for a message with exactly one author domain, but RFC 5322 allows
a From: field to list several mailboxes, and real messages also arrive with
two From: fields, a From with odd whitespace around the field name, or
none at all. Components then pick different “senders”. Chen et al. found that 19
of 29 implementations accepted two From: fields, and that servers ran DMARC on
the first while some clients (iCloud web, Windows Mail) displayed the last.
Clients also displayed Sender: or Resent-From: when From: was missing,
and combinations of these tricks bypassed even Gmail’s checks [chen2020].
OpenDMARC through 1.3.2 and 1.4.0-Beta1 evaluated a multi-mailbox From: so
that the checked domain could differ from the displayed one (CVE-2019-16378, fixed
upstream and in DSA-4526) [cve-2019-16378]. Measurements of 47 providers found
Privatemail, Hushmail, Seznam and Fastmail showing the second, unauthenticated
address of a double-From: message that had passed DMARC on the first
[blechschmidt2023]. A From: listing the attacker’s own domain beside the
victim’s produced a DMARC “pass” at Gmail, Proton Mail and, in some scenarios,
iCloud and Yahoo, while the spoofed address was displayed and Gmail’s “via” note
disappeared [chauhan2022].
DKIM adds a variant of its own. The verifier hashes, for each name in h=, the
lowest unused instance, and nothing requires it to check that a singleton field
occurs once. An attacker holding any validly signed message can therefore prepend a
second From:. The signature still verifies over the original field, while many
clients display the new one. The DKIM working group left this to the optional
practice of “over-signing”, which Otis and Rand argued leaves receivers exposed
[otis2008] (see Headers added to DKIM-signed mail when not oversigned). DMARCbis now says plainly
that a message with several author domains is outside DMARC. Receivers should
reject it, or apply DMARC to every author domain and take the strictest result, with
a cap on the number of domains, because evaluating every one of them invites denial
of service [rfc9989].
Pepsi: Partly addressed. Impact: low.
Two From: fields are refused: pepsi-ingress counts the fields after the
message is received and answers 550 5.6.0 when there is more than one
(pepsi-ingress/src/smtp/session.rs). The count is case-insensitive and ignores
whitespace before the colon, so From : counts as well. This also stops Otis’s
replay with a prepended From: at Pepsi’s own border. Pepsi’s own DKIM
signatures list every field of their default header list, From and Subject
included, twice in h= (SIGNED_HEADERS in pepsi-common/src/sign.rs), so
a field added later breaks them at any verifier. Inside Pepsi, every decision
reads a From: the way a mail client does
(Ambiguous From headers checked as one address and displayed as another). The DKIM alignment recorded in
state.auth.dkim, the check of the submission identity and the signer binding
take the first mailbox. On submission, USERNAME_MAP checks every mailbox of a
multi-mailbox From: (submitted_from_addrs in
pepsi-ingress/src/submission.rs), and refuses (550 5.6.0) a From: that
is missing, a pure group, or names a mailbox it cannot read strictly as an RFC
5322 mailbox-list. pepsi-stage-check-whitelist matches nothing for
a From: naming more than one mailbox. See A remote sender.
Both inbound gaps are closed under DMARC_ENFORCE. mail-auth exempts from
DMARC a single From: that names mailboxes at several domains (it returns no
policy). pepsi_common::auth therefore evaluates DMARC once per author domain,
for at most ten domains, each time on a copy of the message whose From: holds
only that domain’s mailboxes. The message passes only if every domain passes; a
failing p=reject (or quarantine) domain rejects it with 550 5.7.1, and
Authentication-Results carries one dmarc= result per domain. An
unauthenticated message with no From: address, or naming more than ten
domains, is refused (550 5.6.0 and 550 5.7.1). What remains is a
configuration with DMARC_ENFORCE off (the compiled-in default; the wizard
writes yes): such a message is then delivered with its results recorded, which
RFC 9989 asks receivers not to do. A From: naming several domains is still
marked X-Pepsi-Warning: from-ambiguous with the [external] subject tag,
whatever its verdicts (Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment)). mail-auth’s
header parser ignores whitespace inside a field name (classify_folded_name in
vendor/mail-auth/src/common/headers.rs), so it reads From : as a From:
field just as the ingress counter does.
96.4.1.3. Injected or forged Authentication-Results fields trusted downstream¶
Authentication-Results is an ordinary unsigned header field, identified only
by an authserv-id token, and it is how a border MTA tells downstream agents and
mail clients what SPF, DKIM and DMARC concluded. It fails in two ways. First, a
sender can write the field itself and name the receiver’s authserv-id. RFC 8601
therefore requires the border MTA to delete any incoming instance that claims its
own authserv-id, and it tells clients to trust only a configured list of
identifiers and to ignore instances inside attachments. A border MTA that does not
delete them, an outdated list of trusted hosts, or a compromised internal host lets
a forged “pass” reach the user [rfc8601]. Second, components inside one server
may pass their results to each other in this text syntax, where parentheses start
comments and quotes delimit strings. Chen et al. used a DKIM d= value or a
MAIL FROM domain that embeds such a character. The SPF or DKIM module verifies
the full name, which resolves under the attacker’s zone, but the DMARC module stops
at the metacharacter and aligns the impersonated domain in front of it. The attack
worked at iCloud, Naver, Zoho, Tutanota and ProtonMail [chen2020]. In OpenDMARC
through 1.3.2/1.4.x this is CVE-2020-12272, with the example
example.net(.example.com; it was fixed upstream in commit f3a9a9d4 and in
Debian [cve-2020-12272]. The remedies are to pass results in structured form, to
reject domain names outside hostname syntax, and to strip claimed results at the
border.
Pepsi: Addressed. Impact: none.
Both halves are handled. Authenticator::verify deletes every incoming
Authentication-Results field whose authserv-id equals ingress’s
HOSTNAME (strip_claimed_ar in pepsi-common/src/auth.rs). It does so
case-insensitively, for the quoted form, and with a version token present. It then
prepends its own field, so on arrival the topmost field is the genuine one. No
later Pepsi stage adds an Authentication-Results field, but a filter that
pepsi-stage-milter consults may insert or change one. Fields
naming another authserv-id are kept, as RFC 8601 section 5 requires. Apart
from this stripping, no Pepsi component reads an Authentication-Results
field to make a decision; what an external milter does with the field is up to
that filter. The SPF, DKIM and DMARC results pass between the checks as mail-auth
types and are stored as tokens in state.auth, which every later stage reads. The
ARC stage copies the rendered text into its ARC-Authentication-Results field
but does not parse it. mail-auth writes the values it puts in the field as
quoted strings where necessary. A domain containing a parenthesis or quote cannot
pass anyway: the DNS layer (hickory) refuses such a label, so the lookup fails
instead of reaching an attacker’s zone. Pepsi’s own verdict header for message
cryptography, X-Pepsi-Crypto, is protected the same way: the whole
X-Pepsi-* namespace is stripped from inbound mail (Security model, “Header
forgery”).
What Pepsi cannot control is the recipient’s client. A client that trusts any
Authentication-Results field regardless of its authserv-id, or one inside
a forwarded message/rfc822 part, can still be fooled by fields that Pepsi
correctly leaves alone. Also, a site running several Pepsi ingress hosts with
different HOSTNAME values strips only each host’s own identifier, so a field
forged in the name of one host survives a message entering through another.
96.4.1.4. NUL byte in DKIM selector/domain interpreted differently by DNS¶
A DKIM verifier builds the key query name <s>._domainkey.<d> from the
signature’s selector and domain. Chen et al. found that Gmail’s DKIM module and its
DNS resolver read a NUL byte in the selector differently. The DKIM module believed
the query was under the signing domain d=. The resolver treated NUL as the end
of the string and fetched the key from a name the attacker controlled. The
attacker could thus sign a forged message with their own key and have it verify as
signed by the impersonated domain, pass DMARC and show Gmail’s “signed by”
indicator. Google fixed it immediately after the report. The general rule is to
reject selectors and domains with NUL or other characters outside the DKIM syntax
before building a query [chen2020].
Pepsi: Addressed. Impact: none.
Pepsi’s verifier is the Rust mail-auth library on the hickory resolver. Neither
uses NUL-terminated strings, so a NUL byte is an ordinary character of the query
name and cannot end it early. Hickory’s name parser also refuses control
characters in a label (Name::from_str_relaxed, Label::from_ascii). A
selector or domain containing NUL therefore produces a DNS error, recorded as a
DKIM temperror, never a lookup under another name. DMARC alignment and Pepsi’s own
dkim_aligned compare the same d= string that was looked up.
mail-auth does not check s= and d= against the DKIM grammar itself.
The resolver accepts master-file escapes such as \., which make a dot part of
a label. In principle, then, the string compared for alignment and the name sent
to DNS can still differ. An escaped dot, however, only glues labels in front of
the unescaped suffix together. The registrable suffix that decides alignment is
never moved, and the resulting name (a label containing a dot) is one that nobody
can register. We see no way to exploit this. Validating s= and d= against
the grammar of RFC 6376 section 3.5 would remove the difference entirely.
96.4.1.5. Memory corruption in SPF and DMARC libraries (libspf2, OpenDMARC)¶
Sender authentication makes a receiving server parse data that its sender
controls: the SPF record of the MAIL FROM domain, its macros and exp=
explanation, and, for DMARC, the aggregate reports mailed in. The C libraries that
did this were a steady source of memory corruption. In libspf2, the URL-encoding
step of macro expansion formatted a sign-extended byte into a four-byte buffer,
and the label-reversal path allocated from an overwritten length. The result was
heap overflows of up to about 100 attacker-chosen bytes (CVE-2021-33912 and
CVE-2021-33913, CVSS 9.8) [bennett2022] [cve-2021-33912]. A stack overflow in
the expansion of a long explanation string was fixed in 1.2.11 (CVE-2021-20314)
[cve-2021-20314] [jeitner2021]. An integer underflow in macro parsing was
reported against Exim builds that use libspf2 (CVE-2023-42118, ZDI-23-1472). No
fixed version is named, and Exim’s advice was not to use the spf condition
[cve-2023-42118] [exim2023]. Jeitner and Shulman also showed that policyd-spf
passed an attacker’s exp= text unchecked into its line protocol with Postfix
[jeitner2021]. OpenDMARC’s aggregate-report parser wrote a NUL byte past a heap
buffer (CVE-2020-12460) [cve-2020-12460].
In each case the attacker only has to publish a DNS record for a domain they own and send one message (or one report) to the target. The result is a crash or, potentially, remote code execution in the mail server, without authentication. Bennett et al. detected vulnerable servers remotely through the DNS queries they made. They found 7,212 vulnerable server addresses, about 17% of the SPF-validating servers tested and serving 8.7% of domains. After four months only 24% were patched, and the patching that did happen followed public disclosure, not private notification [bennett2022].
Pepsi: Addressed. Impact: none.
Pepsi uses neither libspf2 nor OpenDMARC. SPF (including macro expansion and
exp=), DKIM, DMARC and ARC are evaluated by the vendored mail-auth crate,
which is Rust and contains no unsafe code. It runs inside pepsi-ingress
under a verification deadline (VERIFY_TIMEOUT), with SPF’s limit of ten DNS
lookups. A malformed record can at worst make the library return an error or
panic. A panic unwinds and ends only the SMTP connection that caused it (see
Security model), and ingress is fail-open, so the message is still accepted with
a temperror or none verdict. The exp= text is computed by the library
but never used: SPF failures are not rejected with an explanation, and the
Authentication-Results field does not carry it. DMARC aggregate reports are
parsed only by pepsi-stage-dmarc-report, an unprivileged stage
worker, with the same library’s report feature: Rust, with the quick-xml
and zip crates beneath it (both Rust, each with a few unsafe blocks), and
decompression capped at MAX_REPORT_SIZE (DMARC aggregate reports). A report
that crashes the worker is struck out after three attempts like any message.
Signature checks go through aws-lc, which is C. The mail-auth message
parser is fuzzed (fuzz/fuzz_targets/parse.rs and a stable in-tree sweep), but
the SPF and DMARC record parsers have no dedicated fuzz target. See also
Memory-safety bugs hidden in unsafe Rust code. An operator who chains OpenDMARC or a
similar C filter through pepsi-stage-milter brings its
vulnerabilities along.
96.4.1.6. Untrusted SPF macro, explanation and trace data from DNS¶
Everything that an SPF check works with is chosen by the sender: the HELO
name, the MAIL FROM address and the published record. RFC 7208 warns that
macros let the sender inject arbitrary text into the receiver’s DNS queries.
exp= explanation strings, which receivers put into rejections and bounces, are
written by the record publisher and may carry misleading text or malicious links,
and through misdirected bounces they may reach a forged address. Trace fields
built from these values must be checked for invalid characters and long lines
before they are echoed. In the other direction, macro queries, especially with
exists, tell the domain owner which receiver is handling which mail
[rfc7208].
Pepsi: Partly addressed. Impact: low.
The injection paths are closed. The HELO argument is checked by
plausible_ehlo_domain (pepsi-ingress/src/smtp/command.rs): at most 255
bytes, no control characters, no parentheses or backslash. Envelope addresses
carry no control characters. So the Received: field that Pepsi writes, and that
ARC and DKIM later sign, cannot be broken by either value. mail-auth writes the
smtp.mailfrom and HELO values in Authentication-Results as escaped,
quoted values. The explanation string is never shown to anyone: ingress does not
reject on SPF (A remote sender), and the explanation is not copied into any
header or DSN. Pepsi also generates no DSN to a forged sender in the default
configuration (BOUNCE_UNAUTHENTICATED = drop).
What remains is the property of SPF itself. Macro expansion, as RFC 7208 requires
it, makes Pepsi’s resolver send queries that tell the record publisher the
connecting client’s address, the sender’s local part and when they were checked.
mail-auth also follows exp= with a DNS query on every SPF fail, although
the answer is discarded. A receiver could avoid both only by deviating from the
standard. This is not something Pepsi can fix alone.
96.4.1.7. Inconsistent DMARC record parsing across checkers and libraries¶
The DMARC record syntax is spread over several documents and is partly ambiguous,
and Hureau et al. found that no checker or library they tested implemented it
fully. The corner cases are handled inconsistently: whitespace and case, duplicate
tags (undefined in RFC 7489; the working group said such a record should be
disregarded), unknown tags (which must be ignored but make some checkers reject the
record), and the rule that a record with an invalid p/sp but a valid
rua counts as p=none, which no tool applied. In DNS they found 150,000
syntactically invalid records and 68,000 domains publishing several valid records,
which makes DMARC inapplicable for them. As a result, the same record yields
different policies at different receivers, and a domain owner may believe a
policy is enforced while receivers ignore it. The authors published a strict
ABNF-based parser and proposed a simpler v=DMARC2 [hureau2024].
Pepsi: Addressed. Impact: low.
On the publishing side, Pepsi has the strict checker the paper asks for.
pepsi-setup validates the _dmarc record of every served domain tag by tag
against the RFC 7489 grammar (pepsi-setup/src/dmarc.rs). It reports
duplicate tags, a missing p=, an rua= without scheme, malformed unknown
tags and more than one record at the name as errors. Its tests also require that
every record it accepts is accepted by the receiver’s parser. An operator using
pepsi-setup is therefore not left with a record that silently does not apply
(pepsi-setup). The record it suggests for a domain without one
(v=DMARC1; p=reject; adkim=s) passes the same checker, and a
record that does not parse is repaired in place, never replaced by the
suggestion, so its other tags survive.
As a receiver, Pepsi uses the mail-auth parser, which follows DMARCbis (RFC
9989), and the vendored copy closes the lenient places that the paper lists. When
several DMARC records sit at one _dmarc name, all of them are discarded (RFC
9989 section 4.10) instead of using the first one that parses, so the policy does
not depend on the order in which the resolver returns them. A record that repeats
one of the DMARC tags is invalid (permerror, following the DKIM tag-list rule
of RFC 6376 section 3.2 that DMARC adopts) instead of last-wins; repeated
unknown tags are ignored, as unknown tags must be. An invalid p, sp or
np value makes the record read as p=none when its rua names at least
one valid URI, and as no policy otherwise (RFC 9989 section 4.10.1), and an
invalid adkim, aspf, fo, rua or ruf value falls back to that
tag’s default instead of discarding the record (section 4.8); the parser does not
let a malformed value consume the tag that follows it
(vendor/mail-auth/src/dmarc/parse.rs, with tests). pepsi-setup still
reports every such value as an error, since the policy that a receiver applies is
then not the one the operator wrote.
96.4.1.8. Content concealed from spam filters (HTML/CSS, invisible chars, bad QR)¶
Content filters read the text of a message’s source. The recipient sees what the mail client renders. Spammers exploit the difference by putting text in the source that the reader never sees. Betts et al. found such concealment in 37.6% of 984 sampled spam messages from 2003 to 2018. The tricks were whole hidden paragraphs of innocent text, hidden characters inside trigger words, and inserted words, made invisible by font colour matching the background, tiny fonts, positioning or table tricks [betts2024]. Guo et al. catalogued 16 CSS configurations that hide inserted “interference” text. Cloaked spam reached the inbox at 12 of 14 large providers, including Gmail, iCloud and Yahoo, and was 2.81% of 3.6 million HTML spam messages. Because inbox previews ignore CSS, the hidden text is also what the preview line shows [guo2025]. The same gap exists for text-level tricks. Invisible characters, homoglyphs, bidirectional reordering and deletion characters leave the rendered text unchanged but break classifiers and search, and a single injected character significantly degrades vulnerable models [boucher2022]. Boulila et al. found phishing links in deliberately malformed QR codes, which two of three leading commercial filters decoded as non-URLs while phone cameras extracted and opened the link. Both vendors changed their products [boulila2025]. There is no definitive fix. The proposals are to analyse what the recipient would see (rendering plus OCR, costly), to treat hidden text and invisible characters as a spam signal, and to normalise Unicode before classification [betts2024] [guo2025] [boucher2022].
Pepsi: Partly addressed. Impact: low.
Pepsi has no statistical spam filter. Its main anti-spam measure, pepsi-stage-anti-spam, charges unknown senders for delivery and does not look at content. Operators who want content filtering attach rspamd or SpamAssassin through pepsi-stage-milter and inherit those tools’ handling of the tricks above. Pepsi does not decode QR codes in incoming mail.
The one content classifier Pepsi does ship is language policy:
pepsi-stage-detect-language classifies the body and
pepsi-stage-block-language bounces or marks mail in unwanted
languages. It classifies what the client displays
(mime_text::extract_displayed_text, pepsi-common/src/mime_text.rs): of a
multipart/alternative the HTML alternative, and the text/plain one only
when the HTML holds no prose. HTML is rendered without <head>, <style>,
<script>, <template>, comments, the hidden attribute and the inline
styles that hide an element (display: none, visibility: hidden, a zero
font-size or opacity, a zero height or max-height with overflow:
hidden). Before classification, invisible and format characters are removed and,
inside a word that mixes Latin with another script, the look-alike letters are
folded with the UTS #39 confusables data that the subject indicators use
(pepsi_common::indicator). A hidden paragraph, a plain-text alternative or
zero-width characters in an accepted language therefore cannot get a message past
a language block. Handling what remains would need a CSS engine or rendering: text
hidden by a style sheet class, by a font colour matching the background, by
positioning or by table tricks is still read, and a word spelt entirely in
look-alike letters of one other script is read in that script. The consequence is
limited, because the stage is optional and filters only on language, so what gets
through is unwanted mail, not a forged identity. Content filtering beyond language
stays with the milter’s filter, and judging text by what a client renders is an
open problem for content filters generally, so nothing further is left for Pepsi’s
code. See also Adversarial evasion of content-based phishing and scanning classifiers and
MIME parser differentials let content evade filters and gateways.
96.4.1.9. Email-to-SMS gateways and handsets authenticate one identity, display another¶
Mobile carriers run gateways that turn an e-mail sent to <number>@<carrier>
into a text message. Rao et al. found that the identity that these gateways
authenticated was often not the one they displayed, and that their fallback paths
skipped checks. Gateways that display From: delivered spoofed mail for any
domain with a DMARC policy of none or quarantine as an ordinary text,
since a phone has no spam folder. AT&T MMS ignored DMARC. Google Fi and Verizon
MMS decided on DMARC, which evaluates From:, but displayed the unauthenticated
envelope sender. Verizon SMS and Google Fi accepted an empty envelope sender and
then showed From: unchecked. T-Mobile fell back to the envelope sender when
From: was missing and misread obsolete source-route syntax [rao2026]. On the
handsets, Google Messages mistook an all-numeric e-mail address for a phone
number, and Apple’s CoreTelephony could be made to truncate an encoded sender to a
chosen phone number, short code or name (CVE-2025-46311). Apple Messages also
merges a contact’s addresses into one thread, so a spoofed text lands in an
existing conversation, including those of verified business senders [rao2026].
Any host with its own domain could thus send texts that appear to come from any
address or number, including DMARC-reject domains. All four carriers fixed or
shut down their gateways after disclosure. Google fixed Messages in October 2025
and Apple fixed the encoded-sequence issue in iOS 26.3 [rao2026].
Pepsi: Not applicable. Impact: none.
Pepsi converts no mail into text messages, and nothing it delivers is rendered by a
handset’s messaging stack. The general lesson, that the identity checked must be
the identity shown, does apply to Pepsi’s own decisions. It is discussed under
Multiple or duplicate From headers evade DMARC and DKIM checks and
Ambiguous From headers checked as one address and displayed as another: one From: field, the first mailbox
read the way a client reads it, and source routes stripped from envelope paths
at ingress. The one place where Pepsi hands an address to an external messaging
program is the secure-link portal’s PIN_COMMAND, and it carries outbound
PINs, not inbound sender identities. It is covered under
Command injection via Subject into a list archiver.
96.4.1.10. ARC implementations record wrong results or seal incompletely¶
ARC lets each forwarding hop record what it saw (ARC-Authentication-Results)
and seal the message, so a later receiver can trust the chain instead of a broken
DKIM signature. The chain is only as good as each sealer. Shen et al. tested three
ARC deployments and found two faulty. Zoho recorded a DMARC “pass” in its
ARC-Authentication-Results for spoofed mail forwarded through Gmail, and
Office 365 recorded wrong SPF, DKIM and DMARC results. The spoofed message thus
carried a trusted “pass” along the chain and also escaped Zoho’s own warning
[shen2021]. Wang et al. found that Outlook, Zoho, Fastmail and Mailman 3’s ARC
module did not cover the existing DKIM-Signature fields in the
ARC-Message-Signature, contrary to RFC 8617’s recommendation, so the chain did
not protect the original DKIM evidence. OpenARC, unmaintained since 2018, produced
broken or mismatching seals that make legitimately forwarded mail fail ARC
[wang2022b].
Pepsi: Addressed. Impact: none.
The recorded results are Pepsi’s own. pepsi-stage-arc does not
re-run or re-derive SPF, DKIM and DMARC. It copies the Authentication-Results
assessment that ingress computed for this very message into the
ARC-Authentication-Results field (Authenticator::arc_seal in
pepsi-common/src/auth.rs), so the two cannot disagree, and the arc= line
is its own verification of the inbound chain. The chain-validation value is
handled carefully. An inbound chain that fails to validate is sealed cv=fail
even when it cannot be parsed at all, and a chain already marked cv=fail is
not extended. Without that, the sealer would have started a fresh, laundering
cv=none chain. l= is never set; setting it would make other ARC verifiers
treat the seal as broken. These cases are pinned by tests (arc_* in
auth.rs).
The second finding does not apply. Pepsi’s DKIM header list (SIGNED_HEADERS in
pepsi-common/src/sign.rs) does not contain DKIM-Signature, so an ARC
message signature over it would not protect the originator’s DKIM signatures as
RFC 8617 recommends. [stage-arc] therefore defaults to its own list,
ARC_SIGNED_HEADERS, which adds DKIM-Signature. That list leaves out the
List-Unsubscribe pair, which a list adds after the seal is made on arrival. An
operator can still override it with the stage’s SIGNED_HEADERS option. How
much downstream receivers trust Pepsi’s or anybody’s seal is a separate question
(Trusting ARC chains from arbitrary sealers launders authentication).
96.4.1.11. Memory corruption in antivirus file parsers reached via mail¶
A mail scanner unpacks and parses every attachment it is given, in formats it does not control, so a parser bug becomes remotely reachable by anyone who can send mail. Cisco’s advisory for CVE-2023-20032 is a typical case: ClamAV’s HFS+ partition parser lacked a buffer size check, and a crafted attachment caused a heap buffer overflow write (CVSS 9.8). It affected ClamAV 1.0.0, 0.105.1, 0.103.7 and earlier, and with them several Cisco products. The result is code execution with the scanner’s privileges or a crash, with no user interaction. The severity depends on the privileges with which the scanner runs. Fixed releases were the only remedy [cisco2023b].
Pepsi: Not applicable. Impact: none.
Pepsi contains no antivirus engine and does not unpack archive or disk-image
attachments. Content scanning is something an operator adds by attaching an
external scanner such as clamav-milter through
pepsi-stage-milter. That scanner then runs as its own service with
its own privileges, and its parser bugs are its own, to be patched by the
distribution. The parsing that Pepsi does perform on hostile content (MIME, CMS,
OpenPGP, mailbox formats) is in Rust, partly fuzzed, and is covered by
Memory corruption in MTA and MUA MIME parsers,
Memory corruption in ASN.1, CMS, certificate and OpenPGP parsers and
Memory-safety bugs hidden in unsafe Rust code.
96.4.1.12. Privilege escalation through a mailing-list manager setuid wrapper¶
Mailing-list managers often install small setuid helpers so that the MTA or a web front end can hand them messages under the list manager’s account. Such a wrapper is a privilege boundary: whatever its unprivileged caller supplies (arguments, environment, configuration paths) must not change what it does while privileged. Sympa before 6.2.56 failed this. According to the referenced Sysdream advisory, input from the caller of its setuid helpers changed their behaviour, and a local user could escalate to root. It was fixed in 6.2.56 and in distribution updates (DSA-4818, USN-4442-1) [cve-2020-10936].
Pepsi: Partly addressed. Impact: low.
Pepsi’s list manager (pepsi-list and the pepsi-stage-list-*
stages) runs as the ordinary pepsi pipeline account and installs no setuid
program. Elsewhere Pepsi does install privileged helpers, and they were designed
against this class of bug (The privilege split). The three setuid-root helpers
(pepsi-helper-maildir-writer, pepsi-helper-dot-forward,
pepsi-helper-auto-pay) are mode 4750 with a dedicated group, so no
ordinary local account can execute them. Only the corresponding SGID stage binary
(mode 2550) reaches them. Each takes only a target uid and a few flags,
refuses uid 0 and accounts below UID_MIN (the auto-pay helper’s shared wallet
mode instead requires the account’s primary group to be the helper’s own group),
drops fully to the target user before touching that user’s files, and runs any
user command with a fixed environment. pepsi-whitelist, the one helper that an
ordinary user can run, is setuid to an unprivileged database role, not to root. It
drops to the caller at once, clears the environment that the configuration layer
would read, refuses -c, and raises its privileges only for the database
connection. See A local shell user and
Privileged helpers trusting config, environment or fds of a lesser account.
What remains is the residue that every setuid design has. A bug in one of the root
helpers would let whoever controls the pepsi pipeline account, for example
through a compromised stage, become root (A compromised component). A local shell
user without that account cannot reach them. A socket-activated privileged
service in place of the setuid bits would only trade this for a long-running root
process, so the residue is the open problem of any privilege boundary, not a
change left for Pepsi’s code.
96.4.1.13. Command injection via Subject into a list archiver¶
A list server that hands posts to an external program becomes dangerous when it
builds the command line from message fields. CVE-2025-43920 reports that GNU
Mailman 2.1.39, as bundled with cPanel/WHM, passed the Subject of a posting to a
shell command in certain external-archiver configurations. Shell metacharacters in
the subject would then let an unauthenticated sender run commands on the list
server. The record notes that several third parties could not reproduce the
problem, and it names no fix [cve-2025-43920]. The general rule holds either way:
message data must never be interpolated into a shell command.
Pepsi: Addressed. Impact: none.
Pepsi’s list archive is built in (pepsi-archive, stored in PostgreSQL), and no
list component runs an external archiver or any other program. Across the tree,
no message data is put into a command line that a shell parses. The only
/bin/sh -c invocation with mail nearby is a user’s own |command line in
~/.forward, run by pepsi-helper-dot-forward as that user. It is executed
as written in the file, and the message goes to it on standard input, not on the
command line. Other programs are started with std::process::Command and
separate arguments, so no shell parses them: the auto-pay helper’s
taler-wallet-cli, the delivery helpers, and the secure-link PIN_COMMAND,
which receives the recipient address as one argument after --.
One spot passes mail-derived text as an argument to an operator-supplied program.
With PIN_DELIVERY = command, pepsi-stage-secure-link runs
PIN_COMMAND with an envelope address as its argument and the PIN on standard
input. No shell is involved, and the address follows a --
separator, so an address whose local part legally begins with - cannot
be read as an option by a script that honours the convention.
96.4.2. Cryptographic weaknesses¶
Weak or broken algorithms, parameters and randomness, oracles, malleable encryption and side channels.
96.4.2.2. Brute-forceable mailing-list subscription confirmation tokens¶
Double opt-in subscription is only as strong as the confirmation token mailed to the subscribing address. On the OpenStack lists, which then ran Mailman 2, an attacker requested subscriptions of victim addresses to many lists and then guessed the confirmation tokens. The token generator produced values short and weak enough that a small percentage could be brute-forced within hours. Victims were subscribed without access to their mailboxes and received list traffic against their will. Because the confirmation itself succeeded, the forced subscriptions looked genuine and could be spotted only heuristically in the logs. The operators removed them by hand and planned the move to Mailman 3, whose tokens are much stronger [openstack2022].
Pepsi: Addressed. Impact: none.
Pepsi’s list confirmation tokens (pepsi-list/src/token.rs) are 32 bytes from
the operating system’s CSPRNG, base32-encoded. That is 256 bits, beyond any guessing,
and deliberately not upstream’s hash of time plus random data. A token waiting on
the subscriber expires after three days, and a token is reset once its workflow
resumes, so a replayed confirmation finds nothing to confirm. The token is both the
-confirm+<token>@ sub-address and the last segment of the confirmation URL, and
both forms carry the full value. Pepsi’s public web forms also limit how many
confirmation mails a single target address can receive per hour, so the
subscription requests themselves cannot be used to flood a victim
(pepsi-list).
96.4.3. Protocol design gaps¶
Weaknesses of the design itself: missing bindings between identities, optional protection that can be stripped, and other design flaws.
96.4.3.1. DKIM replay of a validly signed message to unintended recipients¶
A DKIM signature covers header fields and body but not the SMTP envelope: it
names neither the recipients that the signer meant to reach nor a time window that
receivers check. Whoever holds one signed message can therefore send the
identical bytes again, with new RCPT TO addresses, from any infrastructure,
and every copy verifies as mail of the signing domain. RFC 4686 already listed
this “signed message replay” and its “chosen message” variant, in which the
attacker obtains the signature by sending through an account at the domain
[rfc4686]. The IETF DKIM working group’s problem statement describes how it
became routine: the attacker opens (or buys, or compromises) an account at a
reputable provider, mails one spam message to themselves, often with To: or
Subject left unsigned so they can be adjusted, and replays it to millions of
addresses. A single replayed copy cannot be told apart from legitimate indirect
flows such as aliases, lists and filtering gateways, and ARC inherits the same
property [draft-ietf-dkim-replay-problem]. In December 2021 about 98% of the
mail that Gmail received in the name of one large provider’s domain was such
replayed spam,
roughly fifty times that provider’s normal volume, and the domain’s reputation
fell until its legitimate mail suffered [proton2024].
The attacker gains delivery under the signer’s reputation and, as a side
effect, damages that reputation. No complete fix exists within DKIM. The
proposed mitigations are accountable accounts and egress filtering, limits on
quoted content in automatic replies [rfc4686], counting repeated signatures at
receivers, short-lived keys or signature expiry, regular automated key rotation
and oversigning From/To/Cc [draft-ietf-dkim-replay-problem]
[proton2024]. The structural answer is DKIM2, in which every hop signs the
MAIL FROM and RCPT TO of its own transaction, the next signing domain, a
timestamp and a nonce, so that a copy sent to a recipient that the chain does
not name, or a duplicate not declared as an explosion, can be rejected
[draft-ietf-dkim-dkim2-motivation] [draft-ietf-dkim-dkim2-spec].
Pepsi: Partly addressed. Impact: medium.
Pepsi is a DKIM signer, so a deployment is exposed in the signer’s role.
pepsi-stage-dkim-sign signs every submission with the key of the From:
domain (pepsi-stage-dkim-sign), and USERNAME_MAP only binds
that address to the authenticated account (A mail-only user); it does not
stop the account holder from keeping a signed copy and replaying it elsewhere.
The default header list (SIGNED_HEADERS in pepsi-common/src/sign.rs)
covers To and Cc and lists every field twice, so a replayer can
neither add a To: to a message that had none nor a second one above the
signed copy. Every signature carries an x= expiration seven days after signing
(SIGNATURE_EXPIRATION_DAYS, 0 turns it off), so a copy replayed later
than that fails at every verifier that honours x=, while a message delivered
within any receiver’s retry schedule still verifies. As a receiver, Pepsi
records dkim=pass for a replayed message like any other verifier, and
pepsi-stage-check-whitelist accepts it for a whitelisted sender. Since the
replayed content is the sender’s own, that does little harm.
What remains is the week itself and the missing recipient binding: within the
window, the identical bytes verify for any RCPT TO. Operators can shorten
the window further (a day or two costs nothing for mail delivered promptly) and
should vet who receives accounts. Binding the envelope needs DKIM2, which is an
IETF draft; until it is standardised, nothing further is left for Pepsi’s code.
96.4.3.2. DKIM l= body length tag leaves an unsigned, replaceable body tail¶
RFC 6376 lets a signer limit the body hash to the first l= octets, and only
remarks that verifiers “might wish” to ignore such signatures. Content appended
after the signed prefix is then accepted as signed. RFC 4686 already warned that
in HTML mail the appended part can visually cover the signed one [rfc4686], and
a textbook chapter counts the tag as the basis of most published DKIM attacks
[schwenk2022a]. Ullrich showed in 2017 that the tail can do far more than
append: when Content-Type is unsigned or not oversigned, the attacker
replaces the MIME boundary so that the signed original becomes ignored preamble
and an attacker-built MIME structure in the tail becomes the displayed message,
attachments included. A real DHL message rewritten this way was shown by Gmail,
Outlook and AOL as passing DKIM and DMARC despite DHL’s p=reject. About 8% of
the signatures he analysed used l=, one company signed only the first 10
body octets, and keys were neither rotated nor signatures given an expiry, so
old messages stayed usable [ullrich2021].
Zone.eu revisited the attack in 2024, adding a variant that extends a signed
boundary and finding millions of l= signatures from 3,040 domains. 32 of
those domains had BIMI with a verified mark certificate, so Gmail and Apple Mail
showed the forgery with the brand’s logo; a 2014 RSA-SHA1 l= message still
verified [zone2024]. The fixes are on both sides: verifiers ignore l=
signatures or display only the signed part (Google says Gmail did so around April
2024, Apple planned to, Microsoft did not regard it as an issue), and signers drop
l=, oversign Content-Type and rotate keys [ullrich2021] [zone2024]
[schwenk2022a] [rfc4686].
Pepsi: Addressed. Impact: none.
As a signer, Pepsi never emits l=. SigningParams::cover_body is
hard-wired to true and has no configuration option, for DKIM signatures and
ARC message signatures alike; the field’s documentation in
pepsi-common/src/sign.rs gives the reasons, and
pepsi-stage-dkim-sign states it (“Full body coverage, always”).
A replayer therefore has no unsigned tail to fill in mail that Pepsi signed.
As a verifier, pepsi-common::auth::verify uses mail-auth’s strict parser,
which rejects every signature with l > 0 outright. Such a signature never
yields dkim=pass, so it cannot satisfy DMARC at ingress or the
dkim_required gate of pepsi-stage-check-whitelist. The test
dkim_l_tag_rejected_by_strict_verify pins this behaviour and fails if a
future mail-auth release starts honouring the tag. The cost is that mail from the
remaining l= signers fails DKIM at Pepsi, which is what the literature
recommends.
96.4.3.3. Headers added to DKIM-signed mail when not oversigned¶
RFC 6376 requires only From to be signed, and each name in h= covers one
occurrence of the field, counted from the bottom. A field that is not listed, or
is listed only as often as it occurs (not “oversigned” with one extra entry), can
therefore be added above the original without breaking the signature. Mail
clients often display the topmost copy while the verifier checks the bottom one.
Ullrich found that about 97% of signers covered Subject but only 3%
oversigned it, that Content-Type was protected against additions in 2% of
mails, and that OpenDKIM’s default list omitted Content-Type and
Content-Transfer-Encoding [ullrich2021]. Chen et al. turned this into the
replay attacks A14 and A15: they changed unsigned fields (a new Subject, or a
Content-Disposition that turns the body into an attachment) and added
duplicates of signed fields, which 10 of 19 clients displayed in preference to
the signed copy. Of ten large providers, only Yahoo oversigned [chen2020].
Wang et al.’s 2022 measurement found that 94.1% of domains left at least one
important field (From, Reply-To, Subject, Date, To, Cc,
Content-Type) unsigned, 88.6% did not sign Reply-To, and only 2.2%
oversigned [wang2022].
The attacker needs one validly signed message from the target domain. They can
then resend it with a different displayed subject, date, recipient or
Reply-To, or with a new Content-Type that hides the original body in
some clients, while DKIM and DMARC still pass. The remedy is for signers and DKIM
libraries to sign and oversign by default every field that affects display or
handling, and for verifiers to flag fields that the signature does not cover
[ullrich2021] [wang2022] [chen2020].
Pepsi: Partly addressed. Impact: low.
pepsi-stage-dkim-sign signs a broad default set (SIGNED_HEADERS in
pepsi-common/src/sign.rs): From, Sender, Reply-To, To, Cc,
Subject, Date, Message-ID, In-Reply-To, References,
MIME-Version, Content-Type, Content-Transfer-Encoding,
Auto-Submitted, List-Unsubscribe and List-Unsubscribe-Post. Every
field is listed twice and is therefore oversigned. A listed field that is absent
from the message is covered by its absence, so a replayer cannot add a
Reply-To: to a message that had none; a field that is present is covered
together with one extra empty occurrence, so a second To, Date,
Reply-To, Content-Type or Content-Transfer-Encoding placed above the
signed one breaks the signature (pinned by tests in pepsi-common/src/sign.rs
and pepsi-common/src/auth.rs). Each listed field occurs at most once in a
well-formed message, so oversigning never leaves a legitimate occurrence unsigned.
The ARC message signature that Pepsi adds (ARC_SIGNED_HEADERS) oversigns the
same fields, all but DKIM-Signature, of which a message may carry several.
Since Pepsi never uses l= (DKIM l= body length tag leaves an unsigned, replaceable body tail), a duplicate
Content-Type can only reinterpret the signed body, not add content. As a
receiver, ingress refuses a message with more than one From:
(pepsi-ingress). Under MIME_ANOMALIES = enforce (the default)
it also refuses (554 5.6.0) a message whose Content-Type or
Content-Transfer-Encoding fields disagree, or whose message header carries two
differing Date, Subject, To, Reply-To or Sender fields (RFC
5322 section 3.6 allows one of each), and it reduces identical copies of those
fields, and of Message-ID, In-Reply-To and References, to the first
(pepsi_common::mime_anomaly). The classification reads the bytes as received,
and the DKIM verdict is computed on the same bytes. A replayed message with a
second Subject above the signed one still passes a signature that names
subject once, so ingress refuses it instead of delivering it with
dkim=pass (pinned by
an_added_second_subject_passes_dkim_and_is_a_hard_anomaly in
pepsi-common/src/auth.rs). Two differing Cc fields are only marked
X-Pepsi-Warning: duplicate-header-cc: some mail clients write a second Cc:
line when the user adds one, and a sample of about 24,000 messages (public
mailing-list archives and a public ham corpus) held six such messages, all
legitimate, and no differing copy of the five refused fields. Under
MIME_ANOMALIES = log every differing copy is marked
duplicate-header-<field> instead of refused.
What remains is outside Pepsi’s reach: a field that the signer did not list at
all can still be added once, with no duplicate to detect (a Reply-To on a
message that had none, from a signer that does not oversign absent fields),
and the message passes DKIM. Only the signer can prevent that, by oversigning,
and only the reader’s client can show which fields a signature covered.
96.4.3.4. SPF and DKIM authenticate a domain other than the displayed From¶
SMTP authenticates neither the envelope sender nor the From: header, and the
two DNS-based add-ons each authenticate an identity that the reader does not
see. SPF authorises hosts for the MAIL FROM (or HELO) domain, and DKIM
vouches for its d= domain; neither relates that domain to the From:
field. A sender who uses their own domain in the envelope or the signature
therefore passes both while displaying any author. SPF also maps domains to
hosts, not addresses to users, so co-users of a shared MTA can forge each
other’s addresses [rfc7208]. Herzberg made the same point in 2005 and in his
2009 review, adding that DNS spoofing or a man in the middle can turn a
fail into a pass, and that forwarding breaks SPF for legitimate mail
[herzberg2005] [herzberg2009]. Later surveys, a stakeholder SoK and
administrator interviews repeat it: only DMARC’s identifier alignment binds the
authenticated domain to From:, and fear of losing forwarded or list mail
keeps enforcement weak [ragheb2023] [clark2021] [hu2018b]
[sethuraman2023].
The result is phishing under a forged visible sender that passes SPF, DKIM or both, wherever DMARC is absent, lax or not enforced. The remedies are DMARC alignment with an enforcing policy, submission servers that restrict users to their own addresses (RFC 6409 section 6.1), DNSSEC against forged answers, and per-user message signatures where the individual matters [rfc7208] [herzberg2009].
Pepsi: Partly addressed. Impact: low.
Pepsi never takes an unaligned SPF or DKIM pass as authenticating the author.
Ingress evaluates DMARC (mail-auth, with the RFC 9989 tree walk) and records it
in Authentication-Results. The dkim verdict that stages act on,
dkim_token in pepsi-common/src/auth.rs, reports a valid signature whose
d= is unrelated to the From: domain as fail. This is what keeps the
dkim_required gate of pepsi-stage-check-whitelist from being
satisfied by an attacker’s own domain. Addresses are read from the first mailbox
of a single From: field (A remote sender). On the sending side,
USERNAME_MAP restricts every authenticated or local submission to the
addresses mapped to its account, which is RFC 6409’s cross-user rule, and
pepsi-stage-dkim-sign signs with the From: domain itself, so Pepsi’s own
mail aligns.
What remains: inbound authentication is fail-open. With
DMARC_ENFORCE = no (the compiled-in default; the wizard writes yes), a
forged From: is delivered with an honest
Authentication-Results field (see Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment)),
whose spf=pass names the envelope domain and can mislead a reader or client
that does not look at dmarc=. Where the forged domain publishes DMARC, the
reader does see the failure: ingress puts the [external] subject tag on a
message whose DMARC failure it did not act on (X-Pepsi-Warning:
dmarc-fail-not-enforced, pepsi-ingress/src/external.rs).
SPF records and DKIM keys are looked up through
ordinary DNS. Pepsi demands DNSSEC-validated answers only for DANE and for the key
discovery records (OPENPGPKEY, SMIMEA), not for SPF, DKIM or DMARC
records, so on a host without a validating resolver an on-path DNS attacker can
still forge a pass. Operators close the first gap with DMARC_ENFORCE and the
second with a local validating resolver for the domains that sign with DNSSEC.
96.4.3.5. Domain-level authentication never identifies the individual sender¶
SPF, DKIM and DMARC authenticate at most a domain. Every account in a domain is
therefore cryptographically indistinguishable from every other, so they help
neither against display-name spoofing nor against mail from a compromised
legitimate account. Training and detection are not reliable either, and the
individual-level schemes that would help (PGP, S/MIME) are rarely used because
key management is too hard for ordinary users. Li et al. argue this from the RSA
and ANU spear-phishing breaches [li2025a]. In a formal model they then define
authenticity completeness: a message may be presented as coming from the
claimed sender only after successful verification of that sender’s signature
over exactly the delivered content. Deployed mechanisms fail this for three
structural reasons: domain granularity, optional enforcement (p=none,
receivers skipping checks, forwarding that breaks DKIM yet still delivers), and
multi-valued outcomes (softfail, neutral, none). The argument extends
to OpenPGP and S/MIME as deployed, where clients may show a message as signed
when verification was absent or bypassed [li2026c].
Their proposed fix is a “sessional” signature: after the user authenticates, the sending provider signs each message with a fresh key pair, publishes the public key under a per-message code, and the receiving provider delivers as verified only what passes [li2025a] [li2026a] [li2026c]. The scheme trusts both providers and the key server, needs both providers to take part, and has not been implemented or evaluated. Note that it, too, authenticates the account at the provider rather than the person.
Pepsi: Partly addressed. Impact: medium.
Pepsi goes beyond domain authentication where it can. pepsi-stage-encrypt
signs outgoing mail with the key of the From: author, OpenPGP or S/MIME
(pepsi-stage-encrypt), and USERNAME_MAP ensures that an
account can only send, and be signed, as its own addresses
(A mail-only user). Inbound, pepsi-stage-decrypt verifies such
signatures and sets state.signature_verified and the [verified: <address>]
subject tag, naming the address that the signer is bound to, only for a signature
that covers the plaintext and was made with a trusted key, and only when the
From: line as the reader sees it names that one mailbox and no other address
(What a security indicator means). pepsi-stage-check-whitelist can require that verdict
per whitelist entry (signature_required). Display-name spoofing, which no
domain-level check can see, is met at the border: ingress refuses a submission
(550 5.6.0) whose From: display name or comment names an address other
than its own mailbox’s, judged as a client renders it (encoded words decoded,
full-width @ folded; pepsi_common::indicator::display_name_claim), and
marks inbound mail of that shape with X-Pepsi-Warning:
display-name-claims-other-address and state.auth.display_name_mismatch, a
field that pepsi-stage-decrypt keeps when it strips the rest of the
X-Pepsi-* namespace. Pepsi also gates delivery on authentication only partly:
it is fail-open, and only DMARC_ENFORCE (written by the wizard, off in the
code) turns a DMARC failure into a rejection.
What remains is partly configuration and partly inherent. Under the default
ENABLE_PEP preset, SIGN is encrypted-only, so cleartext mail to
correspondents without a key carries only the domain’s DKIM signature.
SIGN = always signs everything, at the cost of signatures that some
recipients’ clients display as clutter or as unknown keys. The per-user key is
held by the gateway, so the signature authenticates the account, and a
compromised password or a compromised pepsi-role stage still signs as the
user, a documented residual (Someone holding a user’s mail password, A compromised component).
Most recipients’ clients do not verify the signatures at all. Individual sender
authentication across the whole mail ecosystem remains an open problem.
96.4.3.6. Authenticated mail from abusers – pass is no evidence of legitimacy¶
Sender authentication answers “did this domain send it?”, not “is the sender trustworthy?”. Spammers were early adopters of SPF and Sender ID to make their mail look legitimate, and anyone who owns a domain can sign with DomainKeys or DKIM; Goodrich et al. proposed tying keys to accreditation bureaus with an acceptable-use policy to supply the missing trust [goodrich2005]. Mori et al. measured the effect in an enterprise: 37% and 21% of two spamming-domain sets published SPF, some records authorised the entire IPv4 space, and 45% of spam from domains with valid records passed SPF [mori2011]. Schryen’s formal route analysis shows that no route-specific measure covers spam injected through a reputable provider’s own MTAs or webmail from compromised or mass-registered accounts [schryen2007b]. Modern campaigns confirm it. All 1,551 reported phishing messages in a 2025 study had passed SPF, DKIM and DMARC as well as every commercial filter [boulila2025]. Scammers also send fake invoices and money requests through PayPal, Venmo and Docusign, whose genuine, authenticated mail carries an attacker-written note and phone number [intego2024].
Filters that treat a pass as a positive signal let such mail through, and users who equate “authenticated” with “safe” are deceived. The remedies are to give credit for a pass only together with domain or IP reputation and content analysis, to watch for implausibly wide SPF records, and for platforms to vet the accounts that may make them send mail [goodrich2005] [mori2011] [schryen2007b].
Pepsi: Partly addressed. Impact: low.
No Pepsi stage grants anything for an authentication pass alone. Several stages
require a pass before they act, always together with other conditions. By
default pepsi-stage-secretary sends a challenge only after an
SPF or DMARC pass. pepsi-stage-bounce under
BOUNCE_UNAUTHENTICATED = drop sends a DSN for an inbound message only after
an SPF pass or an aligned DKIM pass. pepsi-stage-vks-confirm
follows a confirmation link only after an SPF or DMARC pass, only from the
configured key server’s domain and only for a key that this site is waiting to
have confirmed. None of these releases held mail. The only use of a pass that
lets mail through is the dkim_required (and signature_required)
condition of pepsi-stage-check-whitelist, which applies only
when the sender also matches a whitelist row that the recipient or the operator
created, and then merely clears state.spam. Pay-to-send
(pepsi-stage-anti-spam) prices mail from strangers whatever
their authentication, which is a cost-based control rather than a reputation
assumption.
The residue lies in the whitelist itself. A whitelisted correspondent whose
account is compromised, or a whitelisted platform address such as a payment
service’s, sends authenticated mail that bypasses the paywall, and
pepsi-stage-auto-whitelist adds every outbound recipient by default (and,
when configured to, every mailing list whose subscription the user confirms by
answering its confirmation request; that entry then admits whatever
authenticated posting the list relays).
Pepsi has no content or reputation filter of its own and relies on a milter for
one. On the sending side, a Pepsi deployment is itself a “reputable provider” in
Schryen’s sense: abuse through a compromised account is limited by
USERNAME_MAP and by a per-account recipient budget for SASL submission
(USER_RECIPIENTS_PER_HOUR, 500 an hour by default), which bounds its volume
but not its content. Detecting abusive but
authenticated mail is an open problem. Users should treat a whitelist entry as
“I trust what this address sends”, not “this domain is real”.
96.4.3.7. Relaxed DMARC alignment lets any subdomain speak for the organisation¶
DMARC passes if either SPF or DKIM passes and aligns with the From:
domain, and its default relaxed alignment accepts any domain under the same
organisational domain. Whoever controls the SPF or DKIM records of any subdomain
(one delegated to a third party, taken over, or with a weak SPF policy) can
therefore send DMARC-passing mail as the parent and every sibling. A receiver
that places the organisational domain too high in the tree, for example below a
public-suffix operator that published a record without psd=y, extends the
same effect across organisations [rfc9989]. Hamza et al. measured the scale in
2026 over 34.6 M subdomains under 3.2 M DMARC-publishing organisational
domains. About 90% use relaxed alignment, most of them implicitly by omitting
aspf/adkim. SPF policies ending in +all/all (35 k subdomains)
or authorising leasable cloud addresses (493 k) made 97.1% of the 81 k
hierarchies with a vulnerable subdomain spoofable as a whole. Provider guidance
recommends relaxed alignment or none, partly because bounce handling uses a
provider-owned envelope subdomain [hamza2026].
Strict alignment alone is not enough, because the visible domain’s own SPF
policy can be abused. The authors’ “Split Alignment” sets aspf=s; adkim=s,
moves every SPF policy to dedicated envelope subdomains, publishes
v=spf1 -all on the visible domains and DKIM-signs all mail with d= equal
to the visible domain, so that DMARC rests on DKIM alone; tests showed no
deliverability loss [hamza2026]. DMARCbis adds: do not delegate subdomains where
it matters, publish explicit records per author domain, and watch the PSDs
above one’s domain [rfc9989].
Pepsi: Partly addressed. Impact: medium.
As a receiver, Pepsi evaluates DMARC with the vendored mail-auth, which
implements the RFC 9989 tree walk (including psd=) and honours each domain’s
aspf/adkim. That is the standard’s behaviour, so a domain with relaxed
alignment is protected only as well as its weakest subdomain. Pepsi’s own
dkim_aligned, which feeds the dkim_required whitelist gate, is
conservative in one direction: it accepts only an exact, parent or child domain,
never a sibling, and it applies a domain’s adkim=s
(dkim_token, strict_dkim_alignment), so a domain that asks for strict
alignment gets an exact match there too.
As a sender, Pepsi already produces mail that is compatible with Split Alignment’s
DKIM half. pepsi-stage-dkim-sign signs with d= equal to the From:
domain, and its submissions use the user’s own address as envelope sender. The
record that pepsi-setup suggests for a domain without DMARC is v=DMARC1;
p=reject; adkim=s (pepsi-setup/src/dmarc.rs), so a DKIM signature by any
subdomain does not speak for the organisation’s From:; the comment beside it
says to drop adkim=s if another service signs as a subdomain. SPF alignment
stays relaxed, because bounce-handling services commonly use a subdomain envelope;
the note beside the record recommends aspf=s once every sender uses the exact
domain. A record that the operator already publishes is never rewritten. What
remains is for operators: relaxed SPF alignment and their DNS (subdomain
delegations, permissive SPF; see Overly permissive SPF (+all, shared-provider includes, cloud IP pools) and
Subdomains and non-existent subdomains left without SPF/DMARC policy).
96.4.3.8. Sender ID PRA differs from displayed From and misreads SPF records¶
Sender ID (RFC 4406, Experimental, 2006) applies SPF-style policies to the
Purported Responsible Address, which it selects from Resent-Sender,
Resent-From, Sender or From. The validated address therefore need not
be the From: the user sees, and a message with a passing
Sender:/Resent-From: can carry any forged author. The RFC itself asks
clients to display the verified address [rfc4406]. Its IESG note adds that Sender
ID evaluates v=spf1 records, written for the MAIL FROM identity, against
the header-derived PRA, so legitimate mail through lists and forwarders that do
not add Resent-* fields fails a policy that its owner never published for that
identity [rfc4406]. Herzberg concluded in 2009 that the dual “on behalf of”
display confuses users, that comments in addresses help build misleading ones,
that the forwarder model contradicts RFC 5322, and that Sender ID should not be
used [herzberg2009]. It never advanced, and DMARC’s identifier alignment later
closed the gap it left. The RFC was moved to Historic.
Pepsi: Not applicable. Impact: none.
Pepsi implements neither Sender ID nor PRA evaluation. Ingress checks SPF on the
MAIL FROM/HELO identity only and aligns it with From: through DMARC
(pepsi-ingress), and a message with more than one From:
field is refused. pepsi-setup publishes only v=spf1 records. A remaining
Sender ID receiver could misapply such a record to the From: of mail that
Pepsi forwards, but Sender ID is Historic and not known to be deployed.
96.4.3.9. Forwarders, relays and lists launder spoofed mail into authenticated mail¶
A forwarder that accepts a spoofed message and re-sends it can turn its own
legitimacy into the forgery’s. Liu et al. (2023) studied 16 large providers and
four list services and built several attacks from three features. The first is
open forwarding to unverified destinations. The second is relaxed validation by
receivers of mail forwarded by large providers. The third is envelope rewriting
that makes the new envelope align with From:. Outlook’s “MAIL FROM equals
From” forwarding re-sent a spoofed message from its own IPs with an SPF pass
aligned with the forged domain. This worked for every domain that includes the
provider’s SPF record: about 12% of the Alexa top 100 K and 32% of US .gov
domains, whatever their DMARC policy [liu2023]. Gmail, Outlook and Mail.ru
accepted DMARC-failing mail when it arrived via certain well-known forwarders
[liu2023]. Lists that rewrite the envelope into their own domain and are hosted
under their members’ domain (Google Groups, Mailman, Listserv; Gaggle enforced
no DMARC at all) turned a forged post from a p=none member domain into one
that passed SPF and DMARC. About 10% of .edu and 5% of .gov domains had
that configuration [liu2023].
Exchange Online’s SRS rewrite (“LaunDroMARC”, 2025) does the same for the
forwarding organisation’s own domain. A message forged as that domain fails
DMARC on arrival, but once its envelope is rewritten into the same domain and
sent from an authorised server it passes at the next hop. Microsoft rated this
low risk [powerdmarc2025]. Address-hiding relays are a variant. iCloud Hide My
Email rewrites From: into its own domain and forwards p=quarantine
failures, and Firefox Relay strips all authentication headers and forwards even
p=reject failures. Spoofed mail sent to a relay alias therefore reaches
Gmail inboxes without a warning [wang2022b]. The recommended fixes are to
forward or SRS-rewrite only mail that passed DMARC (or compare results before
and after and quarantine on mismatch), to confirm forwarding destinations, to
honour p=reject instead of quarantining, for lists to hold posts that fail
DMARC, and for receivers to replace “trusted forwarder” exceptions with ARC
from sealers they actually trust [liu2023] [powerdmarc2025] [wang2022b].
Pepsi: Partly addressed. Impact: low.
Pepsi forwards in three ways: aliases expanding off-site
(pepsi-stage-aliases), ~/.forward
(pepsi-stage-dot-forward), and mailing lists. In the
configuration that pepsi-setup --wizard writes, all forwarded mail leaves
through pepsi-stage-srs. The stage rewrites the envelope into
SRS_DOMAIN for any non-null sender whatever the message’s DMARC result
(pepsi-stage-srs/src/lib.rs; a sender already at that domain is left as it
is), so Pepsi’s own IP passes that domain’s SPF at the next hop. Ingress is
fail-open where DMARC_ENFORCE is off. If SRS_DOMAIN were the primary
served domain, mail forged as someone@ that domain and sent to any address
that this host forwards would therefore leave with an SRS envelope at the same
domain. That is an aligned SPF pass, and so a DMARC pass: the LaunDroMARC
attack. The SRS domain therefore has to be a dedicated domain that is not
DMARC-aligned with any served domain. pepsi-setup refuses an
SRS_DOMAIN that is a served domain, a subdomain or parent of one, or shares
its last two labels with one (check_srs_alignment, using
pepsi_common::auth::org_aligned), unless the operator sets [pepsi-srs]
ALLOW_ALIGNED_DOMAIN = yes. The wizard has no derived default and asks for
such a domain, and pepsi-setup prints the MX and SPF records that the
operator publishes for it. A forwarded forgery then
still passes SPF, but for a domain that does not align with its From:, so
DMARC at the next hop rests on the author’s own DKIM signature, which a forgery
does not have and a faithful forward keeps. The aligned DKIM signature that
the relay signing stage adds on the same path is withheld for mail that failed
DMARC on arrival (see Forwarders DKIM-sign spoofed mail for the domains they host). Lists hold
posts that fail DMARC, which is Liu’s fix for them. The posting chain of
pepsi-stage-list-post has a rule of Pepsi’s own,
dmarc-failure. On a list whose hold_dmarc_failures setting is on, it
holds for moderation every post whose ingress DMARC verdict is fail,
whatever policy the poster’s domain publishes (p=none included) and whether
or not the poster is a member. The rule runs before any header match could
accept the post (Mailing lists hold posts that failed DMARC). A failure that a trusted ARC
sealer vouched for counts as a pass, and a moderator’s Approved: password
releases a held post as it releases every other. The setting is on for every
list that Pepsi creates. The importers set it off for a list that they create
from GNU Mailman 2.1 or 3, since Mailman holds no such post, so a migrated list
behaves as it did until its owner turns the setting on
(Settings Pepsi invented).
Pepsi avoids the other variants. It has no “trusted forwarder” exception, its
forwarders never rewrite From: (except a list’s DMARC munge_from), and
the inbound ARC stage seals the real results, cv=fail included. A
.forward requires a Unix account, so there is no open forwarding for
strangers. The dkim_required whitelist gate does, however, accept ARC pass
from any sealer (Trusting ARC chains from arbitrary sealers launders authentication).
Two residues remain, both an operator’s choice. An operator who sets
ALLOW_ALIGNED_DOMAIN = yes (for a host that cannot have a second domain) keeps
the SPF route open unless the served domain’s DMARC record closes it: with an SRS
domain other than the served domain itself, aspf=s does; for any aligned SRS
domain, p=quarantine or p=reject with DMARC_ENFORCE = yes does,
because a forgery of a served domain is then refused at ingress. pepsi-setup’s
warning names both, and pepsi-setup check reads the live record and reports an
SRS alignment [MISMATCH] until one is in place (srs_alignment_closed).
The other residue is a list with hold_dmarc_failures = no, either an imported
one or one whose owner preferred not to moderate mail from domains with broken
authentication. Such a list still turns a forged post from a member address at a
p=none domain into list mail that authenticates.
96.4.3.10. Forwarders DKIM-sign spoofed mail for the domains they host¶
A provider that holds DKIM keys for its customers’ domains, or signs everything
it forwards with its own key, can attach a valid signature to a message that
never authenticated. Shen et al. found in 2021 that Alibaba Cloud, Office 365
and Yahoo DKIM-signed every forwarded message (attack A10). Combined with
forwarding to unverified addresses (A9), an attacker could launder a spoofed
message into one carrying a legitimate signature of the provider, which passes
DMARC for addresses at that provider. They asked that the DKIM standard forbid
adding a signature to forwarded mail that did not pass verification [shen2021].
Liu et al. found that iCloud, Hushmail and Runbox, which manage keys for hosted
domains, added a signature in the name of the From: domain when
forwarding a spoofed message whose From: was one of their hosted domains, so
that the forgery left with an aligned DKIM signature. iCloud and Hushmail stopped
forwarding DMARC-failing mail; Runbox did not change [liu2023].
Pepsi: Addressed. Impact: none.
The wizard asks “DKIM-sign mail this host forwards, as this host’s own domain”
(SIGN_RELAYED, default yes) and, if the answer is yes, inserts a second
pepsi-stage-dkim-sign instance, [stage-dkim-sign-relay] with
SIGNING_DOMAIN set to the primary domain, after pepsi-stage-srs on the
inbound relay tail (pepsi-setup/src/wizard.rs). A stage that signed whatever
reached it would give a spoofed message whose From: is at the primary domain
or one of its subdomains an aligned DKIM signature – Shen’s A10 for the host’s
own domain. pepsi-stage-dkim-sign therefore advances such a message unsigned
(vouches_for_forgery): one that came from outside (not local_origin),
carries the ingress DMARC verdict, passed neither DMARC nor aligned DKIM, and
whose From: aligns with the signing domain (or cannot be read strictly). A
signature in the name of the author’s domain therefore only vouches for mail that
the domain sent. Mail submitted here and mail that Pepsi composes itself (DSNs,
notices, list copies) carry no ingress verdict and are signed. Forwarded mail from
other domains is not signed by us at all: the signing daemon signs only for a
From: aligned with d= (pepsi-dkim), so the relay signer
passes such mail on unsigned, with whatever signatures its author’s domain gave
it, and mail forged as other domains gets no signature of ours either. One case is
left to the list’s posting policy rather than the signer: list copies carry no
ingress verdict, so a list hosted here still re-signs a poster’s forged From:
at a hosted domain; Mailman’s posting rules and DMARC_ENFORCE decide whether
such a post is accepted at all. The SPF half of the laundering is assessed in
Forwarders, relays and lists launder spoofed mail into authenticated mail.
96.4.3.11. Authenticated accounts and tenants may send as any From address¶
SMTP does not bind the authenticated submitter, the envelope MAIL FROM and the
From: header to each other, and SPF and DKIM authenticate the
infrastructure, not the customer. A submission server that signs whatever an
authenticated account hands it therefore lends its reputable IP addresses and its
DKIM key to a forgery. Chen et al. found seven of eight tested providers accepting
a From: that did not belong to the account, either outright (Fastmail) or
through a second From: field or mailbox that the check missed; even with
strict checking, a message signed once could be replayed with an extra From:
[chen2020]. Shen et al. found 14 services letting users set an arbitrary
From: and some products (Zimbra and EwoMail by default) any MAIL FROM in
the domain [shen2021]. The multi-tenant form is CERT/CC VU#244112 (CVE-2024-7208,
CVE-2024-7209): a hosting provider whose IP addresses are in every customer’s
shared SPF include, and which DKIM-signs for them, lets one customer send as any
other customer’s domain with DMARC passing [certcc2024a].
The same cause appears whenever a relay authorises a network rather than a
sender. In the 2024 “EchoSpoofing” campaign, Proofpoint relays admitted all of
Microsoft 365’s shared outbound ranges, so any Exchange Online tenant could inject
mail with a forged customer From:, which the relay DKIM-signed with the
customer’s key – millions of messages a day for brands such as Disney and IBM, all
passing SPF, DKIM and DMARC [guardio2024a]. Microsoft 365’s “Direct Send” accepts
unauthenticated SMTP from anywhere for an internal recipient and any internal
From:; a 2025 campaign used it against over 70 organisations, and because the
traffic looked internal it was delivered despite failing SPF and DMARC
[varonis2025]. The fixes are the same throughout: restrict MAIL FROM and every
From: mailbox to what the authenticated principal owns, authorise the specific
customer or tenant rather than an IP range, and enforce DMARC on internal-looking
mail too.
Pepsi: Partly addressed. Impact: low.
For SASL and local-socket submitters, ingress enforces RFC 6409 section 6 on both
identities (pepsi-ingress, A local shell user): MAIL FROM must
be permitted by USERNAME_MAP (envelope_allowed), every mailbox of the
From: field must be permitted (pepsi-ingress/src/smtp/session.rs), a
message with two From: fields is refused with 550 5.6.0, the address is
located the way a mail client locates it (comments and quoted strings skipped), a
user absent from the map may use only username@HOSTNAME, an alternate
address gets a Sender: that replaces any client-supplied one, and a From:
whose display name or comment shows the reader a different address than the
mailbox ("ceo@victim" <me@ours>) is refused as well (550 5.6.0,
pepsi_common::indicator::display_name_claim). Over-signing every field
of SIGNED_HEADERS (pepsi-common/src/sign.rs), From and Subject
among them, stops the A18 replay of a signed message with an added From:. These close the account-level attacks of
[chen2020] and [shen2021]; see Multiple or duplicate From headers evade DMARC and DKIM checks and
Ambiguous From headers checked as one address and displayed as another. A wildcard grant (*@example.org)
deliberately lets an account send as every colleague in that domain, though not
register keys for them.
Sessions authenticated by MYNETWORKS or by a TLS client certificate carry no
USERNAME_MAP grant. The optional [pepsi-ingress] SENDER_MAP file names,
for each network (most specific match) or certificate (cert: plus the hash of
a key pinned in TLS_AUTH_CLIENT or of a CA listed in TLS_AUTH_CLIENT_CA),
the addresses that it may use. A session that the file binds passes the same
MAIL FROM and From: checks as a mapped account
(pepsi-ingress/src/sender_map.rs). An address that one line names exactly is
out of every other line’s wildcard. Ingress refuses to start on an error in the
file, so a mistyped line cannot silently leave its network unbound, and
pepsi-setup warns about keys that no listener can match. A client certificate
that the file does not bind authenticates nothing, and pepsi-setup validate
refuses a pin or CA that the file leaves unbound. A CA-issued certificate counts
only on a full RFC 5280 path to a configured CA whose revocation lists have been
fetched (pepsi-ingress/src/smtp/clientcert.rs), and one that names a mailbox
may send as that mailbox alone (Over-broad client-certificate trust and missing issuer and key-usage checks).
For networks the binding is not optional. A MYNETWORKS entry outside
loopback that no network key of the file covers whole is refused: ingress does
not start, and pepsi-setup validate fails and names the entry
(check_bound_trusted_networks in pepsi-ingress/src/sender_map.rs). A
shared network (a cloud range, a NAT) therefore cannot be admitted by omission
to send as any address, which is the shape of EchoSpoofing and CVE-2024-7209. A
bare * binding states that intent explicitly. Loopback is this host and is
exempt, and the wizard keeps MYNETWORKS to loopback and only on request
(TRUST_LOOPBACK, default no). pepsi-setup also warns about a bound
entry wider than one host. The residue is that the binding is decided at
ingress and believed downstream, so a compromised stage can still get any
From: signed (A compromised component).
Direct Send has no analogue: unauthenticated mail from outside is never
local_origin, but whether a forged From: at a served domain is refused
depends on DMARC_ENFORCE, which the wizard writes and the code defaults off
(Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment)). A forgery that is accepted does not
look internal: with no DMARC pass and no aligned DKIM or SPF pass behind it, ingress
marks it X-Pepsi-Warning: served-domain-not-authenticated and puts
TAG_EXTERNAL ([external]) at the front of its subject, after removing
any copy of the tag the sender wrote (pepsi-ingress/src/external.rs).
Apart from switched-off enforcement, what remains needs an explicit grant by
the operator or a compromised component. Such a grant is a wildcard in
USERNAME_MAP or SENDER_MAP, a * binding, or loopback trusted through
TRUST_LOOPBACK.
96.4.3.12. Trusting ARC chains from arbitrary sealers launders authentication¶
ARC (RFC 8617) lets each intermediary sign the authentication results it saw so
that a later receiver can excuse a DMARC failure caused by forwarding. A valid chain
proves only which sealers handled the message, not that any of them is honest, and
it records that a hop changed the message, not what it changed. Any party can
therefore run its own “forwarder” and seal a set claiming dmarc=pass. Wang and
Wang showed in 2022 that Zoho let such self-made seals remove its spoofing warning
for p=none domains and deliver p=quarantine spoofs to the inbox, while
Gmail, Outlook and Fastmail were not influenced [wang2022b]. Liu et al. found Zoho
reading Gmail’s and Fastmail’s ARC headers as a DMARC pass, so anyone with a
Fastmail account (which forwards DMARC-failing mail from allow-listed senders and
seals it) could deliver spoofs of any domain to Zoho users; Zoho fixed it and paid a
bounty [liu2023].
Restricting trust to allow-listed sealers does not suffice either. The 2025 experiment-conclusion draft reports that attackers took a message once sealed by a trusted intermediary, modified it and passed it on, and receivers could not tell whether the changes came from the trusted sealer or from someone later. With only about 10,000 domains sending ARC at all and no reputation system for sealers, the draft recommends treating ARC as diagnostic only, moving RFC 8617 to Historic and pursuing replay protection in DKIM2 [draft-adams-arc-experiment-conclusion].
Pepsi: Addressed. Impact: low.
Pepsi lets ARC influence two decisions, and both are bounded. Ingress enforces
DMARC (under DMARC_ENFORCE) and lets an ARC chain override a failure only
when two conditions hold: the chain validates, and the d= of its newest seal
is in [pepsi-ingress] ARC_TRUSTED_SEALERS, which is empty by default.
Validity is the result recomputed from the signatures, never the cv= tag. A
self-sealed chain, a chain sealed last by an unlisted hop, or an unlisted hop
sealing over a trusted one overrides nothing (Authenticator::arc_vouches).
In pepsi-stage-check-whitelist, an ARC pass satisfies
dkim_required only together with a DMARC pass
(pepsi_common::whitelist::from_domain_authenticated), which closes the
attack of [wang2022b] and [liu2023] that uses a self-sealed forwarder.
state.auth.arc_sealers is consulted only when the chain validated
(trusted_sealers).
The sealer_domain condition could be exactly the trust model that the draft
describes as broken. A row with sealer_domain matches when the named ADMD is
anywhere in state.auth.arc_sealers. RFC 8617 validation checks every
ARC-Seal but only the latest ARC-Message-Signature, and so does
verify_arc in the vendored mail-auth; the earlier seals sign only ARC
header fields. So an attacker who obtained any message sealed by the trusted list
or forwarder could rewrite its From: and body and append a set of their own. A
list of all sealers in the chain would still name the trusted domain, so the row
would match, set state.spam = false and let the message skip the payment or
confirmation gate. The list therefore holds only sealers that signed these bytes:
Authenticator::vouching_sealers in pepsi-common/src/auth.rs verifies each
instance’s own ARC-Message-Signature (verify_arc_ams, a Pepsi patch to the
vendored mail-auth) and drops every sealer whose signature does not verify, so
a lifted set does not name its ADMD. The cost is that a later hop that
legitimately rewrites the message (a subject tag, a footer) also drops the earlier
sealers, which is right, since that hop could have rewritten anything. What
remains is the inherent part: a trusted sealer vouches for whatever it sealed, so
a sealer_domain row is only as good as that ADMD’s own filtering. Pepsi’s own
seal is fail-open and records honest results; see
ARC implementations record wrong results or seal incompletely.
96.4.3.13. Intermediary modifications to signed mail cannot be attributed¶
Forwarders and mailing lists legitimately change messages (subject tags, footers, transfer-encoding conversions), and neither DKIM nor ARC records what was changed. A DKIM signature is either intact or broken; an ARC seal lets an intermediary make arbitrary changes and still present the result as the original under its own signature, and after several modifying hops a receiver cannot tell which party changed what. DKIM’s selective header signing also leaves room for header stuffing, where unsigned extra copies of a field are added. The DKIM2 working-group motivation document therefore proposes that each modifying hop record how to undo its change, so a receiver can recover and verify earlier versions, and that a fixed set of header fields be signed, every copy included [draft-ietf-dkim-dkim2-motivation]. Until then, altered content inherits the credibility of the signature that covered the original, or of the intermediary that re-signed it.
Pepsi: Vulnerable. Impact: low.
This is a limitation of the deployed standards, and Pepsi has no DKIM2
implementation. Pepsi itself modifies mail in transit: the vacation subject tag,
list footers and From: rewriting, MIME downgrades, the rewrite of ambiguous
MIME to its one standard reading (MIME_ANOMALIES), the [external] subject
tag, decryption and the removal of forged indicators. It covers the result with
its own ARC seal or DKIM signature, which says nothing about the change; the
manual states where a rewrite breaks the originator’s signature
(pepsi-stage-vacation, pepsi-stage-arc). The
header-stuffing part is closed for what Pepsi signs: its DKIM signature and its
ARC message signature over-sign every field of their default header lists, present
or absent, so adding a copy later breaks the signature
(pepsi-common/src/sign.rs). As a verifier, ingress refuses a second From:
(Multiple or duplicate From headers evade DMARC and DKIM checks), and inbound signatures with an
l= body-length tag do not verify (the strict mail-auth parse, pinned by a
test in pepsi-common/src/auth.rs). Attribution of changes needs DKIM2 to be
standardised and deployed (ietf).
96.4.3.14. 8BITMIME downgrade in transit breaks DKIM signatures¶
A message accepted with 8-bit content must be converted to a 7-bit transfer encoding before it is relayed to a hop that does not advertise 8BITMIME, and the conversion changes the body and so invalidates the DKIM body hash. RFC 6376 asks signers to convert to 7-bit before signing, but Ullrich found large senders (PayPal, Booking.com) signing 8-bit bodies, and large receivers and filtering services (1&1/Web.de/GMX, AOL, Mimecast, Spamfence) not supporting 8BITMIME, so legitimate mail lost its signature in transit and could be treated as spoofed [ullrich2021]. It is not an attack, but it erodes DKIM as a spoofing signal and pushes receivers to tolerate failures. The fix is on the signer’s side: send 7-bit clean mail with short lines before signing.
Pepsi: Partly addressed. Impact: low.
Pepsi follows the RFC 6376 advice for its own signatures.
pepsi-stage-dkim-sign converts an 8-bit body to quoted-printable
or base64 before signing (pepsi_common::sign::seven_bit_for_signing, the same
conversion that the outbound SMTP client in pepsi-common/src/smtp/client.rs
applies per hop after EHLO), so the relay finds nothing to re-encode for a hop
without 8BITMIME and Pepsi’s signature survives. pepsi-stage-encrypt does the
same before an OpenPGP or S/MIME signature, as RFC 3156 section 5 requires. The
conversion is skipped where another signature already covers the 8-bit bytes (the
author’s DKIM signature, Pepsi’s ARC AMS, a multipart/signed part),
because converting would break those signatures on every hop to protect Pepsi’s
signature on the rare hop without 8BITMIME. Those relayed third-party signatures
are still broken at such a hop, which is unavoidable, since capabilities are only
known at relay time. The affected traffic is small, since few MX hosts still lack
8BITMIME, and the failure is a lost signature (DMARC may still pass on SPF), not a
forgery.
96.4.3.15. Sender whitelists bypassed by a forged From address¶
A whitelist keyed on the sender address trusts a value that SMTP does not authenticate. A spammer who does not know the list can still forge an address that is very likely on it, most obviously the recipient’s own [garriss2006]. Malware on a compromised machine harvests addresses from its owner’s address book and stored mail, so the forged sender is usually a third party that the victim corresponds with [herzberg2005]. Román et al.’s challenge-response filter delivers mail from white-listed addresses and from recently contacted ones (the “reply-list”) without any check. A domain-only reply-list mode, needed for mailing lists, widens this to any address at the domain, and bounces that quote a Message-ID from the reply-list are accepted, although an observer can forge them [roman2005]. Spam or phishing then lands in the inbox past the content filters. All three works conclude that the whitelist has to be bound to an authenticated identity: signed per-message tokens in RE: [garriss2006], a sender’s public key [herzberg2005], or DomainKeys or identity-based signatures [roman2005].
Pepsi: Partly addressed. Impact: low.
pepsi-stage-check-whitelist matches the addr-spec of the first
From: mailbox (comments and quoted strings removed; a multi-mailbox From:
matches nothing), and a row can demand authentication. dkim_required needs a
DKIM signature aligned with the From: domain (dkim_token in
pepsi-common/src/auth.rs turns an unaligned pass into fail) or an ARC pass
together with DMARC. dmarc_required needs any aligned DMARC pass (aligned
DKIM or aligned SPF) or a trusted ARC sealer’s override; it binds a
correspondent whose domain does not sign to an authenticated identity all the
same. signature_required needs a signature that
pepsi-stage-decrypt verified against a trusted key. A row with
several requirements needs all of them (Whitelist rows demand an authenticated sender).
dkim_required is the default for rows written by
pepsi-stage-auto-whitelist and by pepsi-whitelist add
(pepsi-whitelist). It is also the default for the list-id
rows that a user confirms at a pepsi-whitelist import prompt, or that
pepsi-stage-auto-whitelist learns when the user answers a list’s
subscription confirmation request. A reply to anything else teaches the stage
nothing, and a learnt row expires once the list stops delivering authenticated
postings that match it. The auto-whitelist stage writes dmarc_required as
well (DMARC_REQUIRED, on by default). Forging the recipient’s
own address needs our own domain’s DKIM key. Bounces are not matched against a
reply-list; a null-sender message passes the payment and confirmation gates only
with a valid Pepsi-Origin proof (but see Forged delivery status and disposition notifications).
A correspondent whose domain authenticates only through SPF is not pushed into a
row without a requirement: pepsi-stage-secretary under
DKIM_REQUIRED = auto (the default) writes dmarc_required for a sender
whose held mail passed DMARC but not DKIM, pepsi-whitelist add
--dmarc-required writes it by hand, and a forged From: naming that sender
fails DMARC and does not match.
What remains is every row without an authentication requirement, each of them an
explicit choice: the operator’s --no-dkim-required without
--dmarc-required, DMARC_REQUIRED = no beside DKIM_REQUIRED = no, a
secretary confirmation of a sender whose held mail passed neither DKIM nor
DMARC (its domain publishes no DMARC record), or a list-id row with no
sealer_domain. Anyone who guesses such an address can forge it and skip the
gate wherever the forgery is not refused at ingress: under DMARC_ENFORCE =
no (the compiled-in default; the wizard writes yes), or for a domain
without an enforcing DMARC policy (Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment)).
ARC-based rows have their own flaw (Trusting ARC chains from arbitrary sealers launders authentication).
96.4.3.17. Proof-of-work and sender-pays postage fail to price out spammers¶
Proof-of-work postage (Dwork-Naor pricing functions, Hashcash) makes each message cost the sender computation. Abadi et al. showed that CPU-bound puzzles vary by one to two orders of magnitude across machines, so a cost that deters a spammer on fast hardware is prohibitive for a legitimate user on a slow device; they proposed memory-bound functions, whose cost varies only by a factor of two to four, and noted that providers could simply agree to skip the work between themselves [abadi2003a]. Laurie and Clayton’s economic analysis is more fundamental: spammers compute on compromised machines whose cycles are free to them. Holding spam to 1% of legitimate mail with about a million bots would need a puzzle of about 346 seconds per message, which would also stop 0.13 to 1.56% of an ISP’s customers each day and up to 13% in their busiest hour [laurie2004].
Replacing computation by money moves the problem rather than removing it. MailCoin pays the recipient through a Bitcoin-derived currency, but works only if many users adopt it, must track a volatile exchange rate, and exposes correspondence on a public chain [grottenthaler2017]. A pure per-message cost therefore does not stop an attacker who controls other people’s resources, and adoption limits any scheme that asks every sender to pay.
Pepsi: Partly addressed. Impact: low.
Pepsi uses no proof-of-work. Its pay-to-send gate
(pepsi-stage-anti-spam) asks an unknown sender for a real GNU Taler
payment to the recipient’s merchant, priced by the operator in an ordinary currency
(ORDER_CHOICES), and records nothing on a public ledger. The arguments about
hardware disparity, about providers skipping the work and about volatility
therefore do not apply. Bot cycles are not money either. What carries over is the
economics of [laurie2004] in a new form. A spammer pays if they control
compromised accounts with wallets or value a few targeted deliveries above the
price, and the gate only protects Pepsi’s own recipients, so it cannot change the
sender market [grottenthaler2017]. Legitimate senders
without a Taler wallet are the adoption cost; Pepsi lowers it with the correspondent
whitelist and the confirm-to-send alternative
(pepsi-stage-secretary), but a sender who neither pays nor confirms
is refused at the deadline. Both limits are inherent in the approach. How
auto-pay bounds what a compromised Pepsi account can spend is discussed under
Postage stamps stolen, depleted or reused in stamp-based anti-spam.
96.4.3.18. Postage stamps stolen, depleted or reused in stamp-based anti-spam¶
Schemes in which a sender buys stamps from a quota or a central service and attaches them to messages create a bearer token that can be stolen or devalued. Walfish et al. (DQE) observed that bots can spend their owners’ stamp quotas (about 10 million extra messages a day for a 100,000-host botnet) and that a compromised relay can copy fresh stamps from passing mail and spend them first, so the legitimate messages then arrive with cancelled stamps. In their distributed enforcer, faulty nodes allow some reuse and a lying entry node (“portal”) can call every stamp fresh [walfish2006]. Goel et al.’s CentMail certifies a charity donation per message digest, and its value is diluted by every verification query, which anybody who holds the digest may make. An eavesdropper or co-recipient can thus deplete a sender’s stamp, malware can buy stamps from the victim’s balance, and a reversed payment yields free stamps. They propose listing the intended recipients at certification and counting only their queries [goel2009].
Pepsi: Partly addressed. Impact: low.
The recipient side has no stamp to steal or deplete. pepsi-stage-anti-spam creates one merchant order per held message, with the order id equal to the queue row’s token; the stage itself asks its own merchant backend over HTTPS whether that order was paid, so a third party can neither reuse the payment for another message nor dilute it, and there is no distributed enforcer or portal to lie. Payments go to the recipient, not to a ticket that travels in the message.
The sender side has the theft analogue. pepsi-stage-auto-pay pays
a returning payment demand automatically, from the user’s or a shared wallet, when
the demand carries a valid Pepsi-Origin proof (The Pepsi-Origin: proof-of-origin header).
Every recipient of one of our messages holds such a proof, including list members,
Bcc recipients and anyone to whom the message was forwarded. Each of them can
demand up to MAX_TOTAL per message from a merchant of their choice, and k
messages yield k times that. MAX_TOTAL_PER_DAY caps the wallet’s daily
loss, and it is required wherever MAX_TOTAL is non-zero: the worker refuses to
start and pepsi-setup validate refuses the configuration without it
(pepsi-stage-auto-pay/src/config.rs). An e-mailed settings override may change
neither option unless the operator sets UNRESTRICTED_UNSAFE_STAGES
(pepsi-stage-edit-settings), since the same password authenticates
the control message. A compromised Pepsi account that sends spam to pay-to-send
recipients spends its wallet up to the same budgets. The wizard writes MAX_TOTAL
= KUDOS:0 and MAX_TOTAL_PER_DAY = KUDOS:0, so paying is off until an
operator enables it. What remains is one day’s budget per wallet, which the
operator chooses.
96.4.3.19. Greylisting and nolisting bypassed by retrying spam senders¶
Greylisting temporarily refuses the first delivery attempt from an unknown (client, sender, recipient) triplet and bets that spam software will not retry; nolisting publishes an unreachable highest-priority MX and bets that it will not try the others. Both only test whether the sender behaves like a compliant MTA. RFC 6647 notes that a sender retrying within the window, or sending often enough to keep its record alive, passes; that NAT exempts every MTA behind an address once one has passed; that manual exemptions give their sources privileged access; and that reply text naming greylisting tells spamware when to retry [rfc6647]. Pagani et al. measured in 2016 that Kelihos retries after 300 seconds, the default threshold of popular greylisting software, and still got through against a six-hour threshold, while Cutwail and Darkmailer defeat nolisting by trying the MX hosts in order; each family evaded one technique but not both. Greylisting also delayed half the greylisted messages at a university by over ten minutes, and some webmail providers retried from other addresses or gave up after 30 minutes [pagani2016].
Pepsi: Not applicable. Impact: none.
Pepsi implements neither technique; the decision and its reasons are recorded in
contrib/no-greylist.md and listed in docs/ROADMAP.md, and pepsi-setup
prints an ordinary MX set. The wizard can wire a detected milter-greylist as a
post-queue pepsi-stage-milter stage, but offers it with a default of
no and explains why it cannot work there: post-queue there is no SMTP client to
refuse, and Pepsi itself is what retries, so the bet is always won and only the
delay remains (The Wizard). Pepsi’s own gates (payment, confirmation, whitelist)
do not depend on the sender’s retry behaviour.
96.4.3.21. Adversarial evasion of content-based phishing and scanning classifiers¶
Content classifiers decide on known-bad words and patterns and cannot judge intent, so new text built from benign words passes them, and an attacker with feedback can learn what triggers them. Palka and McCoy generated phishing from a grammar and dropped productions that were filtered: against a corporate environment of over 20,000 users (Cisco IronPort, Outlook with a McAfee add-in) and against SpamAssassin trained on about 795,000 messages, detection fell from about 15% to 0% within three rounds of 100 messages, and Gmail did not flag the output either [palka2015]. The same holds for perceptual hashes and machine-learning classifiers used for client-side scanning: Apple’s NeuralHash was reverse engineered within two weeks, imperceptible perturbations make 99.9% of images evade detection, and second preimages let an attacker make innocuous content match, to frame a victim or flood the system with false alarms. Abelson et al. see no robust fix [abelson2021].
Pepsi: Partly addressed. Impact: low.
Pepsi has no client-side scanning and no learned content classifier of its own, and its primary gates (whitelist, payment, confirmation) do not read message content, so rewording a message does not get it past them. Two content filters can exist in a deployment. pepsi-stage-block-language filters by detected language, which a sender evades by writing in an accepted one; it is a convenience, not a security boundary. Spam-scoring milters (SpamAssassin, rspamd) attached through pepsi-stage-milter are subject to exactly the evasion measured here, and when they sit ahead of the whitelist check (the wizard’s default order, Spam filters and the secretary) they decide what reaches the gates at all. The residue is inherent in content filtering; Pepsi’s mitigation is that a message which evades the filter still meets a gate that keys on the sender, not the text. Related concealment tricks are covered in Content concealed from spam filters (HTML/CSS, invisible chars, bad QR).
96.4.3.22. Missing, malformed and unreliable DMARC aggregate and failure reports¶
DMARC’s reporting is how a domain owner learns that its domain is abused and when
it is safe to move from p=none to p=reject. Hureau et al. tested 25 e-mail
service providers in 2023 and analysed 40,157 aggregate reports received over 19
months. Only 6 providers sent aggregate reports, and none sent failure reports
(commonly for privacy reasons). Of the reports received, 94.93% violated the RFC
7489 XML schema, partly because the RFC’s namespace points to a second, different
schema, and many report subjects did not follow the specified syntax
[hureau2024a]. Domain owners therefore lose the feedback they need and automated
processing gives inconsistent results. The authors call for a redefined reporting
strategy and one aggregate format across DMARC versions.
Pepsi: Partly addressed. Impact: low.
As a receiver, Pepsi is one of the providers that send nothing: ingress evaluates
DMARC (pepsi-common/src/auth.rs) but neither aggregate nor failure reports are
generated anywhere in the tree, although Pepsi does send TLS reports
(pepsi-tlsrpt). Pepsi does help the operator as a domain owner.
pepsi-setup validates the published DMARC record strictly and warns when it
has no rua= tag, since “no aggregate reports are sent and the policy cannot
be” tuned (pepsi-setup/src/dmarc.rs). The starter record that it suggests
carries rua=mailto:dmarc-reports@<domain>, and
pepsi-stage-dmarc-report reads the aggregate reports that arrive
there into a verdict per domain, so no outside tool is needed
(pepsi_common::dmarc_report). It reads gzip, zip or plain XML and skips
elements that the parser does not know, so a report that strays from the schema
still counts. Failure reports arriving there are not read. What remains is the
receiver side: Pepsi adds nothing to the reports that a domain owner gets, by
design, because sending aggregate reports would need the destination verification
and rate limits discussed under DMARC reports sent to unauthorised, foreign or unregistered destinations and
DMARC, TLS-RPT and DKIM failure reports as reflection floods, and failure reports stay off for the privacy
reasons that the paper cites. The missing and malformed reports are a matter for
the providers that send them and for the standard’s reporting format; nothing
further is left for Pepsi’s code.
96.4.4. Missing or incorrect checks¶
A signature, certificate, policy or input that is not checked, or checked wrongly.
96.4.4.1. Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment)¶
Sender authentication protects only where receivers act on it, and many favour
delivery over security. In 2015 Foster et al. found that 14 of the providers they
tested verified something but only 5 enforced it; of the top five only Hotmail
marked an invalid DKIM signature as spam [foster2015]. Hu and Wang got forged mail
into the inbox at 34 of 35 providers in 2018, at 94.2% for those doing no checks,
with no significant difference between full DMARC checking and SPF/DKIM only; six
providers delivered some spoofs of p=reject domains [hu2018]. Deccio et al.
found that just over half of the measured domains validated all of SPF, DKIM and
DMARC, and that SPF validators widely ignored the lookup and void-lookup limits,
syntax errors and duplicate records, while only 5% checked HELO [deccio2021]. In
2023, 27.13% of domains with MX records made no SPF query at all for a forged
message [zhang2023a], and Hotmail and 163 delivered mail from domains without SPF or
DMARC as normal mail [zhang2023].
The failures persist at the largest providers and in the details. In 2020
Microsoft’s own filtering delivered mail forging microsoft.com despite its
p=reject policy [ironscales2021]; Outlook and Yahoo whitelisted a sender
address that the user rescued from the spam folder, so later forgeries with a
broken SPF record reached the inbox [maroofi2020]; providers evaluated the SPF
ptr mechanism inconsistently and some delivered mail that the policy
explicitly forbade [arouna2025]; and Proton Mail, Naver, Seznam and Tuta passed
mail that violates aspf=s strict alignment (all but Seznam fixed it)
[hamza2026]. Domain owners should publish strict policies, but only receivers can
make them mean something.
Pepsi: Partly addressed. Impact: low.
Pepsi verifies correctly and a new installation enforces. Ingress runs SPF, DKIM
and DMARC through the vendored mail-auth (ten-lookup limit and a 20-second
budget for SPF, HELO used for a null sender, adkim/aspf strict alignment
implemented and tested), strips Authentication-Results fields claiming its own
authserv-id, and records the verdicts in state.auth. It rejects a definite
DMARC failure for a p=quarantine or p=reject domain under
[pepsi-ingress] DMARC_ENFORCE, which the wizard writes as yes for every
new installation. The compiled-in default is no, so pepsi-setup warns
about a configuration that receives mail and leaves the option unset, and about
one that has it off while a served domain’s own record asks receivers for
p=reject or p=quarantine. An operator who switches it off accepts mail
that forges any domain, the deployment’s own included, with an honest
Authentication-Results field that most mail clients do not show. Such mail is
marked where the reader looks. A DMARC failure that was not acted on (enforcement
off, or p=none) gets X-Pepsi-Warning: dmarc-fail-not-enforced, and a
From: at a served domain that nothing authenticated gets
served-domain-not-authenticated. Either warning puts [external]
(TAG_EXTERNAL) at the front of the subject, after any forged copies of the tag
are stripped (pepsi-ingress/src/external.rs). The threat model states this
(A remote sender) and the hardened profile lists the option
(The network adversary). The forwarded and list mail that enforcement would cost is
handled the way the large mailbox providers handle it: a failing message is
accepted when it carries a validating ARC chain whose last sealer is named in
ARC_TRUSTED_SEALERS, a list that the operator curates and that is empty by
default, since an unknown sealer proves nothing (Authenticator::arc_vouches;
the sealer lands in state.auth.arc_override). The log helps the operator fill
the list: every refusal names the last sealer of the refused message’s ARC chain,
arc-sealer=<domain> when the chain validates. An SPF -all failure without
DMARC has no effect, and a forged domain without records is treated like any
unknown sender. What limits the damage where enforcement is off is that Pepsi’s
spam gates never treat a failing message as known: the whitelist needs an aligned
DKIM pass for dkim_required rows, and the payment and confirmation gates hold
unknown senders.
Smaller deviations are handled: the vendored mail-auth stops after two void
lookups (RFC 7208), and the whitelist’s dkim=pass token honours a published
adkim=s and applies its own relaxed parent/child alignment only where the
domain does not publish adkim=s. The ptr mechanism is pinned by tests in
the vendored copy for the four policy shapes that [arouna2025] found to be
evaluated inconsistently (ptr -all, ptr:<domain> -all, -ptr +all,
-ptr:<domain> +all): a name counts only when it is the target or a subdomain
of it at a label boundary and resolves back to the client, only the first ten
names of the PTR answer are considered, and a failed PTR lookup is no match rather
than temperror (RFC 7208 section 5.5). Two deviations of upstream
mail-auth are patched in the vendored copy: upstream counts the address
lookups of the PTR names against the ten-term limit, so a long PTR answer can turn
a later term into permerror, and does not match a PTR name equal to the target
when the resolver returns it with its trailing root label. Pepsi does not
whitelist sender addresses from user feedback, so the [maroofi2020] pattern has
no analogue. pepsi-setup suggests p=reject rather than p=none for the
deployment’s own domains, so receivers that do enforce refuse forgeries of them.
What remains is for operators. Forwarded and list mail that breaks DMARC without
ARC, or that comes through a forwarder that the operator has not listed, is lost
at an enforcing site, and the only remedy is to list the forwarder (which the log
names) or to switch enforcement off. See also Missing, invalid or non-enforcing DMARC policies leave domains spoofable.
96.4.4.2. Third-party DKIM signatures accepted for a spoofed From domain¶
DKIM lets any domain sign any message: the d= domain need not be related to the
From: domain, and a valid signature says nothing about whether the signer may
speak for the author. An attacker can therefore sign a spoofed message with a domain
of their own, or send it through a provider that signs for many customers, and a
receiver that checks only signature validity treats it as authenticated. Konno et al.
observed that about 80% of DKIM-signing domains in Japanese delivery data signed as
third parties for other From: domains, and that DMARC, which requires alignment,
was deployed by only 29% of domains in 2016; they proposed scoring each
(From: domain, signing domain) pair by its delivery history as a heuristic
[konno2017]. DMARC alignment closes the gap wherever it is evaluated.
Pepsi: Addressed. Impact: none.
No decision in Pepsi treats an unaligned DKIM signature as authenticating the
From:. Ingress computes the state.auth.dkim token with dkim_token
(pepsi-common/src/auth.rs), which reports pass only when a passing signature’s
d= aligns with the From: domain and downgrades an unaligned pass to fail;
DMARC itself uses aligned identifiers; and signatures that can align are verified
first, so padding a message with foreign signatures cannot push the relevant one past
MAX_DKIM_SIGNATURES. The whitelist’s dkim_required
(pepsi-stage-check-whitelist) relies on that token. The confirmation stage and VKS confirmation accept SPF or DMARC
but deliberately not DKIM alone. A third-party signature is still recorded in the
Authentication-Results field for what it is. Pepsi’s own signing domain is the
From: domain of locally submitted mail, so it signs as a first party.
96.4.4.3. Null MAIL FROM yields SPF none and escapes enforcement¶
With a null reverse path (MAIL FROM:<>), used by bounces, RFC 7208 requires
SPF to be evaluated on the HELO identity, and DMARC then uses that identity too.
Shen et al. found 13 services that instead returned SPF none for such messages,
so a forged message with an empty envelope sender turned an SPF fail into
none. On its own this does not pass DMARC, but it combines with other techniques
for a direct-MTA attacker; 17 services evaluated HELO correctly [shen2021].
Pepsi: Addressed. Impact: low.
The SPF part is addressed. mail-auth’s verify_mail_from falls back to the
HELO domain when the sender has no domain, and ingress passes the HELO identity to
DMARC as the “MAIL FROM” domain for a null sender
(Authenticator::checks), so a bounce is checked and aligned as RFC 7208 and RFC
7489 intend.
The “escapes enforcement” part has an analogue in Pepsi’s own gates. A bounce
must never be gated or bounced, so neither pepsi-stage-anti-spam
nor pepsi-stage-secretary asks a null-sender message to pay or to
confirm; both ask it instead for a valid Pepsi-Origin proof that it answers
mail that this host sent. The anti-spam stage routes a message without one to
BOUNCE_TARGET_STAGE, which the wizard wires to the discard-rejected sink,
and the secretary treats it as unchallengeable (UNCHALLENGEABLE_STAGE, else
deleted). A spammer who sends with MAIL FROM:<> therefore passes neither gate.
What is left is configuration: an anti-spam section written by hand without
BOUNCE_TARGET_STAGE still forwards such a message, and with proof of origin
switched off no bounce can be proven; pepsi-setup warns about both. The
details are under Forged delivery status and disposition notifications.
96.4.4.4. Forged delivery status and disposition notifications¶
Delivery status notifications (DSNs) and message disposition notifications (MDNs)
are ordinary, unauthenticated e-mail and can be forged as easily as any other.
RFC 3464 lists false delivery and non-delivery reports, forged
Final-Recipient or Remote-MTA fields, false “relayed” reports and
unsolicited DSNs. These mislead user agents and automatic consumers, for example
list managers that unsubscribe members on bounces, and the RFC only asks such
consumers to “take appropriate precautions” [rfc3464]. RFC 8098 adds forged
MDNs claiming that a message was read, and forged Disposition-Notification-To
requests in spam that trick a recipient into confirming an address. MDNs are no
proof of delivery and should be generated only for authenticated messages
[rfc8098].
Pepsi: Addressed. Impact: low.
Several consumers are protected. pepsi-stage-auto-pay acts on a
payment demand only with a Pepsi-Origin HMAC whose nonce is still tracked
(The Pepsi-Origin: proof-of-origin header); pepsi-stage-bounce never answers a
null-sender message and, with BOUNCE_UNAUTHENTICATED = drop, sends a DSN only
to an authenticated sender, so a forged return path draws no backscatter
(Bounces, auto-replies and MDNs reflected at forged return addresses). Pepsi generates no MDNs, and the
list stages strip Disposition-Notification-To from posts, so a forged request
cannot make a whole list confirm. pepsi-stage-list-bounce scores a
bounce against the member that a VERP address names only when the address carries
the authentication code that the fan-out wrote. That code is eight base32
characters of an HMAC keyed with [pepsi-list] VERP_SECRET over the list’s
bounces mailbox, the host and the member (pepsi_list::verp). The stage drops a
member-shaped address whose code is missing or wrong without scoring, forwarding
or answering it (logged, counted as list-bounce-verp-rejected); a probe’s
token is looked up rather than signed. BOUNCE_PROBES defaults on, so even
after bounces have been attributed and scored on five different days, the stage
sends a probe, and only the probe’s own bounce disables delivery.
The spam gates do not trust the null sender either. Both
pepsi-stage-anti-spam and pepsi-stage-secretary
let a message with MAIL FROM:<> through only with a Pepsi-Origin proof
whose nonce is still tracked. The payment gate routes any other such message to
BOUNCE_TARGET_STAGE, which the wizard points at the discard-rejected
sink; the secretary treats it as unchallengeable (UNCHALLENGEABLE_STAGE,
else deleted, since a bounce is never bounced). The genuine bounces that cannot
be verified (mail sent before the origin secret existed, auto-replies from
systems that strip the quoted headers, a report after the two-week nonce window)
are lost with the forged ones unless the operator points those options at a
quarantine stage. What remains is configuration, and pepsi-setup warns about
it: an anti-spam section written by hand without BOUNCE_TARGET_STAGE
forwards an unproven bounce past the payment gate, and with [pepsi-origin]
ENABLED = no nothing can be proven, so the secretary passes every bounce.
96.4.4.5. Mail-filter gateways bypassed by direct delivery or trusted relay IPs¶
Organisations increasingly route mail through a chain of third parties, for example a filtering or security gateway in front of a hosted mailbox, or a signature or archiving service between the sender and its outgoing server. Each link trusts the one before it, typically by nothing more than its IP address. Two failures follow. First, the MX record only directs well-behaved senders to the filter: unless the mailbox provider is told to accept mail for the domain from the filter alone, anyone can deliver straight to the provider and skip spam, phishing and attachment scanning. Rao et al. found that 80% of 1,601 domains behind one of 15 cloud filtering services accepted such direct delivery (78% of Exchange Online and 88% of Gmail configurations), partly because vendor documentation omitted the step or prescribed an Exchange connector setting that does not actually restrict the source, and because the provider’s host name is predictable or listed in the SPF record [rao2024]. Second, a middle node that trusts whole provider address ranges lets every tenant of that provider relay through it: in the EchoSpoofing campaign (2024), a security vendor’s relay accepted anything from Office 365 addresses and then signed and sent millions of phishing messages a day as its customers’ brands, passing SPF, DKIM and DMARC. Li et al.’s measurement of 105 million intermediate paths shows how common and concentrated such dependency chains are (96.8% of sender domains rely on third-party hosting for the path, Microsoft sits on about 70% of paths) [li2025b]. The fix is to accept mail only from the authenticated predecessor in the chain and never to grant trust to an address range shared with strangers.
Pepsi: Partly addressed. Impact: low.
Inside Pepsi there is no filter to go around: every message accepted by
pepsi-ingress enters the same stage graph, so the anti-spam, whitelist,
secretary and milter stages cannot be skipped by choosing a different entry
point, and ingress never imports another host’s Authentication-Results as
its own verdict. The analogue of EchoSpoofing is MYNETWORKS: a peer address
listed there is treated as an authenticated submitter with local_origin,
passes the inbound gates untouched and is DKIM-signed for our domains. The
threat model lists such hosts as trusted principals (Principals and how far each is trusted), the
wizard defaults TRUST_LOOPBACK to no, and Microsoft Exchange as a gateway recommends SASL
with a dedicated account and warns against ranges. Every MYNETWORKS entry
outside loopback must be bound, in the [pepsi-ingress] SENDER_MAP file, to
the addresses that it may send as: ingress refuses to start and pepsi-setup
validate refuses the configuration on an entry that no network key of the file
covers whole (check_bound_trusted_networks in
pepsi-ingress/src/sender_map.rs). A bound session passes the
USERNAME_MAP checks on MAIL FROM and From: (most specific network
wins), and an unbound client certificate authenticates nothing. Listing the
shared outbound ranges of a hosted service such as Exchange Online therefore
lets every tenant of that service send only as the bound addresses. For
Exchange Online, whose tenants all share those ranges, an
[pepsi-ingress-exchange-online-*] section replaces the address list with a
per-message proof of the tenant: exactly one X-MS-Exchange-CrossTenant-Id
field naming it and a verified DKIM signature by the From: domain
(Exchange Online: the tenant proof). What remains is configuration: a binding to *, which states the unrestricted
grant explicitly, hands every tenant the ability to send signed mail as the
organisation, exactly as in EchoSpoofing. It stays a documented decision, but
not a silent one: ingress at every start and pepsi-setup validate warn about
each MYNETWORKS entry outside loopback that is wider than one host and
whose most specific key is a bare *
(SenderMap::wide_unrestricted_networks).
The direct-delivery bypass applies when Pepsi is itself the gateway in front of
another mailbox system (the front-only and full-gateway topologies of
Microsoft Exchange as a gateway, pepsi-stage-route). Pepsi cannot stop senders
from reaching <tenant>.mail.protection.outlook.com directly, and the chapter
tells operators to accept the managed domains only from Pepsi
(a connector restricted to Pepsi’s addresses or certificate, a firewall, no
anonymous connectors, and the same for any MDA behind Pepsi), because mail
delivered directly skips decryption, the pay-to-send and secretary gates and the
whitelist. pepsi-setup warns when MYNETWORKS contains anything wider than
a single host outside loopback. Both remain operator duties that Pepsi cannot
enforce on the downstream system.
96.4.4.6. Innocent mail servers injected into DNS blocklists¶
DNS-based blocklists (DNSBLs) list sending servers automatically when mail reaches their capture servers, that is, their spamtraps and relay honeypots. Many of these are recognisable: domains with mail servers but unusable SPF records, look-alikes of popular domains, advertised open relays, or providers that publish the trapped messages. In the HADES attack (NDSS 2025) Li et al. make an innocent server deliver to a capture address: from an account at the victim provider, by entering the capture address in a web form or password reset that sends mail, through forwarding, lists and redirected bounces, or, where the capture server ignores SPF and DKIM, by simply forging the victim’s domain. In field tests 14 DNSBLs listed the authors’ servers, Spamhaus within three minutes, for seven to 30 days. Three providers including Spamhaus also listed domains whose forged mail failed SPF/DKIM, and up to 77% of the outgoing servers of top-1K sites had been listed at some time. Every receiver using the list then rejects the victim’s mail. The authors propose that DNSBLs verify SPF/DKIM before listing, hide capture-server characteristics, correlate several traps and allow early delisting, and that receivers combine several reputation sources [li2025].
Pepsi: Partly addressed. Impact: medium.
As a receiver, Pepsi queries no DNSBL about a correspondent. It consults
downloaded copies of whole lists (IP blocklists evaded by bots, webmail accounts and shared networks), marking by
default and rejecting only where the operator sets ACTION = reject. At a Pepsi
site, an innocent server that was injected into a list therefore gets a routing
mark on its mail rather than a refusal, unless the operator chose otherwise. A
milter’s DNSBL checks are the operator’s choice. The interesting half is Pepsi as
the victim: which paths let an outsider make a Pepsi host mail an address of the
outsider’s choosing? Several are closed. A bounce goes only to an envelope sender
that passed SPF or aligned DKIM (BOUNCE_UNAUTHENTICATED = drop), unknown
recipients are refused at RCPT (VERIFY_RECIPIENTS), and
pepsi-stage-secretary challenges only authenticated senders by default
(REQUIRE_AUTHENTICATED). The public web forms send at most two messages per
target address an hour (spend_budget in pepsi-httpd/src/web.rs), and a
list join sends one confirmation per list while a request is pending. Pepsi’s
own domains get a -all SPF record and DKIM keys from pepsi-dkim, so a
DNSBL that does verify authentication cannot be fooled by forgery. And a listing
is noticed: pepsi-reputation check (daily timer) asks the DNS blocklists in
[pepsi-reputation] CHECK_IP_ZONES and CHECK_DOMAIN_ZONES about this host’s
own sending and MX addresses and its domains, trusting a zone only after its RFC
5782 test entries answer, and stores the result in pepsi.reputation_check.
pepsi-status shows it and pepsi-setup run and check warn about it
(pepsi-reputation). See Security model (backscatter) and
Availability.
The automatic responders are the operator’s choice. By default
pepsi-stage-vacation, the payment request of pepsi-stage-anti-spam and
the -request results mail of pepsi-stage-list-command answer an envelope
sender whose SPF or DMARC verdict is anything but a definite fail
(pepsi_common::autoreply; softfail, neutral, none and temporary
errors are answered). The RFC 3834 rules apply, and so does a limit of one
notice per sender per SUPPRESS_DAYS or BLOCK_RESPONSE_SUPPRESS window.
A capture address forged at a domain without a -all SPF record or a DMARC
record therefore gets one message per window per protected mailbox
(Bounces, auto-replies and MDNs reflected at forged return addresses). Each of the three stages takes
REQUIRE_AUTHENTICATED = yes (autoreply::suppress_reason_with), which
withholds its reply from every sender that did not pass SPF or DMARC and so
closes that path, at the cost of leaving real correspondents at domains that
publish neither record unanswered. The wizard writes the option as a commented
hint in each section and leaves the default, since RFC 3834 wants real
correspondents answered. What remains is a compromised or malicious SASL
account. It can feed traps up to its recipient budget
(USER_RECIPIENTS_PER_HOUR, 500 an hour by default; local-socket submitters
have LOCAL_MESSAGES_PER_MINUTE); the budget slows it down but may not keep
the host off a list, and a lower USER_RECIPIENTS_PER_HOUR narrows this
residue. A DNSBL that lists on forged mail cannot be stopped by anything that
Pepsi publishes, and the daily self-check shortens the time during which a
listing goes unnoticed without preventing it; delisting is the operator’s work.
96.4.5. Deployment, configuration and credentials¶
Configuration errors, abandoned resources and weak, reused or stolen secrets.
96.4.5.1. Missing, invalid or non-enforcing DMARC policies leave domains spoofable¶
DMARC is the only standard that lets a domain tell receivers what to do with mail
whose From: it did not authenticate, and it protects only a domain that
publishes a valid record with p=quarantine or p=reject. Measurements
spanning a decade show that most domains do not. In 2014 under 1% of the Alexa top
million had DMARC, and 71.6% of those used p=none [gojmerac2015]. Later
studies found DMARC at 11% with about 70% none and only 3% of domains running
SPF, DKIM and DMARC together [tatang2021b]. Zhang et al. measured 29% to 35% with
DMARC, half of it p=none [zhang2023] [zhang2023a], and the MECSA service saw
51% with DMARC and 42% of those at none [kambourakis2020]. Of the Tranco top
100k, 44% had no retrievable record, 51% of valid records gave no protection
(none for the domain or its subdomains, or a pct sample), and 89% of
domains did not change their configuration in eight months; 0.6% published records
that receivers ignore because of syntax errors [lange2026]. Unparseable records
recur in every study, for example SPF syntax at _dmarc, p not following
v or a missing mailto: [gojmerac2015] [gebhard2023] [dakic2025], and
operators leave “accept everything” in place beyond testing
[holstchristensen2021].
Pressure helps only where it reaches. Google’s 2023 bulk-sender rules raised
DMARC by about 5 points among Tranco domains and by 25 to 37 points among
Japanese listed companies, but not in countries and industries that do not
depend on Gmail [kondo2025] [kondo2026]. Across 75 million ccTLD domains, 25.7%
have DMARC and only a third of the European ones are stringent; concrete national
rules (Germany’s BSI TR-03182, India’s CERT-In) correlate with stringency
[cesar2026]. Sectors that handle sensitive mail are no better: 8% of German
health-care institutions publish p=reject [petrlic2025], 3 of 19 Croatian
banks do [dakic2025], and 26% of U.S. non-federal government domains have DMARC
at all [gebhard2023]. The consequence is the same everywhere: anyone who can send
mail can put such a domain in From: and receivers have no policy basis to
reject it.
Pepsi: Partly addressed. Impact: low.
As a publisher Pepsi does what a tool can do without knowing the operator’s mail
flows, and then reads what receivers report about them. pepsi-setup
validates the live _dmarc record tag by tag against RFC 7489
(pepsi-setup/src/dmarc.rs): duplicate tags, a missing p=, several
records at one name, a rua without mailto: and separator mistakes are
reported as invalid, the record is repaired in place rather than replaced, and
the result is cross-checked against the receiver’s own parser. Where no record
exists it suggests v=DMARC1; p=reject; adkim=s, because every message that
Pepsi sends for a served domain carries a DKIM signature with d= equal to the
From: domain (so strict DKIM alignment costs it nothing), and the comment
beside it names the one risk: another service sending as the domain without
aligned DKIM or SPF, for which p=none is the fallback until it does
(pepsi-setup). A Pepsi domain set up as suggested therefore
starts enforcing, skipping the step from none to reject that the studies
show most domains never take.
The suggestion also carries rua=mailto:dmarc-reports@<domain>, where
pepsi-stage-dmarc-report (wired by the wizard on every
installation that receives mail) reads the aggregate reports into
pepsi.dmarc_report. pepsi-setup check, pepsi-status and the console
then say per domain either that every source of the last WINDOW_DAYS aligned,
so p=reject is safe, or which sources it would refuse. An operator who keeps
an existing p=none needs that evidence before tightening the policy, and an
operator at p=reject needs the warning when a legitimate third-party sender
starts being refused. Only a report whose mail passed DMARC or SPF counts, so a
forged report can neither clear nor condemn a policy (DMARC aggregate reports).
What Pepsi cannot do is publish the record or change the policy: an operator who
does not, or who keeps p=none despite the reports, stays spoofable.
As a receiver, Pepsi can protect its users only from domains that publish an
enforcing policy, and a new installation does: the wizard writes DMARC_ENFORCE =
yes, so a forgery of a p=reject domain is refused 550, with the ARC
chain of a forwarder listed in ARC_TRUSTED_SEALERS as the one override
(A remote sender, The network adversary,
Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment)). Mail that forges a domain without an
enforcing policy cannot be refused by anybody; when it fails DMARC under
p=none, Pepsi marks it with X-Pepsi-Warning: dmarc-fail-not-enforced and
the [external] subject tag (Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment)). The
remaining exposure belongs to the domain owners.
96.4.5.2. Missing, invalid, broken or soft-fail SPF records¶
SPF (RFC 7208) lets a domain list the hosts that may use it in MAIL FROM,
but only a published, valid record ending in -all lets receivers reject a
forgery. Görling found SPF on 1.6% of .se domains in 2006, and only 0.37%
with a hard fail; no major Swedish bank had one although they were being phished
[gorling2007]. Eight years later 36% of the Alexa top million published SPF, but
54.8% ended in ~all, 20.9% in ?all, and many records were syntactically
invalid [gojmerac2015]. The two errors that dominate today make the whole record
evaluate to permerror: needing more than ten DNS lookups, mostly through
hosting providers’ nested include chains, and several SPF records at one
name. Further causes are misspelled mechanisms such as ipv4:, names that do
not resolve, and include loops. These affect 2.9% of SPF records in 12 million
domains [czybik2023] and 7.7% of records in 176 million, 83.7% of those through
just two providers’ include chains [ashiq2024]. Ashiq et al. also found that 81%
of checkable records carry superfluous mechanisms, mostly left over from a
previous provider, and that up to 59% of “flattened” records missed their
provider’s later IP changes, so stale ranges stay authorised [ashiq2024].
Notifying 111,951 operators fixed 3.3% of records within two weeks
[czybik2023].
Weak deployment also leaves the oldest SPF benefit unused. Rejecting hard-fail mail is what protects a domain from Joe jobs (backscatter at its forged address), yet in Herzberg’s survey most records had no hard fail and many receivers ignored one for fear of losing forwarded mail [herzberg2009].
Pepsi: Partly addressed. Impact: low.
For the domains it serves, pepsi-setup builds the record itself from the relay
stages’ PUBLIC_IP values as ip4:/ip6: mechanisms ending in -all
(spf_record), so it needs no DNS lookup and cannot exceed the limit or go
stale behind an include. check_spf reports a missing record, a second record
(permerror), +all or a bare all, and any configured IP that the record
does not cover. It warns when no PUBLIC_IP is set (the record would be
v=spf1 -all) or when the address is private, and checks every authoritative
name server and several public resolvers (pepsi-setup). Every term
of the published record is also checked against the RFC 7208 section 12 grammar
(pepsi-setup/src/spf_syntax.rs): an unknown mechanism such as ipv4: or
inculde:, a bad CIDR length or address, a malformed macro or a duplicated
redirect= is reported as [INVALID] with the term named, because receivers
return permerror for the whole record and apply no SPF policy. ptr is
noted as discouraged (section 5.5). Two residues remain: ~all is accepted as a
legitimate rollout choice, and a smarthost provider’s include: is left to the
operator to add and maintain. The backscatter half is closed: Pepsi bounces only
to senders that passed SPF or aligned DKIM (Security model).
As a receiver Pepsi cannot repair other domains’ records. SPF fail alone does
not cause a rejection (only a DMARC failure under DMARC_ENFORCE does), which
matches the forwarding trade-off that Herzberg describes, and a broken record simply
leaves the sender unauthenticated. For the operator’s own domains,
pepsi-setup counts the RFC 7208 section 4.6.4 lookups
across the whole record tree, through every include: and redirect=, and
warns above ten lookups or two void lookups (pepsi-setup/src/spf_limits.rs),
so an operator-added include: that pushes the tree over the limit is
reported like a malformed term.
96.4.5.4. Subdomains and non-existent subdomains left without SPF/DMARC policy¶
SPF is evaluated for the exact name in MAIL FROM, so a record on
example.com says nothing about account.example.com, and for a name that
does not exist the SPF lookup yields none. Only DMARC covers subdomains,
through the parent’s sp (or inherited p) tag. Maroofi et al. found that
76% of the subdomains of top domains and 70% of banking subdomains have no SPF
record, and that most of their parents have no DMARC or p=none. Mail from
addresses such as support@account.<brand> is then delivered as neutral even
when the parent itself is protected [maroofi2020]. Only 2.3% of domains answer
SPF for arbitrary subdomains and 6.2% set an explicit sp; spoofed mail from an
invented subdomain of 17 companies reached the inbox or spam folder at every one
of them [zhang2023]. Shen et al. found 13 large providers that accepted mail
from a non-existent subdomain even when the parent’s DMARC policy should have
applied (attack A8) [shen2021]. A related trap is delegation: a third-party
sender given a subdomain for its DKIM keys also controls the other records there
and can publish a weaker DMARC record that overrides the parent’s
[m3aawg2019]. The fixes are a wildcard v=spf1 -all plus explicit records for
sending subdomains, sp=reject (and DMARCbis np=reject for non-existent
names), receivers that apply the organisational policy, and CNAME rather than zone
delegation for third-party keys.
Pepsi: Addressed. Impact: low.
The receiving side is handled by the DMARC implementation that Pepsi uses, the
vendored mail-auth (vendor/mail-auth/src/dmarc/verify.rs). It finds the
organisational domain by the DMARCbis tree walk and applies sp to existing and
np to non-existent subdomains, so a forged subdomain of a domain with
p=reject fails DMARC in pepsi-ingress. That verdict is acted on only under
DMARC_ENFORCE, which the wizard writes for a new installation
(Missing, invalid or non-enforcing DMARC policies leave domains spoofable). Note that Pepsi’s own alignment uses relaxed,
suffix-based matching (Relaxed DMARC alignment lets any subdomain speak for the organisation).
On the publishing side pepsi-setup prints SPF and DKIM for the names that
Pepsi sends as and suggests v=DMARC1; p=reject; adkim=s, whose policy every
subdomain inherits. For the subdomains that Pepsi does not send as, it adds three
things. It suggests a wildcard *.<domain>. TXT "v=spf1 -all" for every served
domain whose wildcard does not already answer with SPF, commented out and never as
an applied change, because a wildcard TXT record also answers every other TXT
question at a name that does not exist. It recommends sp=reject; np=reject in
run’s log and beside the record in check (dmarc::subdomain_record)
whenever the live DMARC record leaves subdomains a weaker policy; an operator who
keeps p=none while reading the reports gets the advice too. And check
lists the subdomains that the configuration names (the EHLO host,
mta-sts., autoconfig.) that exist without an SPF record of their own,
which the wildcard does not cover. What remains is the operator’s: publishing the
suggestions, and the subdomains that Pepsi does not know about (a web host, a
delegated zone), which only an inventory of the zone finds.
96.4.5.5. Misconfigured and ambiguous DKIM key records¶
A DKIM key record is a tag list at <selector>._domainkey.<domain>, and small
mistakes make signatures fail, sometimes only at some receivers. Wang et al.’s
measurement of 9.5 million DKIM records found 2.9% of the DKIM-using Alexa domains
misconfigured. The errors were missing, empty or broken p= values, invalid
tags, and records mixed with SPF syntax. 2,522 domains published several records
for one selector, a case the standard leaves undefined. Verifiers disagree on it:
Google and NetEase use the last record, Mail.ru accepts if any is valid, and
Outlook and Yahoo fail the signature. 550 domains offered only RSA-SHA1. The
result is mail that fails or verifies inconsistently and a weaker DMARC posture
for the domain; the authors’ remedy is correcting the records with a checker
[wang2022].
Pepsi: Addressed. Impact: none.
For its own domains Pepsi generates the key pairs itself and prints the record,
so the p= value is derived, not typed. check_dkim in
pepsi-setup/src/lib.rs then judges what is live against RFC 6376 section
3.6.1. It reports a missing record, several key records at one name (“a verifier
uses whichever it happens to pick”), a malformed tag list, v= not first or not
DKIM1, a missing p=, a k= that does not match the key, an h= that
does not permit SHA-256, and testing or service-type flags. The p= value must match the
local key, and the result must agree at every authoritative name server and at
public resolvers (pepsi-setup). DKIM_ALGORITHMS lets an
operator stop publishing the Ed25519 selector that many large receivers do not
verify.
As a verifier, mail-auth takes the first record in the DNS answer that parses,
so a third party’s domain with two valid keys verifies in Pepsi on some lookups
and not on others, as it does at the providers Wang et al. tested. That is the
publishing domain’s error to fix, and its only effect is a failed signature on
that domain’s own mail.
96.4.5.6. DKIM private key theft and key-service compromise¶
Whoever holds a domain’s DKIM private key, or can change what DNS returns for its selector, can make forged mail pass DKIM and DKIM-aligned DMARC. RFC 4686, the threat analysis written for DKIM, lists the ways in. The key can be stolen from the signing host or from a less-protected third party to which it was delegated, or recovered through side channels, including remote timing of a signing server. The DNS servers that publish the keys, or a parent zone, can be compromised, and resolvers can be poisoned. A revoked key keeps working while it is cached, and a parent domain’s key can be valid for all subdomains. The countermeasures that it names are hardware key storage, keys restricted to particular addresses, blinded or constant-time signing, DNSSEC, independent monitoring of the key zone and short TTLs for keys outside the domain’s direct control [rfc4686]. Later work showed key generation in web tools and keys mailed in clear to third parties, and argued for regular rotation so that a stolen key stops working (Short, long-lived or shared DKIM RSA keys and rsa-sha1 signatures).
Pepsi: Partly addressed. Impact: medium.
The obvious leaks are avoided, and the keys are kept away from the mail
stages. The signing daemon pepsi-dkim generates the keys of
every served domain locally, runs as its own account pepsi-dkim and keeps
them as 0600 files in 0700 directories under /var/lib/pepsi-dkim, which no
other service account can read and which is deliberately left out of backups
(a restore makes fresh keys, which is a rotation). No key is handed to a third
party. pepsi-stage-dkim-sign and pepsi-stage-arc hold no key: they send
the header block to be signed over the daemon’s socket (group pepsi), and
the daemon refuses a d= that it does not serve, a DKIM signature whose h=
omits From or whose From: mailboxes are not aligned with d=, and an
ARC set for any domain but ARC_DOMAIN. The signer is mail-auth on
aws-lc-rs, whose RSA implementation is blinded, so remote timing of
signatures is not a practical route. Whether the published key is still ours is
checked by the daemon itself, which asks every authoritative server for each
selector, and by pepsi-setup check, which also asks public resolvers.
What remains is key use and lifetime. The daemon protects the keys from
disclosure, not from use: any process running as pepsi can still ask the
socket for signatures for every served domain within that policy, or rewrite a
queued From: and let pepsi-stage-dkim-sign sign it, for as long as it
runs. The threat model states this as a residual of the design rather than as a
bug (A compromised component, Assets, Security model). What a
compromised stage cannot do is carry a key away and keep signing after
it is fixed. Every signature expires seven days after signing (x=,
SIGNATURE_EXPIRATION_DAYS), so a signature stolen together with a message
stops verifying after a week. A key stolen from the daemon’s account or the
root account keeps working until it is rotated: rotation is off by default
(ROTATION_DAYS = 0), and pepsi-dkim rotate --hard or the console’s
“rotate now” replaces a key at once after a suspected exposure
(Rotating DKIM keys, After a key exposure). The keys are files, not
hardware-held. DNSSEC for the key zone, and the TSIG key of
DNS_UPDATE = rfc2136 (kept in secrets.d/pepsi-dkim.secret, readable by
the daemon alone), are the operator’s responsibility.
96.4.5.7. Blocklist collateral damage and authentication-misconfiguration bounces¶
Legitimate mail also fails for reasons its sender cannot see. Li et al. classified 190 million bounces from 15 months of a large Chinese provider’s outbound mail. 31.1% of all bounces were caused by the sending MTA being on a blocklist. About half of the provider’s proxy MTAs were listed on Spamhaus daily, because shared outbound servers inherit the reputation of every user, and 78% of the mail bounced for Spamhaus listings was legitimate. Separately, 2.19% of messages from 9,000 sender domains were hard-bounced because of SPF, DKIM or DMARC misconfiguration that lasted 12 days on average, and 11,000 receiving domains required STARTTLS. The authors recommend that senders monitor their outgoing reputation, that blocklist operators take delivery history into account, and that bounce messages be standardised [li2024b].
Pepsi: Partly addressed. Impact: low.
The misconfiguration half is what pepsi-setup is built to prevent. It prints
only the records that are missing or wrong, validates SPF, DKIM, DMARC, MTA-STS
and TLSA against live DNS at every authoritative name server, and re-asks public
resolvers from outside, which catches zones that resolve only from the host’s own
network (pepsi-setup). pepsi-stage-dkim-sign never sends a
message unsigned, and DKIM_ALGORITHMS drops a selector that receivers report
as failing. The relay stages use TLS opportunistically and record outcomes for
TLSRPT. A typical deployment sends from its own address, so it does not share
reputation with thousands of strangers the way a large provider does, and the
backscatter measures keep it from earning listings by bouncing forged mail
(Security model).
The monitoring half is partly there. pepsi-reputation check
(pepsi-reputation, daily from pepsi-reputation-check.timer)
asks the configured DNS blocklists about this host’s own sending and MX addresses
and its domains, never about a correspondent. It counts a zone’s answer only after
its RFC 5782 test entries pass and stores the result in
pepsi.reputation_check. A listing is logged, shown by pepsi-status, and
reported by pepsi-setup run and pepsi-setup check; the latter reports it
in a deliverability section beside the sender requirements of Gmail, Yahoo and
Microsoft and the sign-up pages of their postmaster tools (Pepsi never signs up
itself). The DMARC aggregate reports show a broken record from the receivers’
side: pepsi-stage-dmarc-report reads them, and a source whose mail
does not align (a record that forgot a sending service, a key not published) is a
warning in pepsi-status and pepsi-setup check. The DNS records are
re-validated daily: pepsi-setup-check.timer runs pepsi-setup check
--fail-on-findings, which logs every missing, wrong, invalid or unreachable
record and every blocklist listing as a warning and fails the unit, so a record
broken after setup shows in systemctl --failed (a lookup that merely failed
does not). What remains is for operators: the provider feedback loops (SNDS, JMRP,
Postmaster Tools) have to be read by hand. Authenticated submission is limited per
account (USER_RECIPIENTS_PER_HOUR), but within that budget one compromised
account can still get the host listed for all
(Innocent mail servers injected into DNS blocklists). A deployment relaying through a
shared smarthost inherits that provider’s reputation.
96.4.6. Resource exhaustion and abuse¶
Exhaustion, amplification and the abuse of a service to attack others.
96.4.6.1. Subscription and web-form e-mail bombing via unverified sign-ups¶
Any web form or list server that mails an address typed in by an anonymous visitor is an amplifier. Mailing-list subscription bombing was already common in 1998, when list servers such as Majordomo did not authenticate subscribers and tools automated sign-ups to dozens of lists [bass1998]. Jakobsson and Menczer described the general attack in 2003: an agent submits the victim’s address to thousands of newsletter, list and information forms found by search engines, and the sites, acting in good faith, bury the victim [jakobsson2003]. In 2021 LLVM’s Mailman lists were abused to send confirmation requests to valid addresses up to about 100 times each. Confirmed opt-in does not help, because the confirmation requests are themselves the flood.
The attack is now a commodity. Darknet services sold 5,000 to 20,000 messages for 20 to 40 USD. Schneider et al. found that the forms are harvested generically because most sites run on a few platforms, that the reflectors include Google, Yahoo and booking.com, and that one attack produced 50,000 further messages over two years as newsletters continued and lists were resold [schneider2020]. In Houle and Pandey’s case study a mailbox received 6,500 messages from 87 countries in twelve hours [houle2018]. Payer and Wüest observed waves of up to 4,847 messages (about 1,500 an hour, against a normal rate under ten) aimed at managers at the start of the working day, with 1,000 messages sold for about 1 USD [payer2026]. Because the mail is genuine, it passes sender authentication (91% to 99% passed SPF, DKIM or DMARC [schneider2020]), reputation and content filters [laha2022] [shukla2024]. Its purpose is often to hide a parallel attack: a password reset or purchase confirmation lost among hundreds of similar messages while an account is taken over, or a pretext for a fake help-desk call that installs remote-access software [payer2026] [laha2022]. CAPTCHAs, double opt-in and randomised form parameters help only on the sites that adopt them. The published mitigations are therefore receiver-side: detect a volume spike against the user’s history, then group, throttle or quarantine mail from new senders and classify it [houle2018] [shukla2024] [laha2022] [payer2026].
Pepsi: Partly addressed. Impact: medium.
As a potential reflector Pepsi is well behaved. A list join by e-mail costs the
named address one confirmation and subscribes nobody, and a second request is
refused while one is pending, so each list sends at most one confirmation per
address per pending period (pepsi-stage-list-command). The only
paths that add an address without confirmation are the CLI and an authenticated
REST call with both pre_verified and pre_confirmed
(Mailing lists). The public web forms (list sign-up, password reset) send
at most two messages per target address an hour, independently of the client
limit, and answer identically when refusing (spend_budget in
pepsi-httpd/src/web.rs, Availability). A deployment hosting many
lists can still send one confirmation per list, which is the LLVM pattern scaled
down.
As the victim’s mail server Pepsi has no flood detection: nothing compares a
mailbox’s arrival rate with its history or groups a burst of first-contact
senders, so a bombing wave is delivered like any other authenticated mail, and a
MAILBOX_QUOTA can then make real mail bounce. The optional gates change this
only for users who enable them. pepsi-stage-anti-spam and
pepsi-stage-secretary hold mail from senders that no whitelist
knows, so the flood waits for payment or a reply instead of reaching the inbox
(Spam filters and the secretary). The cost is that the password reset or
confirmation that the attacker wants to hide is held with it, and genuine first
contacts are held too. No fix at the source is in sight, since the amplifiers are
countless third-party sites. A per-recipient burst detector is declined
(docs/ROADMAP.md): a burst that users cause themselves trips any detector, and
the optional gates and MAILBOX_QUOTA are the tools for this. What remains is
therefore an open problem and the operator’s and user’s choice of gates.
96.4.6.2. SPF evaluation as DNS amplifier and lookup-limit DoS¶
An SPF record is a small program that the receiver runs on behalf of whoever
controls the envelope sender’s domain: its include, a, mx, ptr
and exists terms, combined with macros that substitute parts of the sender
address, make the receiver issue DNS queries to names of the publisher’s
choosing. Otis showed in 2006 that one evaluation under RFC 4408 could cost on
the order of a hundred DNS transactions, multiplied by the identities checked,
the recipients and the hops. Local-part macros also defeat caching, so
ordinary-looking mail from many hosts turns receivers into a distributed
amplifier (estimated at 300 to 1,500 times the SMTP traffic) against a victim’s
name servers, with the queries coming from reputable resolvers
[draft-otis-spf-dos-exploit]. Herzberg adds that the same control over the
content and timing of a receiver’s queries helps cache poisoning
[herzberg2009]. RFC 7208 answered with low processing limits: ten
DNS-querying terms per evaluation, bounded MX and PTR fan-out and, new in that
RFC, a limit of two “void” lookups [rfc7208].
Measurements show that the limits are often not applied as intended. Scheffler
et al. (2018) found that many receivers reset the ten-term counter for every
include, so a tree of nested records induced 34.3 queries per message on
average where a global counter would have stopped far earlier
[scheffler2018]. Ashiq et al. (2024) found validators with no total limit
(Mail::SPF::Query before 1.8, iRedAPD before 5.1) or raised ones (20 or 30),
195 MTAs that resolved all 50 includes of a test record and 69 that performed
36 void lookups, some of them before DATA, so that no message has to be
delivered. They also showed a denial of service against the receiver itself:
validators such as iRedAPD and libspf2 evaluate sessions serially and keep
resolving after the MTA gave up, so two sessions served deliberately slow DNS
answers exceed Postfix’s 100 s policy timeout and every legitimate message in
that window is deferred [ashiq2024]. The fixes are a global per-message
counter, enforcing the void limit, parallel evaluation and up-to-date
libraries.
Pepsi: Addressed. Impact: none.
pepsi-ingress evaluates SPF through the vendored mail-auth crate
(pepsi_common::auth). Its LookupLimit is one counter for the whole
evaluation, carried into every include (the recursion uses an explicit
include_stack), so the per-record reset that Scheffler et al. measured does
not happen; an mx term is cut off after ten exchanges with permerror, each
PTR name costs a term from the same budget, and the evaluation also stops after 20
s of wall-clock time. SPF runs once per message, after the end of data, as a
concurrent task beside the DKIM verifications under VERIFY_TIMEOUT (20 s).
There is therefore no serial policy service to clog; a slow sender domain delays
only its own verdict (which becomes temperror and is ignored by DMARC unless
it aligns), and an attacker must complete a whole transaction, which the
per-source connection limits and MAX_MESSAGES_PER_SESSION meter
(Availability, Security model).
The vendored mail-auth also enforces the void-lookup
limit of RFC 7208 section 4.6.4 (a Pepsi patch in
vendor/mail-auth/src/spf/verify.rs, with its own test vectors): the third
DNS lookup that returns no answer ends the evaluation with permerror, so a
record whose terms all resolve to nothing does not run the full ten-term
budget. What remains is the amplification that RFC 7208 itself permits, roughly
ten terms plus up to ten address lookups per mx term, i.e. about a hundred
queries per message directed wherever the sender’s record points; it can only
be reduced by the standard. See also DNS reflection amplification.
96.4.6.3. SPF checks let outsiders induce queries from closed resolvers¶
Closing a recursive resolver to outside clients is meant to keep an off-path attacker from triggering lookups, the first step of a cache-poisoning attempt. A receiving MTA that evaluates SPF for every incoming message does exactly that for anybody who can send it mail: it looks up names under the sender’s domain, at the moment the sender chooses, through the organisation’s internal resolver. Scheffler et al. (2018) used this to elicit queries from 8,889 resolvers, 82% of them closed; 99% of those randomised both source port and transaction ID, so the practical poisoning risk was low, but the “closed” defence was bypassed for inducing queries [scheffler2018]. The paper proposes no protocol change; the defence is resolver-side randomisation and DNSSEC.
Pepsi: Vulnerable. Impact: low.
The channel is inherent in receiving mail with SPF, DKIM and DMARC checks, and
Pepsi has it like every other MTA: pepsi_common::auth asks the resolvers of
[pepsi] DNS_SERVERS (plain DNS, DNS over TLS or DNS over HTTPS), or else those
of the system configuration (pepsi_common::dns::hickory_builder), so a remote
sender makes that resolver query names under a domain that the sender controls, at
a time that the sender picks. An encrypted transport protects only the path to the
resolver, not the resolver’s own queries. Pepsi neither prevents nor rate-limits
this beyond the connection limits of Availability. Whether poisoning
then succeeds depends on the resolver, not on Pepsi: the manual’s hardened profile
asks for a validating resolver on a trusted path (unbound on loopback, or
systemd-resolved with DNSSEC=yes; The network adversary), which makes forged
answers for signed zones fail and gives source-port and ID randomisation for the
rest. Operators should run such a resolver dedicated to the mail host, so that a
poisoned cache harms nothing else; for unsigned zones the problem is open
(Off-path DNS cache poisoning by forged responses (Kaminsky), Mail routing and sender authentication rely on unauthenticated DNS).
96.4.6.4. DKIM verifier and key-service DoS and verification probing¶
The DKIM threat analysis lists the ways in which a verifier and the key service behind it can be attacked rather than the signatures themselves [rfc4686]: invalid signatures are free to produce but cost the verifier a DNS lookup and a public-key operation each; floods of mail referencing a domain’s selectors load its DNS; an attacker who controls the key DNS can send mail with a unique selector per recipient and learn from the queries which recipients verify (“verification probe”); large key records can serve as DNS amplifiers; signing everything that leaves a network lets a compromised internal host obtain valid signatures; and third-party signers sign for anyone. Its countermeasures are limits on the number of signatures and on key sizes processed, cached and redundant key servers, authenticated submission with outbound monitoring, and reputation for third-party signers.
Pepsi: Addressed. Impact: none.
pepsi-ingress verifies at most MAX_DKIM_SIGNATURES (10) signatures per
message, those whose d= can align with the From: domain first, each as a
single-signature view of the message, concurrently and under one
VERIFY_TIMEOUT (20 s) deadline; at most 50 ARC sets are considered, and the
vendored mail-auth accepts RSA keys only between 1024 and 8192 bits
(pepsi_common::auth, Availability). A timed-out signature becomes a
temperror bound to that signature, so the bound cannot be used to dodge
DMARC_ENFORCE. On the signing side pepsi-stage-dkim-sign sits on the
outbound path behind authenticated submission, where ingress enforces
USERNAME_MAP so a user can only send as themselves; the local submission
socket identifies the caller by SO_PEERCRED instead of trusting the network
(pepsi-ingress). The verification probe only reveals that a
Pepsi host verifies DKIM, which every modern receiver does and which carries no
confidential information. The residual risk that a compromised stage can get
arbitrary mail signed is a documented property of the pepsi role, discussed
under A compromised component, not a weakness of the verifier.
96.4.6.5. Challenge-response filters send backscatter to forged senders¶
A challenge-response (CR) filter holds mail from unknown senders and mails a challenge to the claimed sender, releasing the message when the challenge is answered. Because neither the envelope nor the header sender is authenticated, and spam usually carries forged or non-existent senders, most challenges go to innocent third parties or to nowhere: the challenger becomes a source of backscatter, and an attacker can forge a victim’s address to flood it with challenges from every protected recipient [roman2005] [rao2012] [herzberg2005]. ASK, a 2003 per-user CR filter, already conceded that it could not tell genuine bounces from forged ones, let mail claiming to be from whitelisted or the user’s own addresses through, and limited only the number of challenges per address [paganini2003]. Herzberg adds that challenges can be answered automatically, that their human-interaction proofs can be relayed to cheap solvers, and that spam can be disguised as challenges [herzberg2005].
The only large measurement, of a commercial CR product at more than forty companies over six months in 2011, quantifies the cost. The filter sent a challenge for about one in five messages that reached it. Only 49% of the challenges were delivered (72% of the failures went to non-existent addresses), 94% were never visited and about 4% were solved. Four challenge servers spent 17 to 129 consecutive days on public blocklists, and an attacker can deliberately get a challenge server listed by forging spam-trap addresses. Pre-filtering removed over 75% of mail before challenging, and SPF checks would have removed a further 2.5% of the bad challenges [isacenkova2011]. The authors consider backscatter intrinsic to CR [isacenkova2011], and the market has largely rejected it [rao2012]; Roman et al. propose publishing the challenge in advance instead of sending it [roman2005].
Pepsi: Partly addressed. Impact: low.
Pepsi has two components of this kind. pepsi-stage-secretary
is a classic CR filter, and it gates its challenge the way the literature
suggests: no challenge for anything that RFC 3834 says must not be answered (lists,
bulk, auto-submitted mail, service senders, delivery reports;
pepsi_common::autoreply), none when From: differs from the envelope
sender, none unless SPF or DMARC passed (REQUIRE_AUTHENTICATED, default
on, “the backscatter gate”), at most MAX_CHALLENGES_PER_SENDER (5) per
sender in 24 hours, one challenge per sender and whitelist however many
messages arrive, and no quoting of the held message beyond an 8-character
subject hint; a challenge is confirmed only by a reply from the challenged
address to an address carrying a random 128-bit cookie.
pepsi-stage-anti-spam’s payment request is the other: it
applies the same RFC 3834 rules and sends at most one request per sender and
protected mailbox per BLOCK_RESPONSE_SUPPRESS (one hour), claimed in one
SQL statement, and it sends none for a message whose SPF or
DMARC verdict at ingress was a definite fail (pepsi_common::autoreply,
shared with every automatic reply; the message stays held for payment either
way, only the prompt is withheld). By default that is weaker than the
secretary’s gate on purpose: softfail, neutral, none and temporary
errors are still answered, because requiring a pass would leave legitimate
senders at domains that publish no SPF or DMARC record without any way to learn
how to reach the recipient. The stage’s own REQUIRE_AUTHENTICATED = yes
(default no; the wizard writes it as a commented hint) applies the secretary’s
rule instead (autoreply::suppress_reason_with). The residue for the payment
request under the default is therefore a forged address at a domain that
publishes neither a failing SPF policy (-all) nor DMARC: a spammer who
forges such a victim’s address towards n protected mailboxes still draws up to
n payment requests per hour to the victim, from the Pepsi host’s own IP
address and DKIM domain. For the secretary, and for the payment request with
the option on, the residue is a sender whose domain’s SPF record authorises
shared infrastructure that the attacker can use.
Whitelist forgery, the other weakness these papers name, is treated under Sender whitelists bypassed by a forged From address; Pepsi’s pepsi-stage-check-whitelist requires a DKIM or ARC pass per row by default.
96.4.6.6. Bounces, auto-replies and MDNs reflected at forged return addresses¶
SMTP lets any sender put any address in MAIL FROM. Every system that later
answers a message therefore sends its answer to whoever the attacker named: a
server that accepts mail and bounces it afterwards, a vacation responder, a list
service, or a reader’s client that sends a read receipt. Bass et al. described
“error-message bombs” in 1998: floods sent to an innocent MTA with the victim
as originator, so that the MTA’s error reports take the victim’s server out of
service, and recommended sending no feedback for hostile mail [bass1998].
RFC 3834 and its draft list the same abuse for automatic responders:
backscatter to third parties, amplification, laundering of attacker-chosen
content through a responder that quotes it, side effects such as subscribing a
victim to a list, address validation and leaks of a recipient’s absence. They
state that any responder that does not authenticate requesters stays open to
it [rfc3834] [draft-moore-auto-email-response]. Sender ID made a receiver
reject a message whose PRA was chosen to fail and bounce it, often with the
content, to a victim named in MAIL FROM [rfc4406]. Message Disposition
Notifications can be aimed at a victim through a forged
Disposition-Notification-To, with the full original content making each MDN
larger than its trigger [rfc8098].
Mitigations come from both ends. Receivers reject in the SMTP session rather
than bouncing later, which is why they resort to in-session scanning and filing
into junk folders [draft-ietf-dkim-dkim2-motivation]; responders follow the
RFC 3834 rules (null sender, Auto-Submitted, one answer per
correspondent per period, no quoted content) [rfc3834]; MDNs are not sent
automatically when the receipt address differs from the return path
[rfc8098]. The address owner can tag its own envelope senders, as BATV does
with a short HMAC and expiry day, and reject bounces to untagged addresses
[draft-levine-smtp-batv]; DKIM2 would align the bounce address with the last
signer and send DSNs only back along the signed chain
[draft-ietf-dkim-dkim2-motivation].
Pepsi: Partly addressed. Impact: low.
As a generator of bounces Pepsi follows the literature closely (Security model,
section “Unknown recipients and backscatter”). pepsi-ingress refuses
unknown recipients at RCPT (pepsi-recipients) and over-quota mailboxes
from measurements, so most failures never become bounces. pepsi-stage-bounce
sends a DSN for an inbound message only when SPF passed for the envelope
sender’s domain or an aligned DKIM signature did (BOUNCE_UNAUTHENTICATED =
drop, the default, in sender_unauthenticated). A bounce is never bounced,
a filter REJECT from pepsi-stage-milter is routed to a
discard stage by the wizard, and a DSN for mail that arrived encrypted quotes
only a few addressing headers. Pepsi generates no MDNs, and
pepsi-stage-list-post removes Disposition-Notification-To
from list posts. Every automatic reply (vacation notice, secretary challenge,
payment request, list command results) obeys pepsi_common::autoreply, is
marked Auto-Submitted: auto-replied, is rate-limited per correspondent (for
list replies by the list’s autoresponse_grace_period, which an owner may set
to zero) and quotes at most the subject, and only to a sender that passed SPF
or DMARC (autoreply::may_quote; Provider notification workflows send attacker-controlled mail);
the list command reply never attaches the original.
Two residues remain. First, an automatic reply is suppressed on a definite
authentication failure only: no vacation notice, payment request, list command
reply or challenge goes to a sender whose SPF or DMARC verdict at ingress was
fail (pepsi_common::autoreply). softfail, neutral, none and
temporary errors are still answered, however. A vacation notice therefore still
goes to a forged address at a domain that publishes no failing SPF policy and no
DMARC record once per SUPPRESS_DAYS, and the payment request goes there once
an hour per protected mailbox (see Challenge-response filters send backscatter to forged senders).
Requiring a pass instead would stop answering legitimate senders at such domains;
the secretary, whose challenge is the larger amplifier, requires one by default,
and the vacation, payment-request and list-command stages require one when their
REQUIRE_AUTHENTICATED is set (default no). Second, as the victim of
backscatter Pepsi has only part of BATV: outbound mail carries the
Pepsi-Origin: proof-of-origin header (The Pepsi-Origin: proof-of-origin header), but only
the two gates check it. pepsi-stage-anti-spam routes an
unverifiable null-sender message to its BOUNCE_TARGET_STAGE, and
pepsi-stage-secretary treats one as unchallengeable
(UNCHALLENGEABLE_STAGE, else deleted). The wizard wires the anti-spam option
to the discard-rejected sink whenever it configures the payment gate, so on
such a site a user whose address is forged elsewhere does not receive the
resulting DSNs. The price is that the legitimate bounces that cannot be verified
(mail sent before the origin secret existed, a relay that strips the header) are
lost as well; a site can keep them by pointing the option at a quarantine stage
instead. Nothing refuses forged bounces at ingress, a site with neither gate has
no stage that checks the proof at all, and with proof of origin switched off
([pepsi-origin] ENABLED = no) the secretary passes every bounce. A complete
fix for the ecosystem needs a standard like DKIM2.
96.4.6.7. DMARC, TLS-RPT and DKIM failure reports as reflection floods¶
Authentication reports are mail that a receiver sends to addresses taken from
DNS records that the (possibly malicious) sending domain publishes. DKIM failure
reporting (RFC 6651) sends a report to the domain named in a failed
signature’s d=, which nobody authenticates, so bulk mail carrying bogus
r=y signatures makes every supporting verifier report to the named domain,
and positive caching keeps the flood going after the record is withdrawn
[rfc6651]. DMARC lets a rua tag name addresses in any domain, which the
receiving domain is supposed to authorise (“external destination
verification”, EDV). Ashiq et al. (2023) found that Google, Yahoo, QQ and
OpenDMARC performed no EDV, that most senders put no small limit on the number
of report addresses and none aggregated per destination, and measured
amplification of 900 to 1,150 times (110 for OpenDMARC). TLS-RPT (RFC 8460)
has no destination verification at all, and an attacker who makes the
reflector’s own report delivery fail TLS chains the two for an amplification of
1,460 times [ashiq2023]. Hureau et al.
found only 5 of 25 providers querying EDV in 2023, two of which reported anyway
when it failed [hureau2024a]. The recommended fixes are to always perform EDV
and refuse on failure, to cap the total number of report recipients, and to
add an authorisation mechanism to TLS-RPT [ashiq2023] [hureau2024a].
Pepsi: Partly addressed. Impact: low.
Pepsi sends neither DMARC aggregate or failure reports nor DKIM failure reports:
ingress records its verdicts in the message state and in
Authentication-Results and stops there, so the DMARC and RFC 6651
reflectors do not exist in it. It does send TLS-RPT reports: pepsi-tlsrpt
report (opt-in, [pepsi-tlsrpt] SEND_REPORTS, which the wizard sets when TLS
reporting is chosen) builds one gzipped report per policy domain per day from the
outbound sessions recorded by the relay stages and sends it to the rua targets
that the domain’s _smtp._tls record lists, at most five (MAX_RUA_TARGETS;
any further ones are logged and skipped, pepsi-tlsrpt). It
validates each mailto: address against header injection and posts https:
targets through the hardened fetcher that refuses private addresses, and it
aggregates per day, so a flood of messages yields one report per target, not one
per message. It has no EDV step, which TLS-RPT does not define. An attacker who
gets Pepsi to send any mail to a domain they control (a vacation notice or list
confirmation will do) can therefore still have Pepsi mail a report to up to five
victim addresses the next day; the volume is small and attributable to the
attacker’s domain. An authorisation record for external TLS-RPT destinations needs
the IETF.
96.4.6.8. Mail loops through auto-responders and forwarding evading loop detection¶
Loops are created by configuration outside the mail administrator’s control:
users’ forwarding files, aliases and lists that point at each other, vacation
programs and non-delivery reports that answer each other, and relays that do not
recognise mail addressed to themselves. The two standard defences are
unreliable: counting Received: fields fails when a gateway drops them, and
Message-ID tracking fails when relays assign new ones. Both fail completely
when each iteration creates a new message, as vacation replies and bounces
do. Solana et al. (1996) report single messages forwarded tens of thousands of
times over a weekend and propose detecting loops statistically from the
envelope sender/recipient pair, then tagging and stopping suspect messages
[solana1996]. Moore describes the responder variant, “sorcerer’s apprentice”
mode, in which each received message causes several responses that trigger
further ones, and gives the rules that became RFC 3834: mark responses
Auto-Submitted: auto-replied, never answer one, never answer a null return
path or list mail, answer at most one address per message and each sender at
most once per period [draft-moore-auto-email-response].
Pepsi: Addressed. Impact: none.
Pepsi bounds every kind of loop the papers name (Availability, “Loops
and amplification”). Relayed mail stops at MAX_HOP_COUNT (30) on the relay
stages; pepsi-ingress refuses a message that already carries
MAX_SELF_HOPS (5) Received: fields of its own, which catches the relay
that does not recognise its own address even when another host strips foreign
trace fields; pepsi-stage-dot-forward carries the forwarding
chain in the message state and bounces a recipient whose login is already in
it; aliases expand with a loop guard and depth 32; list traffic is capped at
five list hops. The new-message loops are cut at the source: every responder
that answers outside mail (vacation, secretary, payment request, list commands)
marks its reply Auto-Submitted: auto-replied, never answers a null sender,
an Auto-Submitted message, list or bulk mail or a delivery report
(pepsi_common::autoreply), and is rate-limited per correspondent; the
vacation notice, challenge and payment request also use the null sender, so
nothing can answer them, and a bounce is never bounced. The residue is a
user’s own |program in ~/.forward that answers mail without these rules,
which the operator can forbid with ALLOW_PIPE.
96.4.6.9. Spam and virus scanner crashes and timeouts on crafted mail¶
Content scanners parse attacker-supplied mail with large, intricate code, and crafted input makes them crash or run too long. SpamAssassin 3.0.4 crashed with a bus error on a header with a very large number of recipients, so the message was simply not scored (CVE-2005-3351, fixed in 3.1.0) [cve-2005-3351]; SpamAssassin before 3.4.2 mishandled certain unclosed HTML tags so that crafted messages took far longer to scan than expected and timed out (CVE-2017-15705) [cve-2017-15705]; ClamAV before 0.101.3 did not bound the work spent on overlapping-entry zip bombs (CVE-2019-12625) [cve-2019-12625]. The effect is a denial of service of the filter and the mail flow behind it, or a bypass when the integration lets an unscanned message through. The fixes are bounded parsing in the scanner and a fail-safe integration.
Pepsi: Partly addressed. Impact: low.
Pepsi ships no spam or virus scanner; such scanners are attached through
pepsi-stage-milter (the wizard detects clamav-milter,
spamass-milter, rspamd and others), so their own parser bugs are the
scanner vendors’ to fix and the operator’s to patch. What Pepsi controls is the
integration, and it fails safe: the milter stage has connect, command and content
timeouts (30 s / 30 s / 300 s), and its default for an unreachable or failing
filter is tempfail, which pauses the message and retries until
MAX_LIFETIME, unless the operator sets the stage’s ON_FAILURE (Postfix’s
milter_default_action) to accept. A crashing scanner therefore delays the
crafted message instead of waving it through. A message that crashes or hangs a
Pepsi worker itself is retried at most three times (MAX_RUNTIME 300 s per
attempt) and then parked as failed/timeout, without stopping other
messages; Pepsi’s own parsers are bounded in depth, part counts, decompressed size
and the amount of text the language detector reads (Availability). The
remaining exposure is the scanner’s resource use while it processes a crafted
message, which Pepsi’s timeouts bound only from the outside, and a deployment that
configures the milter to fail open.
96.4.6.10. Greylisting database exhaustion and legitimate mail loss¶
Greylisting temporarily refuses mail from unseen (client, sender, recipient)
tuples and records each tuple, betting that spamware does not retry. Its
applicability statement names the operational costs: an attacker who knows
the tuple can rotate addresses and envelope values to inflate the database,
and independently non-shared databases across MX hosts, envelope senders that
change per message, clients that never retry or treat 4yz as permanent and
long retry back-offs delay or return legitimate mail. It recommends aging,
a defined failure policy, one shared database per ADMD, tracking CIDR blocks and
exempting authenticated submission [rfc6647].
Pepsi: Not applicable. Impact: none.
Pepsi does not greylist: pepsi-ingress keeps no tuple store and accepts on
first contact, a decision recorded with its reasoning in the source tree
(contrib/no-greylist.md, referenced from docs/ROADMAP.md). The wizard
detects an installed milter-greylist but offers it only with a default of no
and says why: Pepsi filters after accepting the message and is itself the party
that retries, so a greylisting milter could only delay mail
(pepsi-stage-milter). As a client of other sites’ greylisting
Pepsi behaves as the RFC expects: the relay stages treat a 4yz as
temporary and retry with back-off until MAX_LIFETIME, and its envelope
senders are stable for a correspondent (SRS addresses change at most daily, a
list’s VERP address is fixed per member).
96.4.6.11. Resource exhaustion of a postage quota enforcer¶
Stamp and postage schemes move the cost of spam to the sender, but the service that checks payments becomes a target itself. DQE is a distributed quota enforcer that receivers ask whether a stamp has been used. Every query costs the enforcer work (possibly a disk seek), and spurious queries cannot be told from real ones, so an attacker can flood the enforcer, and with it every stamp-gated delivery, with requests. Walfish et al. (2006) propose that each query cost the requester as much bandwidth as sending a message, so attackers cannot induce more queries than the mail volume for which the enforcer is provisioned, plus per-portal quotas and authentication between nodes [walfish2006].
Pepsi: Partly addressed. Impact: low.
Pepsi’s analogue is pay-to-send: pepsi-stage-anti-spam creates a
GNU Taler merchant order for every message from a sender that is neither
whitelisted nor classified, pauses the message until PAYMENT_DEADLINE (two
days by default) and asks the merchant backend again when woken. A message whose
sender definitely failed SPF or DMARC gets neither. No payment request is sent for
it, and since the order id is the queue token, nobody could pay for it. It is
rejected as unpaid at once (BOUNCE_STAGE, whose bounce stage sends no DSN to
an unauthenticated sender, else deleted), which is the outcome that the deadline
would have produced. A sender that is merely not authenticated (SPF none,
neutral, softfail) still makes Pepsi create one order per message and hold
one queue row per message for two days. What bounds this is the general machinery,
not anything specific to payments: per-source connection and message limits at
ingress, fair scheduling per sender in pepsi-dispatch, one stored body per
message, and the queue ceilings MAX_QUEUE_ROWS/MAX_QUEUE_BYTES/
MIN_FREE_SPACE (Availability). A merchant backend that is slow or
down is an ordinary stage error: the message is retried with back-off, it is not
released. The residue is that a sender who rotates source addresses can fill the
merchant’s order table, and that the queue ceiling, once reached by held messages,
defers all inbound mail with 452 until the deadlines expire. A per-sender
cap on open orders would not bound it (the attacker rotates sender addresses as
well); the payment-side spending limits of pepsi-stage-auto-pay
already bound the reverse direction.
96.4.7. Information leaks and tracking¶
Unintended disclosure of content, metadata or the reader’s activity.
96.4.7.2. DSNs, MDNs and Delivered-To disclose addresses, readers and topology¶
Several notification and trace mechanisms tell the original sender or later
readers more than the recipient intended. When a recipient forwards mail
automatically, downstream delivery status notifications reveal the confidential
forwarding address, both through their Final-Recipient and Remote-MTA
fields and when the downstream MTA returns its own DSN to the original sender.
RFC 3464 suggests issuing a “relayed” DSN and suppressing further ones,
omitting the remote fields, or rewriting the envelope sender so the forwarder
receives downstream DSNs [rfc3464]. MDNs reveal that and when a message was
read, the client and operating system, and through returned headers internal
host names; a list that passes Disposition-Notification-To through reveals
its subscribers to the original sender [rfc8098]. Delivered-To: fields
record each address to which a message was delivered along a chain of aliases and
forwards, and stay in the header block, so a message forwarded later carries
its recipient’s whole address-transformation path; a system storing one shared
copy for several local recipients cannot add per-recipient fields without
exposing recipients to each other [rfc9228].
Pepsi: Partly addressed. Impact: low.
Most of this Pepsi avoids by design. It generates no MDNs, and
pepsi-stage-list-post removes Disposition-Notification-To
(and Return-Receipt-To) from list posts, so a list does not reveal its
members to a sender who asks for read receipts. Delivered-To: is written
only into each recipient’s own local copy by
pepsi-stage-relay-to-maildir, never into a shared copy, and the
ingress Received: field names a recipient (for <...>) only when the
transaction had exactly one.
Pepsi’s own DSNs keep forwarding addresses confidential. When
pepsi-stage-dot-forward or pepsi-stage-aliases
replaces a recipient by the targets it leads to, each target is marked with the
address that the sender used (state.dsn.rcpt[].expanded_from, set by
pepsi_common::dsn::rebuild_rcpt, not inferred from an ORCPT that the
sender may set itself). A failure or delay DSN that pepsi-stage-bounce writes
for such a target names that address as Final-Recipient and replaces the
remote reply by a generic Diagnostic-Code of the same class (550 5.1.1
delivery to a forwarded address failed), keeping the enhanced Status: code;
an operator template does not see the remote host or reply either. The target and
the real reply go to the journal for the operator, following the confidentiality
remedies of RFC 3464 section 4.2.
The downstream server’s own DSN is kept from the sender too, by the third of
the RFC 3464 remedies: pepsi-stage-srs rewrites the envelope
sender of a forwarded copy so that the forwarder receives its DSNs. It gives
such a copy no SRS address but a forward return address
(fwd+<sealed>=<tag>@SRS_DOMAIN) that seals the original sender and the
address that the sender used under keys derived from the SRS secret. A DSN that
the target’s server sends there is accepted by ingress only from the null sender
and while the address verifies and has not expired, logged for the operator
and dropped; the sender gets Pepsi’s own DSN instead, about the address they
used, with the generic diagnostic and the sender’s own addressing fields only.
What remains lies with others. A reader’s client that answers a
Disposition-Notification-To reveals that and when the message was read;
RFC 8098 has the client ask its user first, and that choice is the user’s.
A forwarding target that forwards onward again discloses its own path to
whatever its DSNs reach.
96.4.7.3. DKIM signatures make stolen mail verifiably attributable¶
DKIM signatures are ordinary long-lived signatures under domain keys that stay published in DNS for years, and nothing limits their validity to the delivery window. A signature that lets the receiving server check origin therefore also lets anybody who later obtains the message prove to third parties that it is genuine and unaltered, whether they got it from a breached mailbox, a leak or a compromised account. Specter, Park and Green (2021) cite the DKIM verification of the 2016 leaks from the U.S. Democratic National Committee and a campaign chairman and its routine use by journalists, and note that one of DKIM’s authors called this an unintended design flaw. Short-lived or weak keys require frequent DNS rotation, which caching makes error-prone. They propose forward-forgeable signatures (KeyForge, TimeForge) under which a server periodically publishes information that lets anyone forge signatures on past messages. The simpler scheme of rotating keys and publishing each old private key is judged operationally impractical at DKIM’s scale, and no standard has adopted either [specter2021].
Pepsi: Partly addressed. Impact: low.
By default the signing daemon pepsi-dkim keeps one RSA and one
Ed25519 key per signing domain for as long as the operator leaves them, and
deletes a retired private key. Every DKIM signature carries an x= expiration
seven days after signing ([stage-dkim-sign] SIGNATURE_EXPIRATION_DAYS), after
which verifiers that honour the tag report it as failed; but x= is itself
signed, so anybody holding the message can still check the signature against the
published key and prove that the domain signed it before that date. Every message
that Pepsi signs therefore stays attributable for as long as the selector is
published, and ARC seals, which carry an x= only when [stage-arc]
SIGNATURE_EXPIRATION_DAYS asks for one, behave the same way. This is the DKIM
standard’s property rather than a Pepsi defect, and DMARC needs a verifiable
signature at delivery time. An operator who cares can turn on the scheme that
Specter et al. consider impractical at large scale but that is feasible for one
deployment: [pepsi-dkim] ROTATION_DAYS rotates the keys on a schedule, and
PUBLISH_RETIRED_KEYS (off by default) makes the daemon publish each retired
private key instead of deleting it, served by pepsi-httpd under
/.well-known/pepsi-dkim-retired/, once its record has outlived every signature
made with it (RETIRE_AFTER_DAYS, Rotating DKIM keys). Mail signed with a
published key can then have been signed by anybody. Mail signed in the current
rotation period stays attributable until its key retires, and neither option is on
by default. A real fix needs a new signature scheme in the standard. Note that
users’ own OpenPGP or S/MIME signatures made through
pepsi-stage-encrypt are attributable on purpose; the
Pepsi-Origin: header uses a symmetric MAC and proves nothing to a third party.
96.4.7.4. Phishing sites cloaked by fingerprinting report-system content fetches¶
Remote objects in HTML mail are fetched when a provider prefetches a message, when the recipient opens it, and again when the provider’s phishing-report system analyses a reported message. Chand et al. (2025) found 14 tracking vectors beyond images, open tracking enabled by default at seven of eight webmail services, and separate prefetch, proxy and inspection subsystems at Gmail, Outlook and Proton Mail that can be told apart by HTTP headers, by which vectors they load, or by their few source addresses. A phishing site can therefore switch itself on only after a genuine open and serve benign content to the inspector: evasive sites stayed up for 24 days while baseline ones were blocked within hours. The recommendations are not to load remote content for reported mail, or to make all fetchers indistinguishable; Google and Proton reacted after disclosure [chand2025].
Pepsi: Not applicable. Impact: none.
Pepsi is a mail transfer and gateway system, not a webmail or a reporting service.
No Pepsi component renders mail or fetches the remote objects that a message
references. pepsi-httpd serves the administrative console, the secure-link
portal and list archives. The outbound HTTP requests that Pepsi makes go to
addresses taken from DNS or from configuration, never to a link found in a
message: key discovery and CRL fetches, MTA-STS policies, TLS-RPT delivery, the
Taler merchant backend, the blocklist and log-list downloads of
pepsi-reputation and pepsi-keys, and a list owner’s template URI. There is
one contained exception: pepsi-stage-vks-confirm follows a key
server’s confirmation link, and only in SPF- or DMARC-authenticated mail from the
configured key server’s own domain, only to that host, and only for a key that
this site is waiting to have confirmed. There is no phishing-report pipeline to
fingerprint. Remote-content tracking in the user’s own mail client is outside
Pepsi’s control.
96.4.8. Misleading display and user decisions¶
Indicators and displays that mislead, and decisions a user cannot be expected to get right.
96.4.8.1. BIMI logos shown on weakly bound or misconfigured authentication¶
Brand Indicators for Message Identification (BIMI) let a mail service show a sender’s logo, optionally backed by a Verified Mark Certificate (VMC), next to messages that pass DMARC under an enforcing policy. The logo is only as strong as the authentication beneath it. Krueger (2020) points out that the DKIM key, DMARC and BIMI records all come from DNS while the VMC’s own key is used for nothing, so whoever can spoof the receiver’s DNS for a brand’s selector can sign forged mail that passes DMARC and earns the verified logo; he proposes requiring the DKIM key to equal the VMC key [krueger2020]. In 2023 Gmail showed UPS’s logo and its verified checkmark on a spoofed message that passed DMARC only through SPF alignment after being relayed through shared Microsoft 365 infrastructure; Google first called it intended behaviour, then required an aligned DKIM pass for the checkmark [theregister2023]. Yajima et al. (2023) found that only 11% of 3,538 BIMI domains had a valid VMC, that some clients show logos without validating any certificate, and misconfigurations ranging from logos served over plain HTTP to expired certificates and DMARC policies too weak for BIMI [yajima2023].
Pepsi: Not applicable. Impact: none.
Pepsi neither evaluates BIMI records nor displays logos, and pepsi-setup
publishes no BIMI record; the indicator lives in mail clients and webmail.
Pepsi’s own trust indicator, the [verified: <address>] subject tag and the
X-Pepsi-Crypto field, follows the lesson of these papers: it is granted
only for an end-to-end signature that pepsi-stage-decrypt
verified against a key of sufficient trust, never for an SPF or DMARC pass. It
names the address that the signer is bound to, and it is withheld when the
From: line as the reader sees it shows another address or more than one
mailbox, or when the signer’s domain looks like a served or otherwise known
domain. Look-alike tags that a sender writes into the subject are stripped
(What a security indicator means). The DNS dependence Krueger describes is discussed for
Pepsi’s inbound checks under Mail routing and sender authentication rely on unauthenticated DNS.
96.4.8.2. Link prefetching triggers one-click unsubscription; forgeable URIs¶
An https: URI in List-Unsubscribe (RFC 2369) is indistinguishable
from any other link, and anti-spam software and link scanners fetch such links
without user action, so a GET-based unsubscription removes recipients whose
mail was merely scanned; list senders then added confirmation pages that
automated receivers cannot complete. RFC 8058 lets the sender signal
one-click support with List-Unsubscribe-Post: List-Unsubscribe=One-Click
and act only on a POST carrying exactly that body. It also names residual
weaknesses: a request can unsubscribe somebody else unless the URI carries a
hard-to-forge identifier of list and recipient; a malicious mailer can make
receiving systems POST to third-party servers; any completed unsubscription
confirms that the address is read. Hence the URI SHOULD be opaque, the request
MUST NOT carry cookies, and the message must carry a valid DKIM signature
covering both header fields [rfc8058].
Pepsi: Addressed. Impact: low.
Pepsi’s list manager follows most of RFC 8058
(pepsi-stage-list-deliver, Mailing lists). With
[pepsi-list] BASE_URL and UNSUBSCRIBE_SECRET set,
pepsi-stage-list-deliver gives each member’s copy a one-click URI whose token
is an HMAC over the list, the member’s address and a serial that the member can
rotate (pepsi_list::unsub), verified in constant time; without a secret no
https: URI is emitted at all. pepsi-httpd serves the target only for
POST, so a scanner’s GET unsubscribes nobody, and answers an unknown token
with the same 404 whatever was wrong. Pepsi does not act as a receiver that
follows List-Unsubscribe links, so it cannot be used to send POSTs at third
parties. Two further points of the RFC are met. The default DKIM header set
(pepsi_common::sign::SIGNED_HEADERS) includes List-Unsubscribe and
List-Unsubscribe-Post, over-signed like the other fields, so the signature
covers both as section 4 of the RFC requires and an intermediary cannot add or
rewrite them without breaking it (the ARC set leaves them out, because the seal is
made on arrival). And the one-click handler in pepsi-httpd/src/web/list.rs
refuses with 400 a POST whose body is not List-Unsubscribe=One-Click, so
an agent that merely found the URI and posted to it unsubscribes nobody. What
remains is accepted by the protocol: the token in every delivered copy lets
anybody to whom the member forwards a list message unsubscribe the member.
96.5. Message format and rendering¶
The parsing of MIME structures, header fields and addresses.
96.5.1. Implementation defects¶
Memory safety, injection, parser differentials and logic errors in a particular implementation.
96.5.1.1. MIME parser differentials let content evade filters and gateways¶
On its way to the reader, one message is parsed several times: by the MTA, by
virus and spam filters, by an attachment scanner and finally by the mail client.
The MIME standards do not say how malformed or ambiguous input is to be read. A
security product that resolves an ambiguity one way and the client behind it the
other way scans something other than what the user is shown. The class was
reported for misused separators (a doubled or missing colon, stray separators in
parameters) in content gateways and antivirus products as early as 2004
(CAN-2004-0052) [corsaire2004], and the framework for internationalised mail
warns that robust parsing of the new malformed UTF-8 forms recreates it
[rfc6530]. Recent differential fuzzing of Postfix, SpamAssassin, ClamAV and
Evolution found 15 root causes, among them duplicate Content-Type or
Content-Transfer-Encoding fields where one parser takes the first and
another the last, header lines that one parser treats as body, LF-only line
ends, base64 split across lines and decoded differently, and misspelled
encodings; three of these smuggled content past SpamAssassin while two clients
displayed it [andarzian2025]. MIMEminer generated 24 bypass methods (19 new) in
three classes: ambiguous header fields (two Content-Type fields, an RFC 2047
encoded-word as boundary), malformed structure (NUL inside a field name, an
empty boundary=) and inconsistent decoding (non-alphabet characters in
base64, whitespace after a quoted-printable soft break); every one of the 16
detectors tested, including Gmail, iCloud and Amavis, was bypassed in some
combination, 102 of 128 detector-client pairs were affected, and 8 vendors fixed
or planned fixes [chen2025]. A single CVE shows the pattern in an MTA: Exim up
to 4.97.1 assembled a multi-line RFC 2231 filename*0/filename*1
parameter differently from clients, so extension-based attachment blocking saw a
harmless name (CVE-2024-39929, fixed in 4.98) [cve-2024-39929].
The attacker needs nothing but the ability to send mail; the gain is malware or spam that the receiving site’s filter never sees and, where clients differ from each other, different content for different readers. The fixes are narrow: vendors patch individual differentials. A receiver-side Internet-Draft generalises them into “coverage equivalence”: validate structure at ingress and reject or quarantine empty boundaries, NUL in MIME header data and conflicting structural fields; never decode more narrowly than the specification allows; add a client-like parse, scan the union of all views and quarantine any difference; and impose hard limits on size, parts, nesting and time [chen2026].
Pepsi: Partly addressed. Impact: low.
Pepsi has no virus or attachment scanner of its own. Content scanning is done by
external filters through pepsi-stage-milter, which hands the filter each
header field as written and the body bytes as stored
(pepsi-stage-milter). Pepsi’s own content filter is the
Mailman-compatible mime-delete handler of pepsi-stage-list-post
(pass_types, filter_extensions, pass_extensions). It reads the
structure with pepsi_common::mime::Builder, which takes the first
Content-Type and treats a multipart whose declared boundary never occurs as
a leaf. What those parsers and the recipient’s client are given is therefore
decided once, at ingress ([pepsi-ingress] MIME_ANOMALIES,
Ambiguous MIME is settled at the boundary), along the split that the receiver-side draft
proposes [chen2026]. The hard classes, where no reading is right, are refused
at DATA with 554 5.6.0: an empty boundary=, a NUL byte in a MIME
entity’s header block, two Content-Type or Content-Transfer-Encoding
fields that disagree, and an RFC 2047 encoded-word as boundary. The soft
classes are those where the standards already say how a decoder must read the
input. Before the message is stored, they are rewritten to that one reading, so
every later reader sees the same structure. They are an unrecognised transfer
encoding (the entity is application/octet-stream, RFC 2045 §6.4), whitespace
after a quoted-printable soft break (deleted, §6.7), characters outside the
base64 alphabet (ignored, §6.8), a missing close delimiter (the multipart ends
with its enclosing entity, RFC 2046 §5.1.1), a delimiter line of the multipart’s
own boundary after its close delimiter (the epilogue is ignored, §5.1.1, so the
epilogue and the “part” some readers would show in it are dropped), and
identical duplicate fields. Signed and encrypted entities are never rewritten.
The order is verify, normalise, seal: SPF, DKIM and DMARC are assessed on the
bytes as received, so Pepsi’s own verdict is unaffected, and the ARC seal covers
the stored bytes. A message that arrived carrying a chain is rewritten by
pepsi-stage-arc between verifying that chain and sealing it; a message
without a chain is rewritten by ingress itself. After the rewrite, the message’s
original DKIM signature does not verify at the next hop, which is what the seal
is for. RFC 2231 continuations are reassembled by pepsi_common::mime_param,
which closes the specific Exim mistake. MIME_ANOMALIES = log counts and logs
without refusing or rewriting.
Where Pepsi itself makes a security decision from MIME structure it fails safe:
the decrypt stage’s classifier (pepsi_crypto::mime) treats anything it cannot
identify as potential ciphertext (LayerKind::Opaque) and isolates protected
content before decryption, so an unreadable structure cannot earn a better
verdict than a readable one (pepsi-stage-decrypt,
Signature spoofing via partial signing and MIME/CMS wrapping). One differential is accepted by
design: for an application/pkcs7-mime entity the classifier believes an
explicit smime-type parameter and looks at the CMS ContentInfo inside
only when the parameter is absent or unrecognised
(pepsi_crypto::mime::SmimeType); a label that misdescribes its DER costs
the message a failed decryption or an unverified signature, never a tag. On
the second point of [rfc6530], Pepsi downgrades SMTPUTF8 headers per next hop
but never invents an ASCII address for an internationalised one; a non-ASCII
address that the next hop cannot carry is a permanent failure.
What remains is the long tail outside those ten classes. A header line with no
field name, an invalid quoted-printable escape, raw 8-bit bytes in a
quoted-printable part, an unparseable Content-Type, a multipart whose
boundary never occurs in its body, and anything nested deeper than 32 levels are
stored as received. Pepsi adds no client-like second parse of its own, so a
filter and a client that both depart from the standards on such a shape can
still disagree. Settling these shapes at ingress would risk refusing or
rewriting legitimate mail without a standard reading to rewrite to, so nothing
further is left for Pepsi’s code: the remedy is filters and clients that follow
the standards, and an operator who chooses the filters. None of the sources
measures whether the default costs legitimate mail, so it is measured here.
Three working mailboxes were scanned with a deliberately naive parser that
repairs nothing; they held 97,891 messages received over several years,
dominated by mailing-list, research and project mail, so not a representative
sample of Internet mail, but likely the right order of magnitude. Bare LF cannot
be measured from stored mail (Dovecot stores LF) and is in any case refused at
DATA already.
Class |
Messages |
Share |
|---|---|---|
Hard classes (empty boundary, NUL in a MIME header, conflicting duplicate fields, encoded-word boundary) |
0 |
0 |
Soft classes, together |
28 |
0.03 % |
of which: identical duplicate |
7 |
0.007 % |
of which: multipart without a close delimiter |
20 |
0.02 % |
of which: base64 with characters outside the alphabet |
1 |
0.001 % |
of which: misspelled transfer encoding; whitespace after a soft break |
0 |
0 |
Other malformations, together (a header line with no field name, an
invalid quoted-printable escape, raw 8-bit bytes in a quoted-printable
part, an unparseable |
78 |
0.08 % |
Benign shapes excluded: a non-empty multipart preamble; a
|
17,367; 187; 1,188 |
17.7 %; 0.2 %; 1.2 % |
The seven duplicate fields were all identical copies, so not one message in
the sample would have been refused, and the rewrite touches about one message
in 3,500, most of them a missing close delimiter that every client already
reads as closed. A delimiter line after the close delimiter was not counted
separately in this sample. The second group, about one in 1,250, is the open tail above;
MIME_ANOMALIES = log is how a site measures its own traffic before trusting
the default.
96.5.1.2. Ambiguous From headers checked as one address and displayed as another¶
RFC 5322 lets From: hold a mailbox list or a group, comments, quoted
strings, obsolete route syntax and RFC 2047 encoded-words, and offers no
guidance for malformed values. The component that authenticates the sender
(DMARC alignment, a provider’s submission check, a gateway’s key lookup) and the
client that displays the author therefore often extract different addresses.
Chen, Paxson and Jiang showed that mailbox lists, encoded-words around an
address, route syntax, quoted-pairs and delimiter precedence all diverge
between servers and clients, and that invisible characters or a base64-encoded
address make DMARC find no policy while the client shows the real domain
[chen2020]. Shen et al. tested 30 services and 23 clients with multiple
mailboxes, null members, mutated brackets, truncating characters (NUL,
invisible Unicode, ;) and encoded-word addresses, and bypassed DMARC at Gmail
and Yandex [shen2021]. Mailsploit had shown in 2017 that 33 clients, among them
Apple Mail, Thunderbird and Outlook, decode an encoded-word in From: and then
truncate at an embedded NUL or stop at the first address-like text, so the
authenticated domain is hidden and, in some webmail, script can be injected
[haddouche2017].
The submission side is the second half. A provider that checks only the address
that it extracts lets an authenticated user add another: a From: combining
the user’s own angle-address with a victim’s (e.g. <own>:<victim>), multiple
display names, characters appended after the angle-addr or characters that
clients drop [yu2022a] [slonser2024]. The message is DKIM-signed by the
provider and passes DMARC at the receiver, while clients that show the last or
the decoded address display the victim; CERT/CC listed Microsoft as affected in
2025 (VU#517845) [certcc2025], and FakeBehalf combined such From: forms
with a forged Sender: to make the deception consistent, misleading all 20
clients tested [ma2024]. A commercial encryption gateway parsed From: with
regular expressions, so a second address inside a comment was taken as the
sender for internal-sender checks and signature verification (fixed in SEPPmail
15.0.1) [doerig2026]. The agreed fixes are to reject messages without exactly
one well-formed From:, to parse it strictly and identically for
authentication and display, and to check every address at submission.
Pepsi: Addressed. Impact: low.
Pepsi reads From: for display with one comment- and quote-aware rule:
split_mailbox_list separates top-level mailboxes and mailbox_addr_spec
locates the angle-addr outside quoted strings and comments
(pepsi_common::domain; pepsi_crypto::mime::first_address is the same
rule). Ingress refuses a second From: field (550 5.6.0) and counts
From : as a From: field too; the whitelist stage matches only a
From: naming exactly one mailbox (addr_spec_of_header); and the
regular-expression confusion of [doerig2026] (ceo@victim.example
(<me@example.org>)) is checked as the client reads it (Security model, “The
submission identity”).
Where a From: is vouched for, Pepsi reads it strictly. The RFC 6409
submission gate (submission::submitted_from_addrs in pepsi-ingress)
parses every mailbox with pepsi_common::domain::strict_mailbox_list and
checks each against USERNAME_MAP; it refuses with 550 5.6.0 a missing
From:, a pure group, and any mailbox that a client could resolve to a
different address: text other than CFWS after the angle-addr
(<me@ours.example>:<ceo@victim.example>), a second angle-addr, a display
name that is not a phrase, group or source-route syntax, and an encoded-word in
the addr-spec. pepsi-stage-dkim-sign takes its signing domain from the same
strict reading (signing_domain_of_from) and refuses a message whose
From: it cannot read one way, so the CERT/CC case does not get Pepsi’s DKIM
signature (with SIGNING_DOMAIN set the stage does not read From: at
all). The gate also refuses (550 5.6.0) a well-formed display name or
comment that names an address other than its own mailbox’s
("ceo@victim.example" <me@ours.example>), judged as rendered: encoded-words
decoded, NFKC-normalised so a full-width or small commercial at reads as @,
invisible and bidirectional controls removed
(pepsi_common::indicator::display_name_claim); the mailbox’s own address in
its name stays allowed. Inbound, the same test marks such mail with
X-Pepsi-Warning: display-name-claims-other-address and
state.auth.display_name_mismatch instead of refusing it, and the From:
is left as it is. The rest of the inbound side is fail-open, and marked rather
than refused: a From: naming mailboxes in several domains is checked against
each domain’s DMARC policy (RFC 7489 section 6.6.1, up to ten domains) and
rejected only under DMARC_ENFORCE, which the wizard writes for a new
installation while the compiled-in default is off
(Multiple or duplicate From headers evade DMARC and DKIM checks). Whatever the verdicts, an
inbound From: that the strict reading refuses (an encoded-word or
obsolete-syntax address, text after the angle-addr, a second angle-addr, a
group) or that names mailboxes in more than one domain earns X-Pepsi-Warning:
from-ambiguous and the [external] subject tag, since no single verdict
describes the author a given client shows; RFC 5322 permits a mailbox list, so
refusing it would break the protocol for a display problem, and a rewrite would
break the sender’s signature. A DMARC failure that was recorded but not acted on
earns X-Pepsi-Warning: dmarc-fail-not-enforced and the same tag. A From:
mailbox at a served domain earns X-Pepsi-Warning:
served-domain-not-authenticated and the tag when neither DMARC nor an aligned
DKIM or SPF pass authenticates it; a field naming several domains counts as
authenticated only by DMARC (pepsi-ingress’s external module). The
signer binding of pepsi-stage-decrypt checks the first mailbox
(pepsi_crypto::mime::sender_address), but withholds valid, reporting the
signature as valid-untrusted with withheld= in X-Pepsi-Crypto, when
the From: names more than one mailbox, when its display name or a comment
shows another address, when an anchored certificate names no mailbox, when the
signer’s domain is a look-alike of a served or known domain, and when a
protected From: or Reply-To: inside the signed entity differs from the
outer one, except for a Reply-To: that a mailing list added
(binding_withholds and the protected module), so [verified: addr]
never stands beside a second, unverified author (What a security indicator means). What
remains is the client’s display of such a field, which the mark warns about but
cannot change. See also Multiple or duplicate From headers evade DMARC and DKIM checks and
Sender display deception: display names, look-alikes, RTLO and truncation.
96.5.1.3. Address parsers extract the wrong addr-spec from encoded or malformed input¶
Web applications grant access, organisation membership or sign-up by the domain
of a verified address, and verify it by sending mail. When the library that
parses the address, the code that checks its domain and the MTA that delivers
the verification mail disagree about which addr-spec a string denotes, an
attacker verifies an address at a domain they do not control. CPython’s
email.utils.parseaddr/getaddresses up to 3.11.3 took part of a display
name as the addr-spec for some inputs (CVE-2023-27043); CPython later added a
strict mode [cve-2023-27043]. Heyes showed that the Ruby Mail gem decodes RFC
2047 encoded-words (any charset, UTF-7 included) inside local parts and domains,
so a validated string decodes into an address with a second @, a closing
> or a NUL; he verified addresses at microsoft.com and github.com on GitHub
and bypassed domain-restricted sign-up at Zendesk and GitLab (fixed in 2024)
[heyes2024]. The same work found back ends that reduce code points modulo 256,
turning harmless characters into @ or < after validation, and a PHP IDN
library that decoded malformed Punycode into HTML special characters, giving
stored CSS injection and remote code execution in Joomla (CVE-2024-21725)
[heyes2024]. Jakarta Mail’s InternetAddress accepts <a@b>c@d as a@b
and group syntax, its two-argument constructors do not validate at all,
MimeMessage decodes encoded display names, and Hibernate’s @Email accepts a
quoted local part containing @ [elttam2025]. The fixes are strict modes,
refusing encoded-words in addresses, and using the parsed address, not the
input string, for every identity decision.
Pepsi: Addressed. Impact: none.
Pepsi has no sign-up keyed on an address domain; its analogous decisions are the
USERNAME_MAP grant (which may contain *@example.org globs), list
subscription and moderation, the per-address settings, key and whitelist tables
and local delivery. Envelope addresses are taken from the SMTP path as written:
control characters are refused, an RFC 5321 source route is stripped rather than
stored, and the domain is the part after the last @ both when the address is
checked and when it is routed (pepsi-ingress/src/smtp/command.rs). No Pepsi
component interprets % or ! routing, and no component decodes an
encoded-word inside an address: decode_encoded_words is applied to subjects
and display names only, and neutralises control characters in what it returns.
Addresses that Pepsi stores and mails to from the list web forms, the list REST
API and the command interface pass pepsi_common::domain::validate_email,
which is deliberately narrower than RFC 5321 (dot-atom atext only, so no
quoted local part, no second @, no non-ASCII), and keys are indexed on a
UTS-46 normalised domain. Pepsi is written in Rust, where no code-point
truncation of the kind Heyes found occurs, and its web pages are rendered by
askama with escaping on. In one place Pepsi reads a header address more
leniently than a client may display it: trailing text after an angle-addr in
From:. This is assessed under Ambiguous From headers checked as one address and displayed as another.
96.5.1.4. CRLF and header injection through address parsing and serialization¶
An application that copies text from an attacker (a registration address, a
name, a subject) into a header field or an SMTP command lets the attacker add
header fields or whole SMTP commands, if its library does not refuse line
breaks. Slonser found that RFC 5322 domain literals ([...]) are accepted
with CR, LF and NUL inside by Python’s parseaddr and the JavaScript
addressparser, and that .NET’s MailAddress strips newlines except inside
a domain literal, which SmtpClient then writes into the dialogue, so a
password reset form can be made to send arbitrary authenticated mail from the
site [slonser2024]. CPython’s email serialiser did not quote or refuse
newlines in header values, letting attacker text become new header fields
(CVE-2024-6923, fixed in 3.8.20 to 3.13.0rc2) [cve-2024-6923]. The fix in both
cases is to refuse control characters in addresses and to have the serialiser
refuse or encode line breaks.
Pepsi: Addressed. Impact: none.
Every path by which outside text reaches a header that Pepsi writes, or a
command that it sends, refuses line breaks at least once. pepsi-ingress
rejects control characters in envelope addresses and EHLO arguments before
they are interpolated into the Received: trace header, rejects a DATA line
not ended by CRLF and normalises BDAT bodies to CRLF
(SMTP smuggling via inconsistent end-of-data handling). The outbound SMTP client refuses to send any
command line containing CR or LF (pepsi_common::smtp::client). Header values
built from inbound material go through pepsi_common::header::sanitise_value
(CR, LF, NUL and other control characters become spaces) before folding, display
names through pepsi_common::mime::quote_phrase and decode_encoded_words,
both of which drop control characters, and the Sender: written by the
submission fixup refuses an identity containing a control character or >;
USERNAME_MAP refuses such tokens when it is read. Addresses from web forms
and the list API must pass validate_email, which accepts no domain literal
and no control character. The generic Builder::header writer in
mime_build does not sanitise on its own, so the protection rests on its
callers, which must pass values that came through these helpers; no caller that
passes raw inbound text was found.
96.5.1.5. Memory corruption in MTA and MUA MIME parsers¶
MIME parsing code written in memory-unsafe languages, or using unsafe
blocks, is reached by every message that any stranger sends. Coverage-guided
fuzzing of the C MIME parsers of Postfix and Evolution found numerous crashes,
including memory corruption and assertion failures, even though both projects
are enrolled in OSS-Fuzz, whose harnesses evidently do not reach this code;
analysis and reporting were still in progress at publication [andarzian2025].
In Rust, the unmaintained mail-internals crate (part of the mail-*
suite) has a use-after-free in its unsafe helper vec_insert_bytes,
reached through the EncodingWriter used to encode headers and content; there
is no fixed release, and users are told to move to the -ng forks
(RUSTSEC-2023-0054) [rustsec-2023-0054]. The impact is at least a crash of the
parsing process and potentially code execution with its privileges.
Pepsi: Addressed. Impact: none.
Pepsi’s MIME, header and address parsers (pepsi_common::mime, mime_build,
mime_param, header, domain, pepsi_crypto::mime and the CMS code) are
safe Rust; the only unsafe blocks in that code are volatile writes that zero
key material when it is dropped (in pepsi_crypto::smime and, for
SecretKey, in pepsi-crypto/src/lib.rs). Pepsi does not depend on
mail-internals, and mail-parser, which it uses through mail-auth and
directly, forbids unsafe code crate-wide (#[forbid(unsafe_code)]).
cargo deny check, one of the gates every change must pass, fails on any
crate with a RustSec advisory. The parsers are fuzzed by eight libFuzzer
targets under fuzz/fuzz_targets/
(Test Suite): parse, classify, cms and pgp for the inbound
message and crypto parsers, bounceparse, mimebuild, pickle21 and
mboxsplit for the mailing-list and archive code. The first four have run
under AddressSanitizer in a many-core campaign without a finding, and a message
that crashes a worker is struck out after three attempts instead of blocking a
stage (A remote sender). docs/ROADMAP.md records what is still to do:
the four list and archive targets under AddressSanitizer, nightly runs from the
previous night’s corpus, and a structure-aware X.509 target; the C libraries
below sequoia (nettle) and mail-auth (aws-lc) are not
sanitizer-instrumented, so a memory error inside them would go unnoticed.
External filters and MDAs that Pepsi hands mail to (a milter, Dovecot over
LMTP) parse it with their own code and are outside this assessment
(Memory corruption in antivirus file parsers reached via mail).
96.5.1.6. Non-shortest UTF-8, byte swallowing and invisible-character mismatches¶
Unicode processing lets text pass a check in one form and take effect in
another. The Unicode Security Considerations report lists the non-visual cases:
decoders that accept non-shortest UTF-8, so a two-byte backslash passes a filter
that looks only for the one-byte form; converters that, on an ill-formed byte,
also swallow the following valid byte (deleting a > and opening a cross-site
scripting hole); silent deletion of noncharacters or other code points after a
filter has run (java<U+FEFF>script:); components that compare identifiers
under different normalisations or case foldings, so a new user obtains an
existing identity’s rights; legacy charsets converted differently by different
vendors; and buffer overruns when casing or normalisation expands text
[unicode-tr36]. The remedies are conformant UTF-8 decoding (reject non-shortest
forms, substitute U+FFFD instead of deleting, never consume a valid successor
byte), never deleting code points invisibly, and one normalisation and
comparison used by every component.
Pepsi: Addressed. Impact: low.
The decoding half is handled by the language: Rust’s str is always valid
UTF-8, non-shortest forms are rejected, and the lossy conversions that Pepsi
uses on header bytes (String::from_utf8_lossy) substitute U+FFFD per maximal
ill-formed subsequence without consuming the following valid byte; buffers grow
as needed, and charset conversion of encoded-words is delegated to
mail-parser. Where a security indicator is judged, invisible and
bidirectional characters are removed before the comparison and look-alikes
folded (pepsi_common::indicator), which is the order the report asks for.
Identifiers are compared in one form. Every address that serves as a key is
stored and looked up in the canonical form of
pepsi_common::address::canonical: NFC, then Unicode simple case folding of
the local part, then the A-label form of the domain. This covers a settings
override, a config_override address: or domain: scope, a whitelist
pattern and the From: that it is matched against, the auto-reply and
challenge logs, list members, bans and rate counters, the key store, and the
console’s own: principals. Delivery folds local parts the same way
(pepsi_common::local::fold_local_part), and so does the recipient check at
RCPT time, so the check, the delivery and every per-address record agree on
which mailbox ÄBC@, äbc@ and a + U+0308 + bc@ name. Served
domains are compared by IDNA form at ingress and in delivery
(ACCEPTED_DOMAINS, Locality::is_local_domain).
The database computes the same keys without depending on its collation:
pepsi.canonical_address() applies the same folding table (generated from
CaseFolding.txt) with translate() and PostgreSQL’s normalize(),
never the collation-dependent lower(), and a test checks that it and the
Rust function give byte-identical keys on the literature’s hard cases (Turkish
dotted and dotless i, German ß, Greek final sigma, combining accents, U-label
and A-label domains) and on every character the folding table touches, under
the database’s collation and under C. Simple folding maps one character to
one, which is what makes that agreement possible; the price is that ß and
ss remain two local parts, the conservative reading for a local part whose
meaning belongs to the receiving host. An upgrade re-keys stored rows; rows that
collapse into one are merged (the whitelist keeps the union of the
requirements, overrides the newest row) and each merge is written to
event_log. A row holding a wrapped secret keeps its spelling, because the
spelling is part of what the secret is bound to, and is logged for the operator.
96.5.2. Protocol design gaps¶
Weaknesses of the design itself: missing bindings between identities, optional protection that can be stripped, and other design flaws.
96.5.2.1. Unauthenticated Sender header and inconsistent on-behalf-of display¶
The RFC 5322 Sender: field names the agent that sent a message on behalf of
the From: author, but no authentication mechanism covers it: SPF checks the
envelope sender and DKIM/DMARC bind only to the From: domain. Ma et al.
(FakeBehalf, 2024) found that all 16 providers they tested delivered mail with
an arbitrary Sender: to the inbox, and that there is no convention for
displaying delegation: 13 of 20 clients show Sender: as “on behalf of”,
others show nothing, and a missing Sender: suppresses the display
altogether. An attacker therefore chooses the delegate the recipient sees, for
instance a colleague inside the recipient’s own organisation; half of the 50
participants of their user study judged such mail legitimate [ma2024]. The
authors propose that the first receiving server validate Sender: against
MAIL FROM and replace it with a server-generated one when From: is not
aligned or names several authors, and that clients always show the delegate and
warn when one is present.
Pepsi: Partly addressed. Impact: low.
As a submission server Pepsi does what the paper asks: for every SASL or
SO_PEERCRED submission whose USERNAME_MAP grant names a concrete
address, pepsi-ingress replaces a client-written Sender: with the
submitter’s canonical identity when From: names an alternate address or
several mailboxes (submission::prepend_sender), and removes it when
From: is the submitter’s own address (submission::strip_sender), so
Pepsi never signs a Sender: the submitter chose (Security model, “The
submission identity”). A grant made only of wildcards (*@example.org) has no
single identity to assert and leaves the field as written. A MYNETWORKS
entry outside loopback that no SENDER_MAP network key covers is refused at
start-up (sender_map::check_bound_trusted_networks); mail relayed from
loopback, or from a network the map grants * as an explicit decision, has no
per-user identity to compare and is not rewritten. A session that SENDER_MAP
binds goes through the same fixup as an account; it is bound by a network entry,
or by a client certificate recognised under a pinned key or CA (an unbound
certificate authenticates nothing).
Inbound, a Sender: naming a mailbox at one of the served domains is the
paper’s colleague case, and it is marked: when no DKIM signature that verified
has a d= organisationally aligned with that mailbox’s domain, and no SPF
pass has a MAIL FROM aligned with it, pepsi-ingress adds
X-Pepsi-Warning: served-sender-not-authenticated and the [external]
subject tag (every Sender: field counts, pepsi-ingress’s external
module). A Sender: at a foreign domain is left unmarked: mailing lists and
delegation services set one legitimately, and a tag for a stranger’s own
domain would say something other than what it means (a served-domain claim
nobody authenticated). Pepsi does not rewrite or remove the field as the paper
proposes, because that breaks DKIM signatures that cover it and loses
legitimate delegation information. Where a message has no From:,
pepsi_crypto::mime::sender_address falls back to Sender: for the signer
binding, which matches what clients then display. The remaining exposure is
the client’s display of a foreign delegate; the fix is in the clients, and
nothing further is left for Pepsi’s code.
96.5.3. Missing or incorrect checks¶
A signature, certificate, policy or input that is not checked, or checked wrongly.
96.5.3.1. Unnormalised address aliases create unlimited distinct accounts¶
Mail providers map many address variants to one mailbox: every one of 28
providers studied folds case in the local part, 12 support further syntactic
aliases such as +suffix or ignored dots, eight do so silently, and only
Gmail documents its rules completely. Platforms that use the address as an
account identifier cannot normalise variants they do not know: only 5 of 18
tried, each with provider-specific rules, none covered all providers, and npm
and PyPI even treat the domain as case-sensitive. One mailbox can therefore
register an unlimited number of “distinct” accounts for free trials, sock
puppets or spam; Wu et al. found 1,062 base addresses behind several npm or
GitHub accounts, one behind 139 npm accounts that published 3,904 SEO-spam
packages [wu2026]. They recommend that providers standardise and document alias
syntax (+ suffixes only) and limit aliases per mailbox, and that platforms
normalise at registration and notify the base address when a variant registers.
Pepsi: Partly addressed. Impact: low.
As a mail provider Pepsi has one alias rule: the local part is lower-cased and
a sub-address after [pepsi] RECIPIENT_DELIMITER (default +) is stripped
for local delivery (pepsi_common::local), which is documented and can be
switched off (RECIPIENT_DELIMITER = none); there is no dot or infix aliasing.
Users of a Pepsi domain can nevertheless mint unlimited + variants to sign up
at third-party platforms, which is the provider half of the problem and the
standard behaviour the paper itself recommends keeping.
Pepsi has no account registration keyed on an address, but it keeps
per-address state for outside correspondents: list memberships, the list
SENDER_POSTS_PER_HOUR count, the per-sender suppression windows of vacation
notices and payment requests, and the anti-spam payment state. These are keyed
on the lower-cased address as given, so a correspondent whose provider aliases
silently appears as many senders, each with its own rate count and window.
Since an attacker who owns a domain can mint distinct addresses anyway, this
weakens a per-sender limit only for senders without their own domain. Normalising
foreign aliases would need provider-specific rules that no standard defines, and
an operator who wants no aliasing on their own domains can disable the delimiter.
96.5.4. Resource exhaustion and abuse¶
Exhaustion, amplification and the abuse of a service to attack others.
96.5.4.1. Resource exhaustion from deep MIME nesting and huge address headers¶
Message parsers that recurse into MIME parts or accumulate header data without a bound can be made to spend unbounded CPU or memory by one message, and a message that crashes or stalls delivery is retried and blocks the recipient’s mail. Three Dovecot advisories illustrate it: the submission, LMTP and LDA components recursed into deeply nested MIME parts without a sufficient limit before 2.3.11.3 (CVE-2020-12100) [cve-2020-12100]; parsing a message with very many address header lines was worse than linear in their number, 100,000 lines taking 12 seconds and 500,000 eighteen minutes in production, up to 2.3.21 (CVE-2024-23184) [cve-2024-23184]; and the header parser accumulated each header value into an unbounded buffer (CVE-2024-23185), though the MTA’s message size limit usually kept it within Dovecot’s memory limit [cve-2024-23185]. All are fixed in Dovecot; the advisories’ interim workaround was to restrict the number and size of headers in the MTA in front of Dovecot.
Pepsi: Addressed. Impact: low.
Pepsi’s own parsers are bounded: pepsi_common::mime and mime_build stop at
a nesting depth of 32 (MAX_MIME_DEPTH) and 10,000 parts
(MAX_MIME_PARTS), the crypto classifier at depth 16 and 256 parts, and
mail-parser limits nested encoded messages; header and folding parsers are
iterative and linear. Ingress bounds the whole message by MAX_MESSAGE_SIZE
(25 MiB), data lines at 1 MiB and recipients at 1000, and a worker that times out
or crashes on a message is struck out after three attempts
(Availability).
Ingress also applies the workaround that the Dovecot advisories ask of the MTA
in front: at the end of data it refuses, with 552 5.3.4 and on every
listener, a message whose top-level header block has more than
MAX_HEADER_FIELDS (default 1000) fields or one field larger than
MAX_HEADER_FIELD_SIZE (default 100 KiB, counted unfolded). The check is one
linear pass (pepsi_common::header::field_stats) before anything else parses
the block. Ordinary mail carries 20 to 150 fields and a To: naming a
thousand recipients is about 40 KiB, so the defaults cost no legitimate mail. A
unit test feeds a header block at both caps (1000 fields, one To: of 3000
mailboxes near 100 KiB) through the header counter, the mailbox-list splitters,
the display-name check and the MIME anomaly walk. Header blocks of attached
message/rfc822 parts are not counted; they stay bounded by
MAX_MESSAGE_SIZE and the depth and part limits above. An MDA behind Pepsi
that parses those blocks badly is still exposed to them, so operators keep the
MDA patched.
96.6. Mail software¶
Defects of particular mail servers, mail clients, webmail and administration interfaces, and encryption and filtering gateways.
96.6.1. Implementation defects¶
Memory safety, injection, parser differentials and logic errors in a particular implementation.
96.6.1.1. Memory corruption in MTA SMTP command, reply, TLS and DKIM handling¶
The SMTP server of a mail transfer agent parses attacker-controlled input
before any authentication: command lines and their name=value parameters,
BDAT chunk framing, TLS handshake data, DKIM signature tags, SPF and DNS
answers. In the MTAs written in C, small errors in how they handle indexes,
lengths and lifetimes in that input have repeatedly become remote code
execution. NIST’s
mail-server guideline already named the mail server application itself as one
of the most attacked components of a network [tracy2002]. Sendmail’s SMTP
timeouts used signal handlers with longjmp that were not async-signal-safe,
so a client controlling the pace of a session could corrupt memory
(CVE-2006-0058, fixed in 8.13.6) [cve-2006-0058]. Exim has been hit
particularly often: a use-after-free in the CHUNKING code, which had just been
switched on by default (CVE-2017-16943, about 200,000 exposed servers, plus a
crash bug,
CVE-2017-16944) [cve-2017-16943]; a heap overflow triggered by a TLS SNI ending
in a backslash and a NUL (CVE-2019-15846, root code execution, fixed in 4.92.2)
[exim2019]; and, in the 21Nails audit, out-of-bounds accesses in
MAIL FROM/RCPT TO parameter extraction and command-history handling,
a use-after-free in the OpenSSL write path that Qualys exploited for
unauthenticated code execution, and an unchecked length when comparing a DKIM
bh= value (CVE-2020-28018, -28022 to -28025, fixed 2021-05-04)
[qualys2021]. The 2023 ZDI batch added an out-of-bounds read on DNS answers
(CVE-2023-42119) and an integer underflow in libspf2 reachable through SPF
evaluation [exim2023].
The client side and internal channels are no safer. OpenSMTPD’s reply parser read past a bare three-digit last line of a multi-line reply and appended attacker-controlled bytes to the reply text, which was then written unescaped into a line-oriented envelope file, giving a malicious receiving server command execution as root (CVE-2020-8794) [qualys2020b]. An earlier OpenSMTPD audit found that its unprivileged certificate-verification process trusted lengths and offsets in inter-process messages and that a peer certificate over 64 KiB silently truncated those messages, so a remote peer could corrupt memory across the privilege-separation boundary [qualys2015]. The fixes were in every case patches to the specific parsers; the general lessons drawn by the authors are to bounds-check every parser of network input, validate inter-process messages in the receiver, and never store remote text in a line-oriented control file.
Pepsi: Addressed. Impact: none.
Every network-facing parser in Pepsi is safe Rust: the SMTP server
(pepsi-ingress/src/smtp/session.rs, command.rs), the SMTP/LMTP client
(pepsi-common/src/smtp/client.rs), TLS (rustls), DNS (hickory) and DKIM,
SPF, DMARC and ARC (the vendored mail-auth crate, so no libspf2). The few
unsafe blocks in the tree wrap system and library calls (umask,
getrlimit, fork and pre_exec hooks, killpg, one GSSAPI credential
call, environment changes before threads exist, a volatile wipe of key bytes)
and do not touch protocol input; indexing is bounds-checked, so the errors above
become a panic that ends one connection task (the release profile unwinds),
not memory corruption. Inputs are bounded explicitly:
command and data lines have length limits, RCPT is capped at 1000 per
transaction, BDAT sizes are checked against MAX_MESSAGE_SIZE before any
byte is buffered, and the client’s read_reply requires three ASCII digits
plus a space or hyphen on every line, insists on a consistent code, and caps a
reply at 256 lines and 64 KiB, so the OpenSMTPD reply bug has no analogue.
Reply text is stored as JSON under state.bounce and collapsed to one line
before pepsi-stage-bounce puts it into a Diagnostic-Code field.
Timeouts are tokio futures, not signal handlers. There is no PROXY-protocol
support, so CVE-2023-42117 has no counterpart. The worker and helper protocols
are line-based but carry only ids, status codes and re-validated values (see
Newline injection and truncation in spool header files).
pepsi-ingress also runs as its own unprivileged account with systemd
sandboxing. Its database role may add rows to the queue but may never read or
alter queued mail; besides that, it may read only a few lookup tables: the
configuration overlay, quotas, login assignments, the IP blocklists and the
cached certificate revocation lists (The privilege split). Even a future parser
bug on port 25 would therefore reach far less than root. What remains is shared
with all software: C and assembly code in dependencies (aws-lc and ring for TLS
primitives, Nettle under Sequoia, the system GSSAPI library for Kerberos
authentication to a smarthost) and unsafe code inside Rust crates
(Memory-safety bugs hidden in unsafe Rust code).
These are tracked through cargo deny check against the RustSec advisory
database, and cargo vet --locked fails the build on a crate added or
updated without a recorded audit decision (The supply chain).
96.6.1.2. Memory corruption in SMTP AUTH, SASL and IMAP pre-authentication code¶
Authentication code runs before the client is known, decodes base64 and parses
mechanism-specific structures, and is therefore a favourite pre-authentication
target. Exim’s b64decode allocated 3*(len/4)+1 bytes but wrote one more
for invalid input of length 4n+3; Meh Chang turned that single attacker-
controlled byte into a heap overlap and then into command execution through
Exim’s own string expansion, bypassing PIE, NX and ASLR, against an estimated
400,000 servers offering CRAM-MD5 (CVE-2018-6789, fixed in 4.90.1)
[chang2018]. In 2023 ZDI published, before a fix existed, an out-of-bounds
write in Exim’s external authenticator: the shared parser stored at most
four NUL-separated values but counted all of them, and the authenticator wrote
at the counted index (CVE-2023-42115, rated 9.8, considered hard to exploit by
watchTowr) [zdi2023]; the same batch contained an out-of-bounds read and a
stack overflow in the SPA/NTLM authenticator (CVE-2023-42114, -42116)
[exim2023]. Postfix reused a Cyrus SASL server handle after a failed attempt,
so a second AUTH with a different mechanism corrupted the heap
(CVE-2011-1720) [cve-2011-1720], and Dovecot’s IMAP and ManageSieve parsers
mishandled a NUL inside a quoted string, an out-of-bounds write reachable from a
client command (CVE-2019-11500) [cve-2019-11500].
The common pattern is an unauthenticated network attacker, a decoder or state machine in C, and code execution as the mail service account. The fixes were patches, plus the advice to disable mechanisms that are not needed (SPA, EXTERNAL) and to reset all per-attempt state after a failed exchange.
Pepsi: Addressed. Impact: none.
pepsi-ingress offers only PLAIN and LOGIN (pepsi-ingress/src/sasl.rs),
and only on a TLS session; there is no SPA, CRAM or EXTERNAL code. Base64 is
decoded by a Rust crate, the authentication line is length-limited (500
5.5.6 for an over-long exchange), and the session is closed after
MAX_AUTH_FAILURES failures, with a per-range AUTH_FAILURES_PER_HOUR
bucket in limits.rs refusing further attempts before SASL is even asked
(A remote sender). The only verification backend is Dovecot’s auth
service: each attempt opens a fresh connection, so no state survives a failed
exchange as in CVE-2011-1720, and the credentials are re-encoded into a single
base64 resp= field so that a tab or newline in them cannot inject fields
into Dovecot’s line protocol. Pepsi has no IMAP or ManageSieve server; its only
IMAP code is the client used by pepsi-whitelist import, which runs in the
unprivileged pepsi-helper-mailbox-scan.
What remains outside Pepsi is the C code it talks to: a site that uses the
Dovecot SASL backend or delivers through pepsi-stage-relay-to-lmtp depends
on Dovecot being patched (CVE-2019-11500 was in Dovecot itself), which is the
operator’s update duty rather than a Pepsi weakness.
96.6.1.3. Buffer overflows in address, comment and .forward parsing¶
Address syntax in e-mail is unusually rich (comments, quoted strings, route
syntax), and MTAs written in C have parsed it into fixed buffers with
hand-written bounds checks that turned out to be wrong. Sendmail’s
crackaddr could be overflowed by specially formatted address headers,
giving remote root code execution to anyone who could get a message processed
(CVE-2002-1337, fixed in 8.12.8) [cve-2002-1337]; weeks later a char/int
confusion in prescan() let a byte be read as the internal NOCHAR value,
which disabled the length check (CVE-2003-0161, fixed in 8.12.9)
[cve-2003-0161]. Procmail’s formail helper, run from recipes on every
incoming message, overflowed the heap on a header with unbalanced quotes
(CVE-2014-3618) [cve-2014-3618], and OpenSMTPD copied expanded .forward
format tokens into a fixed stack buffer without checking the space left, so a
local user could crash the server or run code as _smtpd where the stack
canary did not stop it [qualys2015].
All of these were fixed by vendor patches; the recurring cause is fixed-size buffers filled by parsers of attacker-supplied text.
Pepsi: Addressed. Impact: none.
Pepsi’s address handling is safe Rust over growable strings:
pepsi_common::domain (validate_email, addr_spec_of_header,
address_in_header), the MIME code in pepsi_crypto::mime and the
mail-parser/mail-auth crates. There is no fixed-size buffer to
overflow, and the accepted address syntax is deliberately narrower than
RFC 5321 (no quoted local parts, at most 64 octets of local part). Pepsi runs
no formail or other C header filter. ~/.forward is read by
pepsi-helper-dot-forward (Rust) only after it has dropped fully to the
owning user, with a size cap, O_NOFOLLOW and no format-token expansion, and
pepsi-stage-dot-forward re-validates every address the helper prints
(is_plausible_recipient) before it enters an envelope
(pepsi-stage-dot-forward). A |command line in a user’s
~/.forward may of course run procmail; such a program runs as that user,
which is the user’s own choice.
96.6.1.4. Integer overflows and buffer sizing errors in allocators and length arithmetic¶
When size computations are done in fixed-width integers, very large inputs make
them wrap, and the resulting too-small allocation is then overflowed. Qualys
showed in 2020 that qmail’s 32-bit string allocator gives a remote sender
command execution as the recipient on 64-bit Debian, because the delivery
program qmail-local had no memory limit. The overflow reports of 2005
(CVE-2005-1513 to -1515) had been dismissed as unexploitable. The proof of concept
needed about 4 GB of disk and 8 GB of memory, and the fix was a memory limit
plus capped allocations [qualys2020c]. Exim’s recipient list size overflowed
after about 50 million RCPT TO commands because recipients were unlimited by
default, and a header-size calculation overflowed on one very long header,
exploited for remote code execution before 4.92 (CVE-2020-28017, -28020)
[qualys2021]. Audits of Dovecot and of GNU Taler found the same class as
latent defects: callers multiplying size * count before a checked
allocator [cure532016], and a range check that overflowed on 32-bit
platforms and allowed an out-of-bounds read of attacker-supplied key data
[codeblau2020].
The fixes are checked arithmetic in allocation wrappers and, as defence in depth, hard limits on every input dimension (message size, header length, recipient count) and on process memory.
Pepsi: Addressed. Impact: none.
Pepsi’s allocations go through Rust’s standard collections, which check the
size computation and fail rather than allocate too little, and every slice
access is bounds-checked, so a wrapped length is a logic error or a panic, not
memory corruption. The release profile enables overflow-checks, so plain
arithmetic that overflows panics (ending one connection or message) instead of
wrapping silently. The places where an attacker supplies a length are also
handled explicitly: for example, Pepsi refuses a BDAT chunk size near
u64::MAX before it buffers anything. The DER/CMS parsing in
pepsi-crypto uses the RustCrypto der/cms crates and is fuzzed.
Input dimensions are bounded where the cited bugs were not: MAX_MESSAGE_SIZE
(default 25 MiB) applies to headers and body alike, RCPT is capped at 1000
per transaction, command and data lines have length limits, and queue admission
(MAX_QUEUE_ROWS, MAX_QUEUE_BYTES, MIN_FREE_SPACE) refuses new mail
before the database fills (Resource exhaustion of SMTP servers). The
local delivery helper streams the message into the Maildir rather than holding
it, so the qmail situation of an unlimited delivery process meeting a
multi-gigabyte message does not arise.
96.6.1.5. Local privilege escalation via memory bugs in setuid MTA binaries¶
Exim and Sendmail ship one large binary that is setuid root, so every memory
bug reachable from its command line, environment or standard input is a local
root exploit. The Stack Clash research used a heap leak driven by a repeatable
Exim option (CVE-2017-1000369) to grow the heap into the stack, then large stack
buffers to jump the kernel’s single guard page, and obtained root on i386
Debian; the recommended fixes were a larger guard gap and compiling with
-fstack-check [qualys2017]. The 21Nails audit found heap overflows and
out-of-bounds writes in Exim’s command-line and input handling (-F name
parsing, the current-directory copy, queue runs, get_stdinput;
CVE-2020-28009 to -28016) [qualys2021], and a use-after-free in debug output,
reachable from the command line, allowed escalation in Exim 4.96 to 4.98.1
(CVE-2025-30232, fixed in 4.98.2) [cve-2025-30232].
The precondition is a local shell account that may execute the setuid binary; the gain is root. The structural fix is to keep setuid code small, or to avoid a setuid MTA binary altogether.
Pepsi: Addressed. Impact: none.
Pepsi has no setuid-root MTA binary: submission goes through the unprivileged
pepsi-sendmail over a socket, and pepsi-ingress gets port 25 from
systemd socket activation. Eleven standalone programs do carry a set-id bit
(The privilege split), but only three are setuid root:
pepsi-helper-maildir-writer, -dot-forward and -auto-pay. These
helpers are mode 4750, so only members of their group can execute them, and
only a set-gid stage binary obtains that group; the stage binary is itself not
world-executable. Ordinary users can run only
pepsi-whitelist, which is setuid to an unprivileged account, and
pepsi-keys where a site chose to make it setuid pepsi-crypto (it is
0755 by default). All of them
are safe Rust with hand-written or clap argument parsing and no unsafe code
handling caller input, and Rust emits stack probes for large frames on the
supported Linux targets, so the stack-clash jump over the guard page is not
available to an attacker who can only influence the program’s inputs.
What this does not cover is a logic flaw in what a privileged program accepts from its caller, which is the subject of Privileged helpers trusting config, environment or fds of a lesser account.
96.6.1.6. Argument injection into the sendmail command line via addresses¶
Many applications send mail by executing /usr/sbin/sendmail and putting
addresses on its command line. An address is syntactically allowed to contain
spaces, quotes or a leading hyphen, so one that passes the application’s
validation can break out of the -f argument or be read as an option.
Golunski showed this for PHPMailer, whose RFC 3696 validation let a quoted local
part inject Sendmail’s queue-directory and log-file options and so write a PHP
file into the web root (CVE-2016-10033; the first fix was bypassed,
CVE-2016-10045) [golunski2016]. His white paper generalised it to PHP’s
mail() and to Zend, SwiftMailer and the applications on top of them: on
every MTA an attacker can add recipients, on Sendmail read and write files, on
Exim run commands through its expansion engine, on Postfix load another
configuration directory [golunski2017]. SquirrelMail let a TAB in a user’s own
address split off further options, including an alternate sendmail.cf
uploaded as an attachment (CVE-2017-7692) [golunski2017a]. The Rust library
lettre passed recipients without first ending option parsing, so a recipient
starting with - became an option (RUSTSEC-2020-0069) [rustsec-2020-0069],
and BSD mailx interpreted metacharacters in addresses as commands
(CVE-2014-7844) [cve-2014-7844].
The fixes are to end option parsing with -- before untrusted values, to
reject values starting with -, to avoid the shell, or to speak SMTP instead
of executing a program.
Pepsi: Addressed. Impact: low.
As the sendmail that such applications execute, pepsi-sendmail
(pepsi-sendmail) leaves injected options little to do. Its hand
parser in pepsi-sendmail/src/args.rs honours -- and refuses -C,
-bd and -q; -X and the other log or queue options are consumed and
ignored; every value that reaches the SMTP dialogue or a generated From: is
rejected if it contains a control character. The program holds no privilege, so
a Pepsi-specific -c can only change which socket it dials, and the server
derives the sender’s identity from SO_PEERCRED and USERNAME_MAP rather
than from -f. Adding recipients remains possible, as with every MTA,
because that is what the sendmail interface is for; that part is the calling
application’s bug.
Pepsi itself mostly passes addresses to programs safely: helpers receive uids,
not addresses, and nothing runs through a shell except a user’s own
~/.forward pipe. The one program that receives an address is the operator’s
PIN_COMMAND under PIN_DELIVERY = command of pepsi-stage-secure-link
(deliver_by_command). Pepsi accepts - at the start of a local part, as
RFC 5322 does, so a recipient such as -x@example.org could look like an
option; the address follows a -- separator, so a program that honours the
convention reads it as data (the script takes the address from $2).
96.6.1.7. Privileged helpers trusting config, environment or fds of a lesser account¶
A privileged program must not let a less privileged account decide what it
does, yet mail software has repeatedly let the caller supply the configuration,
environment or file descriptors. Exim’s setuid binary accepted an alternate
configuration file from the exim account, whose directives are executed with
root privilege; combined with a remote bug giving code execution as exim
this was a remote root exploit (CVE-2010-4345, fixed in 4.73 by restricting
alternate configurations) [cve-2010-4345]. Sympa’s setuid-root
sympa_newaliases-wrapper read sympa.conf, owned by the sympa account
(CVE-2020-26880) [cve-2020-26880], see also
Privilege escalation through a mailing-list manager setuid wrapper. Exim ran its embedded Perl with the
caller’s environment, so module-loading variables gave any local user root
(CVE-2016-1531, fixed by an environment allow-list) [cve-2016-1531], and the
writable end of a pipe to the root process was left open across exec into a
user’s .forward filter commands, which then talked to root directly
(CVE-2020-28012) [qualys2021].
The precondition is code execution as the lesser account, often a service account reached through another bug; the gain is the privileged account. The remedy in every case is that the privileged side takes its behaviour only from root-owned sources, rebuilds the environment from an allow-list, and closes every descriptor it does not mean to pass on.
Pepsi: Addressed. Impact: none.
Most of Pepsi’s set-id programs follow these rules. pepsi-whitelist and
pepsi-keys refuse -c from unprivileged callers; the stage binaries
with a bit (pepsi-stage-encrypt/-decrypt, -relay-to-maildir,
-dot-forward, -auto-pay) run privdrop::sanitize_environment
(removing PG*, TALER_*, PEPSI_*, HOME and XDG_CONFIG_HOME
and pinning PATH) and refuse any caller but the pepsi service account
and root; pepsi-stage-relay-to-smarthost relies on its 2550 file mode
for the latter. /etc/pepsi/pepsi.conf is root-owned.
The maildir and .forward helpers take only a uid and flags, refuse uids
below UID_MIN, and drop fully to that user before reading anything the user
owns; Rust’s standard library opens files close-on-exec, so the CVE-2020-28012
descriptor leak has no analogue.
The wallet helper needs the same care. Because the dispatcher spawns stages as
PROGRAM -c cfg worker, the stages accept -c from the pepsi account,
so that account chooses the options that pepsi-stage-auto-pay passes to the
setuid-root pepsi-helper-auto-pay; a helper that ran a wallet program or
account named there would let code running as pepsi run a program of its
choice as pepsi-crypto, postgres or any other account – the
CVE-2010-4345 pattern, contrary to A compromised component. The helper therefore
runs only the system-wide taler-wallet-cli whose path is compiled in
(make TALER_WALLET_CLI=..., default /usr/bin/taler-wallet-cli), refuses
--wallet-cli, and refuses to run it unless the file and every directory
above it are owned by root and writable by nobody else. In shared mode it drops
only to an account whose primary group is the helper’s own group
(pepsi-wallets, read from the helper’s executable), which no system account
has; local-user mode keeps its UID_MIN floor. There is no option naming the
wallet program, and pepsi-setup warns that a WALLET_CLI line in a
stage section is ignored (pepsi-stage-auto-pay).
pepsi-helper-dot-forward passes nothing of its caller’s environment to the
user’s |command, so pepsi cannot steer interpreter variables such as
PYTHONPATH for users whose ~/.forward pipes into a script: run_pipe
clears the environment and builds it from the user’s passwd entry (HOME, USER, LOGNAME,
SHELL) and a fixed PATH, as the wallet helper does.
96.6.1.8. Symlink and hardlink attacks on spool, queue, log and delivery files¶
A privileged process that opens files by name in a directory that a less
privileged account can write to is open to link attacks: the lesser account plants a symbolic
or hard link and the privileged process reads, writes, appends to or changes
the flags of the target. Postfix’s local delivery trusted root-owned symlinks
as mailbox targets, and on systems that allow hard links to symlinks a local
user could make Postfix append a message they controlled to an arbitrary file,
for example an init script (CVE-2008-2936, fixed in 2.3.15 to 2.6-20080814)
[cve-2008-2936]. OpenSMTPD’s world-writable offline queue was processed as root
at start-up, so hardlinks placed there let a local user clear protective file
flags and read the first line of arbitrary files such as root’s password hash
[qualys2015]. Exim’s setuid binary followed links in the exim-owned log
and spool directories, let that account name an arbitrary PID file, and let any
user delete files through a PID-file race (CVE-2020-28007, -28008, -28014,
CVE-2021-27216) [qualys2021].
The gain is file disclosure, corruption or root; the precondition is a local
account or the MTA’s own service account. The remedies are never to act as root
in a directory that a lesser account controls, to drop to the file owner before
opening, and to use O_NOFOLLOW/O_EXCL and descriptor-relative
operations.
Pepsi: Addressed. Impact: none.
Pepsi has no spool directory: the queue, including message bodies and state,
lives in PostgreSQL, and logs go to the journal, so there is no queue, log or
PID file for a lesser account to replace with a link. pepsi-sendmail has no
offline queue; when pepsi-ingress is unreachable it exits with
EX_TEMPFAIL and the caller retries. pepsi-helper-maildir-writer drops
fully to the recipient before it touches the Maildir: it calls setgroups,
setgid and setuid and then checks that root cannot be regained. It
creates files with create_new (O_EXCL) in tmp/ and renames them into
new/; any link that the user plants in their own Maildir is therefore
followed only with that user’s own rights, and there is no mbox delivery to an
existing file. pepsi-helper-dot-forward likewise reads ~/.forward and
appends to /file targets only as the user and with O_NOFOLLOW. The
directories that root writes to are root-owned: /etc/pepsi, secrets.d
and /var/lib/pepsi, where upgrade markers are written via a temporary file
and rename. /run/pepsi is root-owned with an ACL rather than owned by a
service (No unit may claim it as a RuntimeDirectory).
96.6.1.9. Newline injection and truncation in spool header files¶
Exim stores each message’s envelope and processing instructions in a
line-oriented spool header file without escaping line breaks. 21Nails showed
that any local user could submit to a recipient containing newlines, and any
authenticated SMTP client could produce a newline through the xtext-decoded
AUTH= parameter of MAIL FROM, adding lines that make Exim run commands as
root later (CVE-2020-28015, -28021, both exploited). Conversely, the reader used
a fixed buffer and silently split over-long recipient lines, which a remote
client could produce with a long DSN ORCPT= value (CVE-2020-28026)
[qualys2021]. The same mistake, remote text stored in a line-oriented
control file, underlies the OpenSMTPD envelope injection described in
Memory corruption in MTA SMTP command, reply, TLS and DKIM handling.
The fixes escape or reject line breaks on writing and refuse over-long lines on reading instead of truncating them.
Pepsi: Addressed. Impact: none.
Pepsi has no spool file. Envelope sender, recipients, headers and body are
separate columns of pepsi.workqueue and pepsi.workqueue_body, and all
per-message instructions live in the state JSON column, so no value can
spill into another field and nothing is truncated. The SMTP server reads
CRLF-terminated command lines, so no envelope value can contain a line break;
ENVID and ORCPT are validated as xtext and kept in encoded form
(pepsi_common::dsn::validate_xtext), and an AUTH= parameter is accepted
and ignored rather than decoded. pepsi-sendmail rejects control characters
in every value before it reaches the SMTP dialogue. Where line protocols cross a
privilege boundary, the receiving side re-validates: addresses printed by the
dot-forward helper must pass is_plausible_recipient, the whitelist importer
re-validates every address that the mailbox scanner reports, a malformed worker
status line is treated as fatal by the dispatcher, and remote reply text is
collapsed to one line before it is placed in a DSN
(SMTP or proxy input injected unneutralised into internal stores).
96.6.1.10. SMTP session and filter state-machine errors (BDAT, filter channel)¶
An SMTP server is a state machine driven by an untrusted client, and every error
path has to put it back into a consistent state. Two bugs show what happens when
one does not. In Exim, a BDAT (CHUNKING, RFC 3030) transfer that ended in
an error, such as exceeding the message size limit, did not restore the input
function, so later command reading re-entered the chunking code and a further
BDAT recursed until the stack was exhausted (CVE-2020-28019, one of Qualys’
“21Nails”, fixed in the Exim security release of 4 May 2021) [qualys2021]. The
same class had already produced CVE-2017-16944. In OpenSMTPD before 6.8.0p1, the
filter layer that relays session events between the SMTP engine and external
filter processes lost track of its I/O channel after a particular sequence of
client activity and later dereferenced a NULL pointer (CVE-2020-35680)
[cve-2020-35680].
Both are reachable by any unauthenticated client and give at least a remote crash of the receiving process, that is a denial of service for all mail; Qualys notes that re-entrant command parsing may have further consequences. The fixes are explicit state resets on every error and disconnect path, and keeping the MTA-to-filter protocol in step with the session it describes.
Pepsi: Addressed. Impact: none.
pepsi-ingress keeps a BDAT transfer as an explicit Option<Bdat>
field of the session (pepsi-ingress/src/smtp/session.rs, handle_bdat),
not as a swapped input function, and parsing is not re-entrant. Every chunk is
read by exact length, so the command stream stays framed even when the chunk is
refused for protocol state (no MAIL/RCPT) or a full queue; a chunk that
alone exceeds MAX_MESSAGE_SIZE closes the session instead of being drained,
and a cumulative overflow discards the buffer and keeps only an oversize
flag until LAST. RSET, a completed message and every refusal go through
reset_envelope, which clears the BDAT state together with the envelope;
mixing DATA into a BDAT transaction is refused with 503. The size
check uses a saturating addition, pinned by a unit test. Rust’s memory safety
also turns any remaining logic error here into a refused command or a closed
connection rather than memory corruption.
Pepsi’s filter channel is pepsi-stage-milter, and it is not driven by the
client: it runs only after the message is queued, opens a fresh milter
connection per message and replays a synthetic session from what ingress
recorded in state.origin (pepsi-stage-milter); there is no
pre-queue hook, so a REJECT verdict routes the row to REJECT_STAGE (the
discard-rejected sink the wizard writes) instead of answering 5xx in the
session. A remote client therefore cannot steer the order of milter events.
Under the default ON_FAILURE = tempfail, a filter that is down or answers
nonsense causes a temporary stage error that is retried, not a crash of the
receiving server. The other internal channel, the dispatcher’s line protocol to
its workers, treats an unparseable status as fatal for that worker only and
handles worker crashes by the strike rules of pepsi-dispatch.
96.6.1.11. SMTP or proxy input injected unneutralised into internal stores¶
MTAs pass client-supplied strings into internal stores and protocols that have
their own syntax, and forget to neutralise them there. In Exim 4.98 built with
the SQLite hints database, the key for ETRN serialisation, derived from the
ETRN argument, reached an SQL statement unescaped, so a client allowed to
issue ETRN could inject SQL (CVE-2025-26794, reported by Oscar Bataille in
February 2025 and fixed on 21 February 2025) [exim2025]. The vulnerable setup
needs USE_SQLITE, an acl_smtp_etrn that accepts ETRN (default deny)
and smtp_etrn_serialize (default true). Two years earlier, Exim did not
neutralise data received from a PROXY-protocol front end (CVE-2023-42117, CVSS
8.1, fixed in 4.96.2 and 4.97), exploitable by whoever controls what the proxy
sends [exim2023]. The older spool-header new-line injection of the same advisory
series is a sibling of these.
The attacker gains write access to an internal store that the server trusts,
with consequences ranging from corrupted hints to whatever the store controls;
neither notice describes the consequences in detail. The fixes are escaping or
parameter binding, and not accepting the protocol (ETRN, PROXY) from
untrusted peers.
Pepsi: Addressed. Impact: none.
pepsi-ingress implements neither ETRN nor the PROXY protocol, and stores
what a client sends in typed PostgreSQL columns through sqlx with bound
parameters; the dynamic SQL in the tree (commit_row, the key-store listings,
pepsi-common/src/quota/db.rs) splices only compile-time column lists and
placeholders, never a value. Envelope and authentication results go into the
state column as JSON built with serde_json, so they cannot break out of
their field. There is no line-based spool file. The one place where client text
reaches a stored text format is the Received: trace header: the EHLO
argument and envelope addresses are refused if they contain any control
character, and the EHLO argument additionally must be at most 255 octets and free
of parentheses and backslashes (has_control, plausible_ehlo_domain in
pepsi-ingress/src/smtp/command.rs), so neither a header nor a comment can be
injected. Message headers and bodies are data that every stage parses afresh,
not a control channel.
96.6.1.12. Legacy routing syntax (source routes, percent hack, UUCP) redirects mail¶
MTAs still honour address forms from before the DNS: source routes
(@relay:user@domain), the “percent hack” (user%host@relay) and UUCP bang
paths (host!user). Heyes showed in 2024 that this lets an address that an
application’s validator assigns to one domain be delivered to another. In
Sendmail 8.15.2, an escaped @ combined with a UUCP-style local part sent the
message to the host before the ! rather than to the domain after the @;
Postfix 3.6.4 treated an address whose domain was commented out by an unbalanced
parenthesis as a percent-hack address and delivered to the domain encoded in the
local part, and also accepted the UUCP variant [heyes2024].
The attacker only has to supply such an address to a web application that grants access, organisation membership or single sign-on trust on the strength of a “verified” address at the victim’s domain; the verification mail then reaches the attacker. No MTA fix is reported; the author’s advice is never to use the e-mail domain as the sole authorisation criterion [heyes2024].
Pepsi: Addressed. Impact: low.
Pepsi itself never interprets these forms. pepsi-ingress strips an
RFC 5321 source route from a path as section 4.1.1.3 requires
(strip_source_route), and the domain of an address is always the part after
its last @ (domain_of), which is the same domain that every relay stage
delivers to, so there is no gap between the domain Pepsi checks and the one it
routes to. % and ! in a local part are ordinary characters: the local
delivery stages look the whole local part up in passwd, and aliases match it
literally. Envelope paths carry no comments, so the unbalanced-parenthesis trick
has nothing to act on. Addresses entered through the web forms
(pepsi_common::domain::validate_email) are restricted to unquoted atext
local parts, and Pepsi grants nothing on the strength of an address’s domain.
The next hop is protected at RCPT. An MTA behind Pepsi that still applies
the percent hack or bang-path rewriting could route user%other.example
elsewhere: Postfix’s allow_percent_hack and swap_bangpath default to on,
and Pepsi is a trusted client of a back end that it relays to. Ingress therefore
refuses a local part containing % or ! at a served domain with 550 5.1.3
unless a mailbox authority vouches for the address: a domain left unverified
(for example a pepsi-stage-route back end with RECIPIENT_CHECK = none),
or one whose sources could not answer, never passes it on. At a verified domain
such an address is refused as unknown (550 5.1.1) unless an account or
alias names it literally. There is no option; the near-zero cost is a
legitimate % or ! local part at an unverified domain, which verifying
the domain’s recipients avoids. What is left is an address that a mailbox
authority names with such a character, which reaches the back end as named; the route
stage’s manual tells operators to switch the legacy rewriting off in the back
end anyway.
96.6.1.14. CMS eContent confusion and multi-signer mishandling in S/MIME clients¶
S/MIME clients mishandle unusual or contradictory CMS SignedData
structures. Müller et al. tested 22 S/MIME clients in 2019 and found eContent
confusion: a multipart/signed message whose CMS signature also embeds content,
so that the client verifies the embedded content while displaying the other MIME
part. Any previously obtained signed message of the victim suffices for a perfect
forgery (Thunderbird, Postbox, MailMate, iOS Mail; CVE-2018-18509). Clients also
merged several signers into one “valid” indicator (Evolution), showed
signed-looking mail with zero signers (Outlook, Mutt, MailDroid), or presented
untrusted certificates without a clear warning (Trojita, Claws, Nine, MailDroid)
[muller2019].
The attacker forges an S/MIME-signed message in a person’s name, needing either one signed message from them or only the ability to send mail. The authors recommend an error when both opaque and detached content are present, no support for multiple signers, treating a message without a signer as unsigned, and full automatic path validation that fails on trust problems [muller2019].
Pepsi: Addressed. Impact: none.
pepsi_crypto::smime::verify_signed_data_as refuses a SignedData that
carries embedded content and is also given detached content (Malformed), the
multipart/signed path additionally refuses a SignedData that is not
detached, an eContentType other than id-data is Unsupported, and a
SignedData without a SignerInfo is NoSignature. The verdict and the
signer identity come from the first SignerInfo only; further signers are
listed in the report but cannot lend their verdict to it, and the signer must
name the From: address in an rfc822Name (or an RFC 9598
SmtpUTF8Mailbox) to be bound to it; an anchored certificate that names no
mailbox at all is reported valid-untrusted (withheld=no-identity)
unless the operator marked that anchor with pepsi-keys ca accept-nameless. A
certificate that does not chain to a configured anchor verifies at most to
valid-untrusted, which earns neither the [verified] tag nor
state.signature_verified; identity, key usage, extended key usage, path and
name constraints are checked in pepsi-crypto/src/trust. An opaque
SignedData whose smime-type is missing or unknown is classified from its
DER, so a signature wrapped around a stranger’s ciphertext is recognised as
such (pepsi-stage-decrypt). Structural forgeries, where the
signed part is not the whole message, are handled by content isolation and are
assessed under Signature spoofing via partial signing and MIME/CMS wrapping.
A recipient whose own client still has the 2018 eContent bug would see the forged
message as signed whatever Pepsi concludes. Pepsi records the bad verdict in
X-Pepsi-Crypto in every configuration; the subject is marked only if the
operator sets [stage-decrypt] TAG_BAD_SIGNATURE, which is empty by default
for a cleartext signature such as this one (TAG_BAD_SIGNATURE_ENCRYPTED,
[bad signature] by default, applies only to a signature inside a
ciphertext). Either marking contradicts the client’s own indicator but cannot
remove it.
96.6.1.15. Weak exploit mitigations and format-string guards in mail daemons¶
Defence in depth in C mail daemons is often weaker than it looks. Cure53’s 2016
audit of Dovecot 2.2.26.0 for the Mozilla Secure Open Source programme found no
exploitable vulnerability but three hardening gaps [cure532016]: the
format-string guard printf_format_fix_noalloc rejected %n only when the
n directly followed the %, so %1$n or %hn passed; the default
build produced binaries without PIE, full RELRO, stack canaries or
FORTIFY_SOURCE, leaving hardening to distributions; and the memory-pool
allocator did not check the size * count multiplications that its callers
performed, so an overflow could yield a too-small allocation.
None of these is a vulnerability on its own; each makes a memory-corruption bug
elsewhere easier to exploit or more likely to exist. The recommended fixes are a
guard that rejects every %...n conversion, hardening flags in the default
build (at negligible measured cost) and an array-allocation wrapper that checks
the multiplication [cure532016].
Pepsi: Addressed. Impact: low.
The three findings matter little for Rust code. Format strings are checked at
compile time and never come from data (templates are Mustache, which renders
values as text); Vec and friends check capacity arithmetic and every slice
access is bounds-checked, so a wrapped size causes a panic rather than an
overflow. rustc produces position-independent executables with full RELRO and
a non-executable stack by default, the release profile unwinds so a panic ends
one connection (Security model), the Debian build sets
DEB_BUILD_MAINT_OPTIONS = hardening=+all, and the long-lived services run
under systemd sandboxing (NoNewPrivileges, ProtectSystem=strict,
ProtectHome, PrivateTmp for pepsi-ingress and pepsi-httpd) on top
of the per-account privilege split (The privilege split).
The release profile in Cargo.toml sets
overflow-checks = true, so an integer overflow on a length or count computed
from untrusted input panics (ending that one connection or message) instead of
wrapping into a small value that a later check or allocation trusts;
tests/build_hardening.rs keeps it set. What remains is not Pepsi’s code: Pepsi
links C code (aws-lc under rustls, Nettle under sequoia, the Kerberos
GSSAPI library), and that code is compiled with whatever flags its own build or
the distribution uses. For the vendored aws-lc-sys build, this could not be
verified from the tree. pepsi-dispatch deliberately runs without
NoNewPrivileges because its workers must execute the setuid/setgid helpers.
96.6.1.17. Message content reaching shells or interpreters in gateway scanning¶
Mail gateways process content that anyone can send: attachment names, archive
members, spreadsheet cells, subject tags and certificate names. Several have
passed such content to a shell or an interpreter. The worst case is the Barracuda Email
Security Gateway (CVE-2023-2868): the attachment-screening module unpacked
.tar attachments with a Perl routine that put the member names, unquoted,
into a shell command run with qx, so a crafted archive mailed to any
protected address ran commands on the appliance [barracuda2023]. The actor
UNC4841 exploited it from October 2022 until its discovery in May 2023 on
versions 5.1.3.001 to 9.2.0.006, implanted backdoors in the SMTP daemon that
survived patching, exfiltrated mail and TLS certificates, and Barracuda ended up
advising replacement of compromised appliances. In December 2023 the same actor
used CVE-2023-7102/7101, a string eval of number formats in the Perl library
Spreadsheet::ParseExcel used by the Amavis scanner, through crafted .xls
attachments [barracuda2023].
The same pattern appears in encryption gateways. SEPPmail interpolated the
password from a sender’s [password: ...] subject tag unescaped into a
qpdf shell command, giving root command execution; Suter-Dörig shows that
external attackers can reach it through subject-tag sanitisation bypasses, even
via an internal user’s automatic out-of-office reply (fixed in 15.0.1,
6 January 2026) [doerig2026]. Its GINA portal’s “Download as PDF” processed
attachment names unsafely, giving code execution as nobody, which on that
appliance led on to all key material and root (fixed in 14.0.6)
[grossmann2025b] [doerig2026]. In the German health-care KIM service, the
T-Systems client module logged the Common Name of the sender certificate after
decryption and before signature verification with a Log4j vulnerable to
Log4Shell (CVE-2021-44228), so any KIM participant could achieve zero-click code
execution on the practice server; months after patches, only about 40% of
installations had updated [saatjohann2024].
In every case the precondition is merely sending mail, no recipient interaction is needed, and the gain is the gateway, with all mail and keys passing through it. The fixes are never building shell commands from message data (argument vectors instead), not evaluating data, maintained parsing libraries, and reliable update delivery.
Pepsi: Addressed. Impact: none.
No Pepsi component passes message content to a shell or an interpreter. Every
child process started from mail-derived data is spawned with an argument vector,
one arg() at a time: the setuid wallet helper builds taler-wallet-cli
arguments from a taler:// URI that is checked against a character repertoire
and scheme prefix, amounts are parsed as Taler amounts and exchanges must be
http(s):// URLs; [pepsi-secure-link] PIN_COMMAND receives the recipient
as one argument after -- and the PIN on stdin; pepsi-setup runs certbot, nginx and
systemctl with fixed argument vectors and validated host names. Pepsi unpacks no
archives, converts no documents and has no PDF or password feature, and none of
its subject keywords carries a value. Logging goes through tracing, which
formats values literally; there is no lookup syntax and no JVM. Attacker-chosen
certificate fields are parsed by Pepsi’s own fuzzed CMS/X.509 code and sequoia
and only ever rendered as quoted values in X-Pepsi-Crypto or JSON state, and
Mustache templates render state as data. The secure-link portal offers the raw
message and attachments as downloads only, and pepsi-httpd starts no
subprocess at all.
The only /bin/sh -c on a mail path is pepsi-helper-dot-forward running a
|command from the recipient’s own ~/.forward after fully dropping to that
user, and only with ALLOW_PIPE; the command text is the user’s, as in
sendmail. Two things are outside Pepsi’s code: a site-supplied PIN_COMMAND
script must quote its argument, and content scanners that an operator attaches through
pepsi-stage-milter (antivirus, archive unpacking) bring their own attack
surface, which Memory corruption in antivirus file parsers reached via mail covers. Updates
arrive as ordinary Debian packages, not through a vendor channel of their own.
96.6.1.18. Command injection and XXE in mail gateway management interfaces¶
The management web interfaces of mail gateways are a recurring route to root.
Cisco’s AsyncOS Spam Quarantine interface validated HTTP requests so poorly that
an unauthenticated request ran commands as root (CVE-2025-20393, CVSS 10.0); a
China-nexus actor exploited it from late November 2025 on appliances that had
the non-default quarantine enabled and exposed to the Internet, installing
tunnels, a log cleaner and a Python backdoor; Censys counted about 220 exposed
instances, and fixes came only in January 2026 [thehackernews2025]
[cisco2026]. The SEPPmail Admin Portal passed input to an operating-system
command (CVE-2022-41871, up to 12.1.17), giving an authenticated administrator
root on the appliance holding the organisation’s S/MIME and OpenPGP keys
[cvedetails2026]; SEPPmail’s firmware upload interpolated a member name from the
uploaded archive into a shell command before checking the signature, so a crafted
update file ran commands as nobody [doerig2026]. Trend Micro’s InterScan
Messaging Security Virtual Appliance built an openssl req command line from
certificate-form fields filtered only by a blacklist (CVE-2017-6398, up to 9.1
build 1631), and parsed XML requests to its LDAP user search with external
entities enabled, a server-side request forgery [pentestblog2017]. The pattern
is not specific to mail: Cisco IOS XE’s web UI combined an unauthenticated
account-creation flaw with OS command injection (CVE-2023-20198/20273) for full,
persistent device takeover [cisco2023].
The attacker is either an administrator whose account is a step short of root or whoever can reach the interface, which is often anyone because the interface was exposed to the Internet. The gain is the gateway and everything that passes through it. The fixes are argument vectors and safe parsers, disabling DTD processing, and keeping management interfaces off untrusted networks.
Pepsi: Addressed. Impact: low.
pepsi-httpd serves the administrative API and console only on listeners
flagged ADMIN = yes (the wizard puts it on a UNIX socket), starts no
subprocess, parses no XML, drops privileges before accepting a connection and
holds a narrowed database role (A delegated administrator, The administrative API). It
cannot act itself: privileged changes are rows in pepsi.setup_task that the
root-run pepsi-setup apply performs only for a closed set of typed intents,
none of which carries a command line, a path to execute or a verbatim file, and
removing the pepsi-httpd-admin package removes that path entirely. There is no
web quarantine and no firmware or update upload: Pepsi is installed and upgraded
as signed Debian packages or with make install, and the encrypted
configuration archive of pepsi-config import is authenticated and rejects
absolute and .. paths.
The database configuration overlay must not be a way around this.
pepsi.config_override is writable through PUT /api/v1/config by a
principal holding config:write (when [pepsi-admin] CONFIG_DB is
configured) or with pepsi-config set. The dispatcher and the stages run a
stage’s PROGRAM and the HELPER of the setgid stages as the pepsi
account. If the overlay accepted these options, an administrator account could
therefore execute code as pepsi: the class of CVE-2022-41871, though not
leading to root.
check_overridable in pepsi_common::config_db therefore refuses, at write time and
again when the overlay is read, every option that names an executable
(EXECUTABLE_OPTIONS: HELPER, SCAN_HELPER, MAILBOX_HELPER,
PIN_COMMAND) and a PROGRAM other than a bare pepsi-stage-* name with no
path component; pepsi-stage-edit-settings likewise refuses HELPER and an
unsafe PROGRAM in user overrides. Which programs Pepsi runs is
therefore only ever taken from the configuration file. What remains is by
design: an administrator with config:write can still rewire the pipeline among
Pepsi’s own stages (an overlay-only stage section is supported), which changes
what happens to mail but runs nothing foreign; An attacker who has the configuration file documents the
role’s reach.
96.6.1.19. Path traversal when extracting or serving archive members¶
Mail servers unpack and pack archives in which an attacker chooses the member
names, and repeatedly forget that a name can leave the target directory. In Zimbra
Collaboration Suite, the mboximport servlet extracted uploaded ZIP archives
without rejecting relative paths (CVE-2022-27925), so an entry could be written
as a JSP web shell into the web root; it was published as administrator-only,
but a missing return after the authentication check (CVE-2022-37042) made it
reachable without credentials, and Volexity found over 1,000 backdoored
instances in mid-2022 [volexity2022]. Shortly after, Zimbra 8.8.15 and 9.0 were
exploited through Amavis, which unpacked .cpio, .tar and .rpm
attachments with cpio when pax was absent, as it is by default on Red
Hat-based systems. cpio follows paths and symbolic links out of the
extraction directory, so any sender could plant a web shell by mail
(CVE-2022-41352, on the CISA Known Exploited Vulnerabilities list)
[cve-2022-41352]. In the other direction, SEPPmail’s GINA portal built a file
path from an attachment’s name when packing attachments into a ZIP download, so a
mail author could read, write or delete files on the gateway, notably the LDAP
backup holding all key material (rated critical, fixed in 15.0.1 in January 2026)
[doerig2026].
The gain is arbitrary file write or read with the server’s privileges, which in
all three cases reached code execution or all keys; the CPIO variant needs
nothing but sending mail. The fixes are rejecting absolute and .. member
names and links, extracting with tools that confine paths, and never deriving a
file system path from a name in a message.
Pepsi: Addressed. Impact: none.
No Pepsi component extracts attachments or builds a file system path from an
attachment or archive member name, and none packs downloads into archives. The
secure-link portal handles attachments and reply uploads in memory and in the
database; the list archive serves attachments from the database and sanitises
the Content-Disposition file name against quotes, control characters and path
separators; local delivery writes unique, generated Maildir names as the
recipient (pepsi-helper-maildir-writer). The only archive Pepsi unpacks is
its own encrypted configuration archive, restored by root with
pepsi-config import: it uses its own manifest format rather than tar, is
authenticated as a whole with AES-256-GCM under an Argon2id key before anything
is written, and safe_relative in pepsi-config/src/archive.rs refuses any
entry that is absolute or contains a component other than a normal name. Mailbox
import of the kind Zimbra offered does not exist; pepsi-whitelist import
reads mailboxes only to collect addresses, in an unprivileged helper.
96.6.1.20. SSRF and path confusion in groupware front ends leading to RCE¶
Groupware servers split into a front end that authenticates requests and back
ends that trust it, and the trust has been abused repeatedly. In Microsoft
Exchange’s Client Access Service, Orange Tsai found that a compatibility cookie
let an unauthenticated client choose the back-end URL, a “super SSRF” to which the
front end attached a Kerberos ticket of the machine account (CVE-2021-26855); with
a post-authentication file write (CVE-2021-27065) this became ProxyLogon,
pre-authentication remote code execution [tsai2021]. Microsoft reported it
exploited by HAFNIUM before the patches of 2 March 2021, followed by mass
exploitation, web shells, credential dumps and mailbox export [microsoft2021].
ProxyShell chained a path confusion in the “explicit logon” feature, which
deleted part of the path before proxying (CVE-2021-34473), an access token
accepted from a URL parameter (CVE-2021-34523) and a mailbox export to a web-root
path (CVE-2021-31207) [tsai2021]. ProxyNotShell (CVE-2022-41040/41082), found
in the wild by GTSC in August 2022 on fully patched servers, used the same
Autodiscover path shape with any mailbox user’s credentials to reach Exchange
PowerShell; it was fixed only in November 2022 [gtsc2022]. In Zimbra, a Webex
proxy servlet forwarded requests with client headers, took Host from
X-Host and followed redirects, a full-read SSRF reachable by any
authenticated user and, through a stored XSS, by an outside attacker
(CVE-2021-35209) [sonar2021].
The gain is code execution on the mail server or, for SSRF, requests from inside its network, such as to a cloud metadata service. The fixes are not letting clients choose back ends or strip path segments, not trusting identity headers from anything but the front end, validating redirect targets, and keeping these services off the Internet [tsai2021] [sonar2021].
Pepsi: Addressed. Impact: none.
pepsi-httpd is not a proxy and has no front-end/back-end split of its own: it
routes requests by path to handlers in the same process, and no request can name
a server it is forwarded to. When pepsi-setup puts nginx or Apache in front,
the front server proxies to one fixed UNIX socket, and pepsi-httpd trusts
only two headers, and only when the connection can have come from a front server
on the same host (a UNIX socket or a loopback peer): X-Forwarded-Proto for the
cookies’ Secure attribute and the rightmost X-Forwarded-For for rate
limiting (ConnInfo::client_ip in pepsi-httpd/src/conn.rs). Neither
carries identity. Administrative identity comes from a bearer token, a session
cookie or SO_PEERCRED, and a proxied request carries the front server’s own
uid, which is not in the administrator group, so it must present a token or a
password (The administrative API). Privileged actions are typed tasks for
pepsi-setup apply, not file writes by the web tier, so there is no export to a
web-root path to chain into.
Where Pepsi itself fetches URLs derived from mail, the targets are guarded:
pepsi-keydisc refuses loopback, private, CGNAT, link-local and unique-local
addresses and re-checks every redirect (Security model, “Key-discovery SSRF”);
pepsi-tlsrpt posts reports over verified HTTPS with no redirects and the same
address filter; the MTA-STS fetch in pepsi-stage-relay-to-internet uses a
fixed path, verified TLS and no redirects, and its response is parsed as a
policy, never returned. Residual issues of those fetchers are assessed under
WKD lookups follow redirects and accept oversized or polluting keys.
96.6.1.21. Mutation and desanitisation XSS bypassing webmail HTML sanitisers¶
Webmail must display HTML that strangers write, and a correct sanitiser is not
enough when the output is changed or re-parsed afterwards. Heiderich et al.
introduced mutation XSS in 2013: browsers re-serialise the DOM through
innerHTML with their own quoting and escaping, so markup that leaves a
sanitiser harmless becomes script after a round trip. They described seven
subclasses and placed stored vectors in Yahoo! Mail, Hotmail, Rediff, Open-Xchange,
Zimbra, Roundcube and others, bypassing HTML Purifier, AntiSamy, jSoup, Google Caja
and more [heiderich2013]. Later bugs moved the mutation into the application
itself, after a working sanitiser. Zimbra’s Ajax client inserted an action
attribute into form tags with a regular expression that ignored attribute
boundaries (CVE-2021-35208) [sonar2021]; RainLoop replaced a placeholder with
sanitised markup by global string replacement, also inside attacker-controlled
attribute values (CVE-2022-29360, unpatched at publication) [sonar2022b]; Proton
Mail renamed svg to proton-svg after DOMPurify, so style content
was re-parsed under HTML rules, and combined this with a sandbox escape and
blob: script URLs [sonarsource2022b]; Roundcube’s html4inline() replaced
legacy body attributes by regular expression and could delete an odd number
of quotes (CVE-2024-42009, fixed in 1.6.8/1.5.8) [sonar2024]. Roundcube’s
server-side sanitiser also let an SVG with a base64-encoded inner document carry
an event handler (CVE-2023-5631), which Winter Vivern used against European
government webmail [eset2023].
Usually viewing the message is enough. The attacker gets script in the victim’s webmail session: reading all mail (decrypted, for Proton Mail), sending as the victim, stealing the password. The fixes are never modifying sanitised HTML, using the sanitised DOM directly instead of re-parsing, sandboxed iframes and a strict Content Security Policy [sonar2024] [sonarsource2022b].
Pepsi: Addressed. Impact: none.
Pepsi has no webmail. Two web pages show message content, the secure-link
portal and the mailing-list archive, and neither renders HTML from a message, so
there is no sanitiser whose output could mutate. pepsi-secure-link/src/view.rs
folds every body, text/html included, to plain text with
pepsi_common::mime_text::extract_text and the result is escaped once at render
time; the archive pages state the same rule (“escaped text, never markup”).
Templates are askama with default escaping, and the only |safe output on the
administrative console is the numeric SVG chart; a test fails if a public
template gains one. The portal is served with default-src 'none', a nonce for
its own style and form-action 'self', and attachments and the raw message are
served as application/octet-stream downloads with a sandbox policy, so
neither an inline script nor an attachment can run in the portal’s origin
(The secure-link fallback portal). Mail that Pepsi delivers to a mailbox is rendered by the
user’s own client or webmail, whose sanitiser is outside Pepsi; Pepsi does not
rewrite HTML parts in ways that would re-open what that sanitiser closes.
96.6.1.22. Hand-written or single-pass HTML sanitisers let active content survive¶
Sanitising HTML with regular expressions and string replacement fails in
predictable ways. Klein et al. measured hand-written JavaScript sanitisers on the
Tranco top 20,000 sites in 2022: of 705 unique sanitisers on 1,415 domains, 12.5%
were insecure, and for 51.3% of the validated insecure ones they generated working
bypasses [klein2022]. Recurring flaws were non-recursive removal of nested or
overlapping tags (removing an inner tag recreates <script>), replace
acting only on the first match, escaping for the wrong context, short
blocklists and replacement steps in an order that lets a later one recreate what
an earlier one removed. The mail world has the same failures. The Perl library
HTML::Defang, used by SEPPmail’s GINA portal, removed comment delimiters from
<script> content in a single pass, so overlapping fragments reassembled into
-->, ended the comment in which it wraps scripts and left a live script element
(rated high, fixed in HTML::Defang 1.08 on 6 November 2025) [doerig2026]; GINA’s
display sanitiser also kept form elements, so a message could carry a form
inside the trusted portal (fixed in SEPPmail 15.0.2, January 2026)
[grossmann2026b].
The attacker needs only to get a message or a link to the victim. The gain is script or a phishing form in the victim’s authenticated session – in GINA, uploading the attacker’s own PGP key to read future mail, or capturing the password. The fixes are maintained parser-based sanitisers, repeated removal until a fixed point, and ideally not rendering foreign HTML at all [klein2022] [doerig2026].
Pepsi: Addressed. Impact: none.
Pepsi contains no HTML sanitiser to get wrong. The secure-link portal and the
list archive fold message bodies to text and escape them with askama’s or the
portal’s own context-aware escaping of &, <, > and quotes
(pepsi-secure-link/src/html.rs), so a script or form element in a
message is displayed as text. Each portal page carries default-src 'none'
with no script source and form-action 'self', so even injected markup could
neither run script nor submit a form elsewhere; attachments and the raw message
are served as application/octet-stream attachments with a sandbox policy,
which defeats the same-origin attachment trick that the GINA exploit relied on. The
only filter Pepsi writes by hand is for a download’s Content-Disposition file
name, which removes quotes, control characters and path separators rather than
trying to neutralise markup. Reflected and stored injection into Pepsi’s own pages
and notices more generally is assessed under Reflected and stored XSS or HTML injection in portals and admin mails.
96.6.1.23. CSS escaping webmail message isolation and leaking mailbox data¶
Webmail renders an attacker’s HTML message inside its own trusted page, and the
boundary between the two is usually kept by a server-side sanitiser plus some form
of style confinement rather than by the browser’s origin isolation. CSS is enough
to break that boundary without any script: a style that escapes the message can
match attributes of the surrounding interface and leak them through conditional
resource loads, restyle the interface (page-filling link overlays, controls
disguised as password fields, label elements that trigger buttons outside the
message), and fingerprint the reader. Roundcube’s CSS blocklist was checked on a
copy of the style sheet with most characters stripped while the original was
rendered, so an @import of a host starting with a passed (CVE-2024-42010,
fixed in 1.6.8/1.5.8); the leaked IMAP UID then completed an attachment-based XSS
[sonar2024]. SOGo namespaced inline styles but not style sheets pulled in with
@import, so a received message could read the subjects of the other mails in
the inbox (CVE-2024-24510, fixed in 5.9.1.20240124-1) [trampert2025b].
Heyes extended the attack to Outlook, Gmail, Fastmail, Proton Mail, Yahoo and AOL
in 2026 [heyes2026]: sanitiser/browser differentials turn approved markup into
arbitrary CSS, Gmail’s image-set() fallback makes an external request despite
sanitisation, and a click-driven technique exfiltrates tokens even under a
Content Security Policy that blocks remote loads. The gains are typed passwords,
login tokens (with third-party account takeover), hijacked UI actions, IP
disclosure and instructions hidden from the human but read by AI assistants. Some
chains were fixed (Fastmail, Proton), others still worked at publication. The
recommended defences are sandboxed iframes for message content, CSS character
allow lists, never post-processing sanitised markup, and proxying or inlining all
remote resources [heyes2026] [trampert2025b].
Pepsi: Addressed. Impact: none.
Pepsi has no webmail, but it does show received mail in two web surfaces of
pepsi-httpd: the secure-link portal and the mailing-list archive. Both render
message bodies as escaped text and never as markup. pepsi-secure-link/src/view.rs
folds HTML parts to text with mail_parser (formatting and inline images are
deliberately lost; the original is offered as a download), and
pepsi-httpd/src/web/archive.rs renders list archives as escaped text even when
a list asks for markdown. No message-supplied CSS ever reaches a page, so there
is no style to confine and no sanitiser to bypass. The pages’ own
Content-Security-Policy is default-src 'none' with only a nonce’d or
same-origin style sheet and img-src closed to remote hosts, so even an
escaping error could not load remote CSS (The secure-link fallback portal, Archives,
The administration console).
Pepsi relays HTML mail unchanged to the recipient’s own client or webmail, whose CSS isolation is outside its control; the remote-content side of that is covered under Backchannels and CSS bypass remote-content blocking and fingerprint.
96.6.1.24. Reflected and stored XSS or HTML injection in portals and admin mails¶
The secure-mail portals of encryption gateways, list managers and other mail-side
web tools repeatedly insert request parameters, message fields or DNS data into
HTML without encoding for the context. In the SEPPmail 11.1.10 portal, Pentagrid
found in 2020 a reflected XSS through the subject URL parameter
(CVE-2021-31739) and a self-XSS through a compose recipient field
(CVE-2021-31740) that became exploitable because session tokens were accepted in
URLs; a CSP with unsafe-inline and CSP-less same-origin error pages let
injected script load more, and jQuery 3.4.1 was a further known-vulnerable
component (fixed in 12.0.6) [pentagrid2022]. A 2024 CTF challenge showed the
same pattern with an attachment file name placed in an unquoted action
attribute of an encrypted-webmail page [betrisey2024]. GNU Mailman before 2.1.31
reflected attacker-chosen content into its user options page, usable for phishing
under the list’s trusted domain (CVE-2020-12108) [cve-2020-12108], and four of 16
online DMARC checkers displayed a queried domain’s TXT record unescaped, so a
domain owner could run script in the browser of anyone checking the domain
[hureau2024].
Mail generated for administrators is affected in the same way: SEPPmail inserted the subject of every newly imported CA certificate unescaped into an HTML notification, so an external sender using a crafted CA controlled the whole body of the mail that was supposed to alert the administrator, and could make it look harmless or trip a spam filter (unfixed at the end of the 2026 embargo) [doerig2026]. The impact ranges from phishing and credential theft in the portal’s origin to defeating monitoring; the fixes are contextual output encoding, a strict CSP without gaps, and keeping session secrets out of URLs.
Pepsi: Addressed. Impact: none.
All HTML that pepsi-httpd serves (console, list pages, archive) is produced by
askama templates with automatic escaping; the only |safe values are
server-generated SVG charts in the authenticated console (ui/chart.rs), and no
public template under web_*.html uses it. The secure-link portal is rendered by
pepsi-secure-link/src/html.rs, whose single escaper covers text and quoted
attributes, and which never interpolates into an unquoted attribute, a script, a
style or a URL; attachment names are further stripped of path syntax, controls and
quotes in view.rs. Status pages of the list web tier take their text from the
Strings catalogue, not from the request, so the Mailman-style content
injection has nothing to reflect. Values from DNS (the console’s DNS checks and
cache view) go through the same escaping. No Pepsi page carries a script-src:
the console and list pages use default-src 'none'; style-src 'self'; img-src
'self' data:, the portal default-src 'none' with a nonce for its style sheet,
so even a missed escape could not execute script. Sessions are HttpOnly,
SameSite=Strict cookies with a CSRF token, and the API accepts bearer tokens
only in the Authorization header, so the session-token-in-URL trick of
CVE-2021-31740 has no counterpart (The administration console, The secure-link fallback portal,
A remote sender).
Pepsi never imports a CA from mail, so there is no CA notification to subvert.
Only the operator adds ca_trust rows, through pepsi-keys ca add,
POST /api/v1/ca-trust or the console’s trust-anchor form; each of them takes a CA
certificate that the operator supplies and audits the addition.
Of the notices Pepsi does generate from attacker-influenced data, the HTML ones
(payment-request, secure-link, secure-pin, secure-receipt under
templates/) use only escaping {{...}} substitutions; the plain-text ones
(key rotation, the S/MIME container notice, list and bounce notices) cannot
carry markup. Pepsi ships no
JavaScript library for its own pages. The only third-party script is Microsoft’s
office.js in the optional Outlook add-in task pane (contrib/addin, off
unless [pepsi-httpd] ADDIN = yes), loaded without SRI; that is a supply-chain
dependency on Microsoft’s CDN rather than an injection flaw. The plain-text
bodies from router::text, some of which echo request-derived
text, also carry X-Content-Type-Options: nosniff and default-src 'none';
frame-ancestors 'none', so they can be neither sniffed as HTML nor framed.
96.6.1.25. Attachments served same-origin with an active content type¶
A web front end that serves a message’s attachments from its own origin with the
media type that the sender declared lets a mail-borne file run as active content in
that origin. Roundcube sanitised only text/html and image/svg+xml, so an
XML attachment opened through its predictable URL executed script after one click;
an earlier fix (CVE-2020-13965) had only hidden the “open” button, and the full fix
in 1.6.8/1.5.8 (CVE-2024-42008) serves dangerous types as text/plain under
Content-Security-Policy: default-src 'none' [sonar2024]. Because attachments
were served at the application root without a CSP, an attachment could also act as
a service-worker script, which persists across reloads and browser restarts and
keeps reading mail or the password after the message is deleted [sonar2024]. The
InsoMail challenge used exactly that: a JavaScript attachment served as script from
the site root was registered as a service worker through an XSS and rewrote the
decryption form, handing the attacker the victim’s private key on the next
decryption; a deny-list of types containing “ml” was the only filter
[betrisey2024].
Pepsi: Addressed. Impact: none.
Both places where pepsi-httpd serves user-supplied parts never echo the
sender’s type. The secure-link portal (pepsi-httpd/src/endpoints/secure.rs)
serves every part as application/octet-stream with Content-Disposition:
attachment, X-Content-Type-Options: nosniff and a default-src 'none';
sandbox policy. The list archive delegates the decision to
pepsi-archive/src/attach.rs::serve, which uses an allow-list
(text/plain with a fixed UTF-8 charset, four raster image types and PDF) and
maps everything else, including HTML, SVG, XML and every script type, to
application/octet-stream; every response is a download, never inline, under
default-src 'none'; sandbox; frame-ancestors 'none' plus nosniff. A service
worker requires a JavaScript media type, which no Pepsi response for user content
carries, and there is no XSS foothold from which a registration could be attempted
(see Reflected and stored XSS or HTML injection in portals and admin mails) (The secure-link fallback portal, Archives).
96.6.1.26. PHP object deserialisation leading to webmail RCE¶
PHP webmail has repeatedly let attacker-controlled data reach unserialize(),
where known gadget chains in the application’s classes turn object injection into
code execution on the server. In Horde Webmail the address book driver factory used
a request parameter as a complete driver configuration when it arrived as an array
rather than a string, so an authenticated user could instantiate an IMSP driver
pointing at an attacker’s server, which then deserialised objects it received
(CVE-2022-30287). Because a single GET sufficed, the request could be forged
cross-site from an image in an HTML e-mail, with Horde’s external-image blocking
bypassed through <picture>/<source srcset>: opening one message gave the
attacker the server, all users’ mail and the victim’s clear-text credentials. Horde
appeared unmaintained and no patch existed at publication [sonar2022]. In
Roundcube 1.1.0 to 1.6.10, a file-upload parameter whose value began with !
corrupted the serialised PHP session, letting any logged-in user inject objects
and execute code (CVE-2025-49113, fixed in 1.6.11 and 1.5.10 in June 2025); an
exploit appeared within days and about 84,000 instances were still unpatched
weeks later [roundcube2025].
Pepsi: Addressed. Impact: none.
Pepsi is written in Rust and has no language-level object deserialisation: the
JSON that pepsi-httpd accepts (API bodies, setup answers) and the state JSON
in the queue are parsed by serde into fixed types or into a plain value tree, which
cannot instantiate arbitrary types or run constructors, so the gadget-chain class
does not exist. The type confusion at the start of the Horde chain is likewise
caught at the type level (a field declared as a string rejects an array). Session
state is not a serialised object held by the client: console and list sessions are
random tokens looked up by digest in admin_session/list_session, and the
portal’s session cookie is an AES-256-GCM token under a pepper-derived key. The
other half of the Horde chain, a state change triggered by a GET from an image, is
closed because every mutation in pepsi-httpd requires a non-GET request carrying
the session’s CSRF token, and Pepsi renders no HTML mail (see
CSRF tokens not bound to the user or privilege level, CSS escaping webmail message isolation and leaking mailbox data).
96.6.1.27. CSRF tokens not bound to the user or privilege level¶
A CSRF token protects only if it is tied to the session and the privilege that
obtained it. In GNU Mailman 2.1 before 2.1.35, a csrf_token obtained on an
unprivileged page, such as a list member’s options page, was also accepted on
administrative forms, so a member could build a forged request that a logged-in
list administrator submitted unknowingly, changing the admin settings or password
and taking over the list (CVE-2021-42097) [cve-2021-42097]. The fix was
incomplete: until 2.1.38 tokens were still not scoped to the role that obtained
them, so a member or moderator could still forge administrative requests
(CVE-2021-44227) [cve-2021-44227]. Both attacks need an account on the list and a
logged-in administrator who visits an attacker’s page.
Pepsi: Addressed. Impact: none.
Pepsi’s list web tier and administrative console are separate principals with
separate token stores. Each session is minted with its own random CSRF token
(admin::auth::mint_session), and only the token’s digest is stored in the
session row; admin::auth::check_csrf_value and web::session::check_csrf
compare the presented token in constant time with the digest of this session.
Member sessions live in list_session and use the cookie names
pepsi_list_session/pepsi_list_csrf, administrative sessions in
admin_session with pepsi_session/pepsi_csrf (__Host- prefixed
under TLS; unit tests in web/session.rs pin the distinct names), and no code
path consults both session stores. A token obtained by a member is therefore useless against the
console, and one administrator’s token is useless in another’s session; the
authorisation of each request is decided from the principal’s own scopes, not from
the token. Cookies are SameSite=Strict in addition (The administration console,
The administrative API). Serving the console and the list site from one hostname is
discouraged in the manual, but even then the separation holds.
96.6.1.28. HTTP request smuggling via Content-Length/Transfer-Encoding mismatch¶
When a front end (reverse proxy, load balancer, CDN) and a back end share one
connection for many users’ requests and disagree about where a request ends, the
remainder of one request becomes the prefix of the next user’s. Kettle revived the
technique in 2019 [kettle2019]: a request carries both Content-Length and
Transfer-Encoding: chunked (or two lengths), and small syntax variations
(odd whitespace, misspelt values, bare LF, folded headers) hide the
Transfer-Encoding from one of the two parsers. A remote, unauthenticated
attacker can then bypass front-end access controls by injecting headers that the
front end normally sets, capture other users’ requests with their cookies, and poison
caches; against PayPal it replaced a script on the login page and led to password
theft. HTTPS does not help. The fixes are HTTP/2 or no connection reuse between
the tiers, identical parsers, and back ends that reject ambiguous requests and
close the connection. Any webmail or administrative interface behind a proxy is
exposed.
Pepsi: Addressed. Impact: none.
pepsi-httpd uses hyper 1.11, whose HTTP/1 server parser rejects a request whose
Transfer-Encoding does not end in chunked, rejects conflicting
Content-Length values, lets Transfer-Encoding override Content-Length
and closes the connection after any request that carried both, and does not accept
Transfer-Encoding on HTTP/1.0; these are the back-end behaviours Kettle
recommends. The front-server sites that pepsi-setup’s reverse-proxy
integration writes (pepsi-setup/src/proxy.rs) proxy to a UNIX socket with
nginx’s default upstream settings (HTTP/1.0, no connection reuse) or Apache
mod_proxy. Front-end-only controls that smuggling could bypass do not exist:
authentication is done by pepsi-httpd itself. The only headers that it trusts
from a front server, X-Forwarded-For/X-Forwarded-Proto, are read only on a
UNIX-socket or loopback connection (ConnInfo::front_is_local in
pepsi-httpd/src/conn.rs), where it feeds rate-limit keys and cookie flags, not
access decisions. The protection rests on hyper’s strictness; an operator who puts
another proxy in front with back-end keep-alive should keep both current
(pepsi-httpd).
96.6.1.29. CRLF injection into proxy route cache redirects IMAP/POP3 sessions¶
Zimbra’s mail proxy, a modified nginx fronting HTTP, IMAP and POP3, cached each
user’s backend route in Memcached and built the cache commands from the user name
in a request URL and the Host header without escaping CR/LF. Memcached’s text
protocol is line-based, so one unauthenticated HTTP request could append set
commands that overwrote the predictable route:proto=imap;user=... key of a known
user, and the next IMAP or POP3 login of that user went to the attacker’s server
(CVE-2022-27924). Because each nginx worker consumed Memcached responses in queue
order without checking keys, injecting surplus responses even hijacked random
users’ lookups. Mail clients re-authenticate automatically, so the attacker
collected clear-text passwords without user interaction; Zimbra was under attack in
the wild at the time. The fix (8.8.15 Patch 31.1, 9.0.0 Patch 24.1) hashes every
cache key with SHA-256 [sonarsource2022].
Pepsi: Addressed. Impact: none.
Pepsi runs no IMAP/POP3 proxy and no Memcached; per-user lookups and caches live in
PostgreSQL and are queried with bound parameters, so user names cannot change the
statement. The analogous risk is in the line-based protocols Pepsi speaks with
attacker-influenced fields, and each is guarded: the outbound SMTP/LMTP client
refuses to send any command line containing CR or LF
(pepsi-common/src/smtp/client.rs), ingress refuses non-CRLF-terminated lines,
credentials passed to the Dovecot auth socket are base64-encoded in a single
resp= field (pepsi-ingress/src/sasl.rs), LDAP key lookups escape every filter
metacharacter and non-printable octet per RFC 4515 (pepsi-keydisc/src/ldap.rs),
and the dispatcher’s worker protocol carries only queue ids. The helpers’ tagged
line protocols (mailbox scan, maildir writer) emit addresses that the driver
re-validates. Nothing in Pepsi routes a client session to a backend chosen from a
cache entry.
96.6.1.30. LDAP filter and regex injection in key lookup selects another user’s key¶
A gateway that finds keys by interpolating an e-mail address into a query language
lets the address act as a pattern. RFC 5322 allows characters such as
*.|{}+? in a local part, so an address can be chosen to match other users’
entries. Suter-Dörig found three such flaws in SEPPmail, all unfixed at the end of
the 2026 embargo [doerig2026]: the GINA key upload checked that a key’s User ID
matched the account address with a regular expression built from the address
unescaped, so an attacker with an address that is itself a pattern could register a
stranger’s key as their own, relabel that person’s signed mail and receive copies
of internal users’ replies (#08, low); the sender’s key for signature checking was
fetched through an LDAP filter with the sender address unescaped, so mail from
*@ the target domain validated a real signer’s signature for the attacker’s
address (#36, low); and the recipient’s private key was found the same way, so an
internal user whose address contained an LDAP wildcard could have mail encrypted
to a colleague decrypted and delivered to them (#28, medium). The fix is exact,
escaped matching of normalised addresses.
Pepsi: Partly addressed. Impact: low.
The injection flaws themselves are absent. Every User ID check (register_from_message
in pepsi-stage-encrypt/src/identity.rs, register_client_key in
pepsi-setup/src/apply.rs, pepsi-keydisc’s import, harvest and WKD checks,
trust::bind_address) extracts the address and compares it for exact equality
after normalisation; no regular expression is built from an address, and the
whitelist stages escape and anchor addresses. pepsi-keydisc/src/ldap.rs escapes
filters per RFC 4515 (unit-tested with *@a.test and a)(cn=*) and discards
any certificate whose rfc822Name differs from the address looked up. Database
lookups (keydisc_lookup, decryption_identities) are exact (Key management,
pepsi-keydisc).
The outcome of #28 has a simpler route in a gateway that opens a ciphertext
with the keys of all local recipients of a row and delivers the plaintext to
each: an attacker holding a ciphertext for alice@ resends it to alice@
and to an address whose content they can read (their own mailbox, or a served
alias, ~/.forward or mailing list that forwards off-site or archives
publicly). pepsi-stage-decrypt closes it: such a row is split into one copy per recipient (split_to_one_per_row) before any key is
loaded, so each copy is opened only with its own recipient’s keys.
A weaker analogue of #36 remains and is configuration-dependent: an
operator-entered *@domain peer key is the fallback for every address at that
domain, and if its certificate names no address, bind_address reports
NoIdentity rather than a mismatch, so a signature that the partner gateway made
for one of its users verifies for any other From: at that domain. (The
no-identity cap of pepsi-stage-decrypt reaches only certificates
trusted through a CA anchor; an operator-entered peer key counts as pinned.)
The manual
(Key management, pepsi-keys) says that a domain-wide
key authenticates the domain or its gateway, not the sender. Capping such a
signature at valid-untrusted unless the certificate names the exact address
would change the verdict that partner gateways rely on. Pepsi keeps the
documented domain-wide semantics, so the operator who enters such a row decides,
and is told so at that moment. pepsi-keys peer import is the only way to
create a *@domain row (the API refuses one); for a certificate that names no
address, it prints that a signature made with it will be reported valid for
every From: at the domain.
96.6.1.31. Login and recovery rate limits defeated by races and logic errors¶
Online guessing limits on passwords and recovery answers fail through small logic
errors. Suter-Dörig found four in SEPPmail’s GINA portal [doerig2026]: the count
of wrong security-question answers was compared with the limit as a string, so
1000 sorted below 5 and the hourly limit stopped applying (#10, medium);
the wrong-answer counter was read early and written back only after the check, so
concurrent guesses overshot it (#54, low); the failed-login counter had the same
check-then-increment race (#52, low); and a locked account still had its password
evaluated, with a session-language side channel telling a correct guess from a
wrong one, so an attacker could keep guessing through every lockout and log in once
it expired (#51, high). The consequences are faster brute force of passwords and
recovery answers and account takeover. The fixes are numeric comparison, an atomic
check-and-increment, and a locked state that fails identically without evaluating
the secret; none was in SEPPmail 15.0.1.
Pepsi: Addressed. Impact: none.
Most of the flaws have no counterpart. Pepsi has no security questions. Its failure
counters, secure_message.failed_attempts (secure_link_finish) and
otp_key.failures (otp_attempt, both in pepsi-setup/db/procedures.sql),
are integers compared with integer limits. otp_attempt reads the row FOR
UPDATE, refuses a locked enrolment without checking the code, and increments or
resets the counter in the same transaction, so concurrent guesses serialise. The
limiters for console and member sign-in are charged under a mutex before the
Argon2id check (LOGIN_RATE_LIMIT, default 10 per minute per account and per
source), and every failure reason runs the same verification and gives the same answer. A
locked portal message answers locked (HTTP 429, the same page whatever was
typed) before the PIN is read or derived, so guesses during a lockout reveal
nothing (A second factor for key management, Someone holding a user’s mail password, The secure-link fallback portal).
The race of #52 has no counterpart in the secure-link portal: a check that only tested
the lockout and counted the failure after the Argon2id derivation would let
concurrent requests all be evaluated beyond MAX_ATTEMPTS.
pepsi-httpd/src/endpoints/secure.rs therefore first calls
secure_link_claim_attempt, which under FOR UPDATE refuses a locked token
and otherwise charges the attempt as a failure, starting the lockout when it
spends the budget, all before the PIN is derived; secure_link_finish undoes
the charge when the PIN is right. Concurrent guesses therefore serialise on the
row, and no more than MAX_ATTEMPTS (default 10) are tested per lockout
window, with lockouts doubling up to 64 times LOCKOUT.
96.6.1.32. Multiple sign-in session confusion stores data in the wrong account¶
Services that let one browser hold several signed-in accounts must route every action to the account that the user intends. Li et al. studied Google’s multiple sign-in, with results obtained before May 2016 [li2017]. Signing in to YouTube with a Gmail account and then to a Google-hosted university mail domain joined the two accounts in one multi-login session without the user adding an account. This happened only with the university’s old login interface; the shared login interface that replaced it in January 2014 no longer joins the accounts. With a personal and a work account signed in, a Google Docs file opened from a mail in one account was stored in the Drive of the other (depending on the link’s domain, or always in the first-signed-in account), with the old and the new interface alike. Data meant for a work account silently ended up in a private one, accounts became linked without consent, and a later user of the browser could reach both [li2017].
Pepsi: Addressed. Impact: none.
Pepsi’s web surfaces have one session per surface and browser, and the two surfaces
never share one. The administrative console and the list web tier keep sessions in
separate tables (admin_session, list_session), use distinct cookie names,
and have separate authenticators with no code path that consults both
(pepsi-httpd/src/web/session.rs); every
request is resolved to exactly one principal, and anything it writes belongs to
that principal. The secure-link portal has no accounts: its session cookie is bound
to the one message whose token and PIN opened it. There is no feature that moves
content between accounts or opens a document in another service, so the misplaced
data of the Google case has no analogue (The administration console).
96.6.1.33. Spoofable sender identity in Webxdc app updates¶
Webxdc apps are small HTML/JavaScript programs that Delta Chat users exchange as
e-mail attachments and that synchronise state by sending update messages to the
chat. Cure53’s 2023 review found that the specification recommended putting
selfAddr, the user’s own address, into each update payload so that apps could
tell who sent it, although the value is supplied by the sending client and never
authenticated [cure532023]. A malicious peer can therefore impersonate another
chat member inside any app that shows trusted UI (votes, ownership, permissions)
based on the payload address (XDC-01-006, informational). The recommended fix is
an authenticated sender identity provided by the messenger for each update.
Pepsi: Not applicable. Impact: none.
Pepsi has no in-mail application runtime and no Webxdc support; it relays such
attachments like any other content. Where Pepsi itself acts on who a message is
from, it does not trust identity fields inside the content: the e-mail control
channels (pepsi-stage-edit-settings, the wallet and key commands) act only on
state.local_origin messages and key on the envelope sender, which ingress has
authenticated and checked against USERNAME_MAP at submission
(pepsi-stage-edit-settings, Per-address settings are a trust boundary).
96.6.2. Cryptographic weaknesses¶
Weak or broken algorithms, parameters and randomness, oracles, malleable encryption and side channels.
96.6.2.1. Bleichenbacher oracle on S/MIME RSA key transport via gateway bounces¶
S/MIME still mandates RSA PKCS#1 v1.5 key transport, and any observable difference
between a correctly and an incorrectly padded key is a Bleichenbacher oracle
[bleichenbacher1998]. Hiding padding errors by substituting a fresh random key, as
OpenSSL did, is not enough: a validly padded key decrypts to the same content key
every time, a random substitute differs on every attempt. Suter-Dörig showed in
2026 that a gateway that exposes the decryption outcome of a message lets an
external sender submit each candidate RSA ciphertext with a random CBC body
repeatedly and read a consistently valid outcome as valid padding; SEPPmail
exposes the outcome through bounce oracles and the [secure] subject tag
[doerig2026]. Each candidate costs
several hundred mails, but the attack ultimately decrypts S/MIME mail to internal
users, or forges signatures where one RSA key both decrypts and signs. It was
rated medium and was unfixed at the end of the embargo; the thesis also criticises
S/MIME 4.0 for still requiring PKCS#1 v1.5.
Pepsi: Partly addressed. Impact: low.
Pepsi’s own CMS opener avoids the obvious oracles. unwrap_cek in
pepsi-crypto/src/smime.rs applies implicit rejection to PKCS #1 v1.5 and
RSAES-OAEP key transport alike: an unpadding or OAEP decoding failure or a
recovered key of the wrong length is replaced by a key of exactly the content
cipher’s length, and the choice between it and the recovered key is a
constant-time select (select_cek), so content decryption always runs and
fails the same way. The RSA operation itself runs on AWS-LC (aws-lc-rs,
blinded and constant time) rather than the rsa crate, leaving one branch on
AWS-LC’s unpadding verdict, which its API cannot avoid
(Timing and microarchitectural Bleichenbacher oracles (Marvin and successors)). first_cek stops at the first
KeyTransRecipientInfo naming one of our certificates, and blur_rsa_timing
holds every RSA unwrap to a randomised deadline as defence in depth for that
branch. With the defaults nothing the sender sees depends on the outcome:
ON_DECRYPT_FAILURE = passthrough, DSNs for mail that arrived encrypted quote
only addressing fields whether or not it decrypted, and no key discovery is started
for a signature inside content from an unauthenticated container
(pepsi-stage-decrypt, Gateway custody (custody = local, the MTA key)).
The substitute is not random_bytes(cek_len), fresh per attempt, which is the
OpenSSL design the thesis exploits (wherever the outcome is observable, repeated
submission of one candidate separates conforming from non-conforming padding).
It is derived from the ciphertext
under a secret that only the holder of the private key can compute
(implicit_rejection_cek: HMAC-SHA-256 keyed with a hash of the private
exponent, expanded to cek_len, the OpenSSL 3.2 and CFRG construction), so
resending a candidate reproduces the same outcome and the repetition test of the
thesis does not tell the two cases apart. What remains is a residue, not the
demonstrated attack. No setting makes the outcome observable to the sender: the
bounce settings of the decrypt and re-encrypt stages drop content from an
AES-CBC container instead of bouncing it, and no later gate bounces or answers
according to such content (Bounces after gateway decryption reveal decrypted content,
CBC padding and format oracles against unauthenticated S/MIME). The defence rests on three things: the
derived substitute is indistinguishable from a real key, AWS-LC’s arithmetic is
constant-time, and blur_rsa_timing adds its randomised deadline.
Default identities use separate signing and encryption keys
(CRYPTO_SMIME_SHARED_KEY = no), so signature forgery would apply only to
shared-key identities. A site that wants no RSA unwrap ever followed by a CBC
decryption can set [stage-decrypt] OPEN_ENVELOPED_DATA = no, which passes
every inbound EnvelopedData on unopened for the recipient’s own client, at
the cost of server-side decryption for the many senders that use nothing else
(default yes). The [pepsi] CRYPTO_SMIME_ALGORITHM default p256
gives an identity ECDH key agreement instead of RSA key transport. RSA
identities in the key store still reach the RSA unwrap and its single branch.
Among them are the ones that a site generates with rsa for correspondents
whose clients cannot encrypt to an EC certificate (measured for OpenSSL, not for
Thunderbird, Outlook or Apple Mail; Client interoperability).
pepsi-status lists them under “RSA decryption keys”, so an operator can see
which identities to supersede with a P-256 one.
96.6.2.2. Decryption status leaked via IMAP fetch and rendering behaviour¶
Neither S/MIME nor OpenPGP protects the MIME structure around an encrypted part, so
an attacker can wrap a chosen ciphertext in multipart/alternative,
multipart/mixed or multipart/related trees whose other parts are fetched or
rendered only when decryption fails, or at a different time. Ising et al. showed in
2023 that a client which decrypts in the background and fetches parts lazily over
IMAP then produces decryption-dependent traffic that a passive observer of the
TLS-protected IMAP connection can see, and with remote content enabled the signal
also reaches the attacker’s web server [ising2023]. Of 19 S/MIME clients only iOS
Mail met all preconditions (it stopped fetching a multipart/mixed message once
one part failed to decrypt); others escaped only through missing features or greedy
fetching. The victim’s client becomes an unattended format oracle that the attacker
queries by e-mail, enough for Bleichenbacher- or Vaudenay-style plaintext recovery
when the format check is strict enough. The authors recommend a single encrypted
part per message, deferred decryption, indistinguishable outcomes, AEAD in the
standards, and binding the MIME structure to the ciphertext.
Pepsi: Addressed. Impact: low.
The client-side mechanism does not exist in Pepsi’s own processing.
pepsi-stage-decrypt decrypts once, eagerly and server-side, and
pepsi_crypto::decrypt opens exactly one ciphertext per layer, replacing the whole
body; there is no “stop fetching after the first failure” behaviour to time, and
ingress never decrypts, so no SMTP reply depends on it. Pepsi also removes the
precondition for clients behind it: with [stage-decrypt] ISOLATE_ENCRYPTED = yes
(the default) a message for a local recipient that carries ciphertext beside other
content is reduced to its first encrypted unit before any key lookup, with every
other part moved into an application/octet-stream attachment that no client
renders or fetches on its own (pepsi_crypto::mime::isolate). Mail passed
through undecrypted therefore reaches the client with one ciphertext that a
client opens by itself, not a tree of copies or decoys: a PGP/MIME or S/MIME container
goes on alone, and the files beside an inline-PGP body are inert attachments.
Switching it off restores the precondition (pepsi-stage-decrypt,
Client custody (custody = client, the MUA key)).
The gateway form of the same signal, for unauthenticated S/MIME, exists only
under a non-default setting. Under the default ON_DECRYPT_FAILURE = passthrough
a failed decryption delivers the ciphertext and a successful one plaintext, and a
CBC-gadget-modified EnvelopedData could make that plaintext load remote content
[poddebniak2018], so that the attacker’s server sees a request exactly when the CBC
padding was valid. [stage-decrypt] UNAUTHENTICATED_PLAINTEXT decides what
happens to plaintext from a malleable container that no valid inner signature
covers (a gadget-modified one never carries one). With text, the default, every
part that a client would render as markup is relabelled text/plain
(pepsi_crypto::mime::plain_text_only), so nothing is rendered and no request
is made; with require-signature the message is delivered still encrypted
whatever the padding, so there is no difference to observe. Only with open,
which delivers the plaintext markup included, does the route exist, and then only
when the recipient’s client loads remote content; this was not tested against
real clients. OpenPGP (MDC/AEAD) and S/MIME AuthEnvelopedData give no oracle
under any setting, since a modified ciphertext never decrypts; AES-CBC
EnvelopedData is accepted because most S/MIME senders still use it.
[stage-decrypt] OPEN_ENVELOPED_DATA = no removes the gateway’s part entirely:
every EnvelopedData is passed on unopened, at the cost of server-side
decryption for most S/MIME senders, which is why the option defaults to yes
(Client interoperability); see also EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail.
96.6.2.3. Home-grown 3DES password-hash encryption with weak keys and oracles¶
SEPPmail protected the key-value tokens in its GINA registration and password-reset links with “hashencrypt”, a custom scheme that Suter-Dörig broke in three ways in 2026 [doerig2026]. The 3DES key was the first 24 bytes of a hex-encoded SHA-256 of an RSA private key, so each key byte held 4 bits and, with the ignored DES parity bit, only about 3.17; the classic meet-in-the-middle attack on 3DES [diffie1977] then needs about 2^50.7 DES operations with an empty salt and only about 2^34.9 with a 5-byte salt, using the attacker’s own registration token as known plaintext (#18). Encryption used ECB over base64 text, and registration acted as an encryption oracle under the global key, so low-entropy fields such as security-question answers could be matched block by block within seconds (#16). And the public salt, the GINA webdomain, was prepended to the secret before the key was cut to 24 bytes, so a long webdomain made the key public and webdomains of several lengths revealed the secret a few bytes at a time (#44). Each led to recovery of reset tokens or password hashes and so to takeover of portal accounts and sending as the victim; none was fixed at the end of the embargo.
Pepsi: Addressed. Impact: none.
Pepsi has its own tokens and portal secrets, and none uses a custom cipher, 3DES,
ECB or a key cut from a string. List verification and reset tokens are 256-bit
random values looked up in the database (pepsi-list/src/token.rs), admin session
and bearer tokens are random 256-bit secrets stored as digests, and portal URL
tokens are HMAC-SHA-256 outputs keyed with the pepper (derive_token), so no
token carries an encrypted payload and registration is no encryption oracle. Every
ciphertext that Pepsi makes for itself is AES-256-GCM with a fresh random nonce
and context-bound associated data: portal messages and session cookies in
pepsi-secure-link/src/crypto.rs, wrapped private keys and TOTP secrets in
pepsi-common/src/keystore/wrap.rs. Derivations keep secret and public inputs in separate
parameters: the portal content key is Argon2id with the PIN as password, a random
per-message salt, and the pepper as Argon2’s keyed secret; session keys and URL
tokens are HMAC with the pepper as key and fixed labels as message. Secrets from
pepsi-setup (origin HMAC key, KEK, pepper) are 32 random bytes
(The private-key custody boundary, The secure-link fallback portal). 3DES appears only for S/MIME interoperability.
A minor residue is that list account tokens are stored in clear in
pepsi.list_pending, so a database snapshot taken within a token’s 24-hour
lifetime lets its holder complete that reset.
96.6.2.5. Portal binding data kept in unauthenticated ciphertext fields¶
SEPPmail’s GINA delivers encrypted mail to external recipients as an HTML attachment that is opened in a web portal. Each such mail is associated with a GINA webdomain, which decides the branding and what the recipient may do (reply to sender only or to all, extra authentication). SEPPmail kept this association only in unencrypted, unauthenticated parts of the attachment. Suter-Dörig showed in 2026 that a recipient can edit the attachment to point at another webdomain with more permissive policies, bypassing security questions or second passwords and, combined with other flaws, sending mail to arbitrary recipients (#11, low, unfixed at the end of the embargo) [doerig2026]. The general rule is that every policy-bearing fact must be either held by the server or bound to the ciphertext.
Pepsi: Addressed. Impact: none.
Pepsi’s secure-link portal keeps every policy-bearing fact in the
pepsi.secure_message row, not in anything the recipient holds. The notification
carries only an unguessable token derived under the pepper; the message content is
AES-256-GCM sealed with that token as associated data; and a reply can be addressed
only to the stored sender and is sent with the stored recipient as envelope sender,
marked author-unverified (reply in pepsi-secure-link/src/mail.rs). There
are no per-domain portal policies or brandings to switch between: the organisation
name and limits come from the operator’s [pepsi-secure-link] section. Editing the
notification therefore changes nothing that the portal relies on (The secure-link fallback portal,
pepsi-stage-secure-link).
96.6.3. Protocol design gaps¶
Weaknesses of the design itself: missing bindings between identities, optional protection that can be stripped, and other design flaws.
96.6.3.1. Replies, drafts and mailto turning clients into decryption/signing oracles¶
A mail client that can decrypt and sign on its user’s behalf will do so for
content that an attacker arranges, as long as the user performs an ordinary action
such as replying. The key cause is that clients decrypt protected parts wherever
they appear in the MIME tree, merge them with the attacker’s own parts into one
displayed document, and quote all of it in a reply. Müller et al. showed in 2019
that an attacker holding captured OpenPGP or S/MIME ciphertexts can embed
hundreds of them in one innocuous-looking message, hide the decrypted text below
blank lines or with HTML and CSS, and receive the plaintext in the victim’s
quoted reply, even if the reply is encrypted to the attacker; the same trick in
reverse, with conditional CSS kept in quoted HTML, makes a signed reply carry
attacker text that the victim never saw, giving the attacker the victim’s signature
over it (CVE-2019-10726 to CVE-2019-10741, affecting among others Thunderbird,
Apple Mail, K-9 Mail and Outlook Web Access) [muller2019b]. The follow-up work
reached the same oracles without any reply: a mailto: link whose body carries
armoured ciphertext made Thunderbird/Enigmail, Postbox and MailMate decrypt it in
the composer, which auto-saved the draft to the IMAP server in plaintext or
signed (CVE-2020-4089 and others) [muller2020]. The textbook summary stresses
that the reply backchannel needs no HTML at all, so plain-text clients are
affected too [schwenk2022c], and RFC 9787 turns the lessons into implementer
guidance: ignore “errant” cryptographic layers, never quote text decrypted from
them, never sign drafts, and encrypt drafts only to the user’s own key
[rfc9787]. A gateway variant was found in SEPPmail: because it added no
signature indicator to incoming PGP mail, a captured signed-and-encrypted
message replayed from the attacker’s own address looked genuine, and the
recipient’s quoting reply leaked it (CVE-2026-2746, reported unfixed in 15.0.1)
[doerig2026].
Pepsi: Partly addressed. Impact: medium.
Pepsi has no composer, no drafts folder and no mailto: handler, so the draft
and mailto oracles are matters for the user’s client. For the reply oracle it
removes the errant-layer form: pepsi-stage-decrypt applies
pepsi_crypto::mime::isolate before decryption, and with
ISOLATE_ENCRYPTED = yes (the default) a message carrying ciphertext next to
other content is reduced to its first encrypted unit, and the other parts become
attachments, so captured ciphertexts cannot be hidden in the text of an innocent
question that a reply quotes. A moved ciphertext is opened into an attachment of
its own when the message’s plaintext is unsigned (up to 16 per message), so a
recipient who forwards such a message, or sends its attachments back, still
returns their plaintext; a quoting reply does not. A ciphertext on a message
for several local recipients is opened only for the recipient whose keys open
it: such a row is split into one copy per recipient before any key is loaded,
so co-addressing a key holder does not show a stranger the plaintext. DSNs about mail that
arrived encrypted quote no content and automatic replies do not quote its
subject (A remote sender, pepsi-stage-decrypt).
The whole-message replay of the SEPPmail case is marked where the user looks.
A signature inside a ciphertext is tagged whatever its verdict
(report::tags): a sound signature whose key is untrusted or unknown, or
which covers only part of what the reader sees, earns TAG_UNVERIFIED_SIGNER
([unverified signer]) beside [decrypted], a failing one earns
TAG_BAD_SIGNATURE_ENCRYPTED ([bad signature]), and a valid one names
the bound address in the tag ([verified: alice@example.org]). Both of the
first two tags are on by default: the argument about damage to mailing lists,
which keeps TAG_BAD_SIGNATURE empty for cleartext signatures, does not apply
inside a ciphertext. A replayed
encrypted(signed(body)) from the attacker’s own address therefore reads
[decrypted][unverified signer] or [decrypted][bad signature]
(What a security indicator means); an unsigned ciphertext still reads [decrypted]
alone, since there is no signer to speak about, and the inner signature is
still consumed by server-side decryption, so the client shows no status of its
own. A reader who quotes anyway still leaks the text; the tag is a cue, not a
barrier.
The signing oracle exists in Pepsi’s own form: under gateway custody
pepsi-stage-encrypt signs whatever the user’s client submits, including
quoted attacker HTML with conditional CSS (by default inside the encryption,
SIGN = encrypted-only under ENABLE_PEP), and Pepsi does not
sanitise quoted content (pepsi-stage-encrypt), since rewriting
what the user wrote is not a gateway’s call. The root causes lie in client
rendering and quoting, so what remains is for client vendors; nothing further
is left for Pepsi’s code. The underlying property is inherent to OpenPGP and
S/MIME: anybody can send a user a ciphertext that the user can read. See also
EFAIL direct exfiltration: plaintext spliced into attacker content and
Scriptless CSS exfiltration of decrypted plaintext.
96.6.3.2. Unauthenticated client auto-configuration steers clients to attacker servers¶
Mail clients that configure an account from nothing but an address and a
password fetch the server names from the network. The mechanisms for doing so
authenticate that answer poorly or not at all: Microsoft Autodiscover, Mozilla
Autoconfig, RFC 6186 SRV records, built-in provider lists and guessing. Serper
showed in 2021 that many Autodiscover clients “back off” from
autodiscover.<domain> to ever shorter parent names until they reach
autodiscover.<tld>, a domain owned by a stranger, often sending HTTP Basic
credentials pre-emptively; about 20 registered Autodiscover.<tld> domains
collected 372,072 Windows domain credentials (96,671 unique) from Outlook, the
Windows Mail app, macOS components and old Samsung clients in four months
[serper2021]. Wen et al. systematised the class in 2025: clients fetch
Autoconfig or Autodiscover over plain HTTP, or follow servers that redirect to
HTTP, so a man in the middle rewrites the host name, and the Autoconfig back-off
to the MX host’s domain ignores public suffixes, so names such as
autoconfig.co.uk can be registered; 22 of 29 clients were vulnerable to at
least one scenario, and most log in without asking the user to confirm the
configuration (KMail and Nextcloud Mail received CVEs) [wen2025]. Built-in
provider lists of 30 mobile clients add stale host names that an attacker can
register and over-broad domain-matching rules that map a user’s address to an
unrelated server [wen2026]. The attacker obtains the user’s password and
control over the mailbox view, by network position or merely by registering a
domain. The fixes are client-side: fetch configuration only over validated
HTTPS, never leave the user’s domain or cross a public suffix, match domains
exactly, and ask the user to confirm.
Pepsi: Partly addressed. Impact: low.
Pepsi is on the publishing side of this protocol. pepsi-httpd serves the
Autoconfig document (draft-ietf-mailmaint-autoconfig) at
https://autoconfig.<domain>/mail/config-v1.1.xml and the /.well-known/
form, only for served domains, only once [pepsi-autoconfig] names an
incoming server, and with the outgoing half derived from the real submission
listener (pepsi-httpd/src/endpoints/autoconfig.rs,
pepsi-httpd). pepsi-setup requests certificates covering
the autoconfig.<domain> names and checks that they resolve here
(autoconfig_hosts in pepsi-setup/src/tls.rs), so a client that insists
on validated HTTPS finds a correct document. Pepsi publishes no Autodiscover
endpoint and no SRV records, so there is no second mechanism that an attacker could
use to contradict the first. The derived submission server is always offered
with TLS, since ingress refuses a plaintext TCP submission listener. If the
operator explicitly advertises a server with *_SOCKET = plain,
pepsi-setup validate and pepsi-httpd at start-up refuse it, naming the
server, unless the same section acknowledges it with
ALLOW_PLAIN_AUTOCONFIG = yes. Such an entry may be right on a closed network, which Pepsi cannot tell
from a typo. An acknowledged entry is published with a start-up warning, because every client
that applies the document will then send its password or mail in clear. Pepsi
itself auto-configures nothing: its own outbound connections (smarthost, LMTP,
IMAP import) are configured explicitly.
What Pepsi cannot change is the client: a deployment’s users remain exposed to
clients that fetch the document over HTTP, back off to autoconfig.<tld> or
Autodiscover.<tld>, or carry a stale built-in entry for the domain, and
nothing a provider publishes stops that. Operators can reduce the exposure by
publishing the Autoconfig name (so well-behaved clients stop at the first rung),
by giving users explicit settings for clients known to be affected, and, for
Outlook users, by blocking resolution of Autodiscover.<tld> names on the
networks they control; the lasting fix is in client vendors’ hands and in a
standard that requires authenticated retrieval.
96.6.3.3. Auto-configuration, provider lists and setup guides downgrade to plaintext¶
The second failure of client auto-configuration is that, even when it reaches
the right server, it often settles on a connection without TLS or without
certificate validation. Wen et al. found servers publishing only plaintext
connection types or non-TLS SRV records, clients that default to plaintext when
they cannot parse a value or cannot auto-configure at all, clients ignoring
Autodiscover’s Encryption element or mis-sorting SRV records, servers
listing STARTTLS or plaintext before implicit TLS, and different security levels
published in different mechanisms, so that an attacker who blocks the secure
lookup forces the weaker one; 49,013 domains were misconfigured [wen2025].
Built-in provider lists in mobile clients contain entries that disable
certificate validation or enforce plaintext connections [wen2026]. Tang et al.
tested 49 clients in 2025: of 30 with auto-detect, 6 could be downgraded to
cleartext by an active attacker stripping STARTTLS and 8 sent credentials in
cleartext even to a passive observer; many ignore LOGINDISABLED and the
SMTP 530 hint, and iOS Apple Mail offered to drop TLS after a certificate
error; a fifth of 1102 university setup guides recommend auto-detect, and some
tell users to accept every certificate [tang2025]. Serper’s “switcheroo” adds
that clients accept a server’s request to fall back to HTTP Basic
authentication, so a user types the domain password into a genuine dialog that
sends it to the attacker [serper2021]. An on-path attacker gets passwords and
mail. The recommended fixes are implicit TLS only (RFC 8314), mandatory
STARTTLS where it is used, consistent configuration across mechanisms, and
explicit settings in setup guides.
Pepsi: Addressed. Impact: low.
On the server side Pepsi avoids the configurations that these studies measured.
A TCP submission listener must use MODE = tls or starttls
(pepsi-ingress/src/config.rs; only the local UNIX socket is exempt), ingress
offers AUTH PLAIN/LOGIN only after TLS, and the published Autoconfig
document defaults to implicit TLS for IMAP (993) and POP3 (995) and derives the
submission entry from the listener actually configured, so it cannot advertise
a security level that the server does not enforce. Autoconfig is the only
mechanism that Pepsi publishes, so there is nothing inconsistent to fall back to
(pepsi-httpd, pepsi-ingress).
IMAP_SOCKET, POP3_SOCKET and SMTP_SOCKET still accept plain, so an
operator can publish a plaintext entry (for an MDA that Pepsi does not run, or
on a closed network), but only after acknowledging it with
ALLOW_PLAIN_AUTOCONFIG = yes in the same section. Without that line,
pepsi-setup validate and pepsi-httpd refuse the configuration, naming
the server; with it, pepsi-httpd warns about every such entry at start-up.
What remains is out of Pepsi’s reach: clients
that try weaker modes first, strip-able opportunistic STARTTLS, accepting bad
certificates, and the user following a careless guide. Those exposures stay with
client vendors and users; see also Mail clients and access protocols use cleartext login or strippable STARTTLS.
96.6.3.4. No warning when a usually-signing contact sends unprotected mail¶
Signatures only help against impersonation if their absence is noticed. Roth et al. observed in 2005 that a client which treats an unsigned, unencrypted message as normal after the same peer has sent signed or encrypted mail lets an attacker strip the protection rather than break it, and proposed flagging every such “downgraded” message in the mailbox list [roth2005]. Wiese et al. confirmed in 2018 that Apple Mail, iOS Mail, Thunderbird and Outlook still track nothing of the kind; in a lab study all nine participants with a conventional interface were confused by an unprotected phishing mail claiming to come from a contact who normally signs, and three sent the requested data in clear, while all nine who saw a downgrade warning with a one-tap “ask the sender to confirm” action were safe [wiese2018]. The attack needs nothing but a forged sender; display-name-only interfaces and incomplete DMARC enforcement make that easy.
Pepsi: Partly addressed. Impact: medium.
pepsi-stage-decrypt keeps the per-correspondent record the study asks for.
Whenever a signature covering the plaintext earns valid, it records the
address and the time in pepsi.signed_sender. valid requires an anchored
key (WKD, DANE-validated, CA-anchored, pinned or our own) bound to From:.
Only valid writes, so a stranger cannot create or refresh the record for
somebody else. If a later message from that address arrives within
MISSING_SIGNATURE_WINDOW_DAYS (default 90) without a valid signature
(unsigned, unverifiable, valid-untrusted or partial),
ON_MISSING_SIGNATURE decides: record (the default) writes
usually-signed=<date> into X-Pepsi-Crypto and
state.crypto.in.usually_signed, where Sieve rules and the Outlook and
Thunderbird extensions (Outlook: the read pane, Thunderbird: the verdict button)
show it; tag also puts [unsigned, usually signed] on the subject;
quarantine holds the message. The default stays record because a
correspondent writing from a phone or a new client produces exactly this shape,
and a tag that fires on those teaches users to ignore it.
What remains: with the default, a reader without an extension or a Sieve rule
sees only the missing [verified] tag, and the protection exists only where
a decrypt stage is on the inbound path. A correspondent’s first anchored
signature starts the record, so the first forgery before any signed mail goes
unnoticed. The [external] mark of pepsi-ingress covers only mail
claiming one of the deployment’s own domains
(Missing or misleading indicators for forged or external sender mail). Operators can narrow the
forged-From: part further with DMARC_ENFORCE (listing trusted list and
forwarder domains in ARC_TRUSTED_SEALERS keeps their relayed mail) and
pepsi-stage-check-whitelist rules requiring signature_required, and can
choose ON_MISSING_SIGNATURE = tag; showing the record without a tag is for
client vendors. Nothing further is left for Pepsi’s code.
96.6.3.5. Key-verification flaws in multi-device sync and SecureJoin¶
Song, Marekova and Paterson analysed Delta Chat, a messenger built on e-mail,
Autocrypt and OpenPGP, and found that two of its key-verification paths trusted
the wrong thing [song2024]. Multi-device synchronisation messages are
self-addressed encrypted mails, but Delta Chat verified their signatures with
the user’s “own” key taken from its peer table, which any received self-addressed
message’s Autocrypt: header could update; an attacker who knows the target’s
public key and can spoof a self-addressed mail could thus make the client execute
forged synchronisation items, planting SecureJoin tokens, blocking contacts or
changing settings, mostly without notification. Separately, a device observing
a self-sent SecureJoin message marked the gossiped key as verified, and because
an unprotected outer Secure-Join header overrode the encrypted one, a genuine
signed reply of the target that gossiped the attacker’s key could be relabelled
as a final SecureJoin step, getting the attacker’s key marked verified. Both were
reported in February 2024 and fixed in Delta Chat 1.44: verify self-addressed
messages only with the real own key, and never honour protocol headers outside
the encrypted payload.
Pepsi: Addressed. Impact: none.
Pepsi has neither multi-device synchronisation nor SecureJoin, but it has the
analogous decisions, and both are taken on the right basis. A user’s own key
never comes from inbound mail: register_from_message in
pepsi-stage-encrypt/src/identity.rs reads an Autocrypt: header only on a
locally submitted message whose sender ingress authenticated, and not at all once
the user has enrolled a second factor. For any address for which Pepsi holds an
identity, keydisc::lookup_own_first replaces every harvested or gossiped key with
our own on rank 0, so a forged self-addressed message cannot change which key
verifies or receives that user’s mail (A remote sender,
Keys of correspondents). Pepsi does not let header fields from outside the
protection count as protected: pepsi-stage-autocrypt-learn refuses all gossip from a
message whose arriving outer header block already carried an
Autocrypt-Gossip: field (gossip_is_believable), and every
X-Pepsi-* header that arrived from outside is stripped before the decrypt
stage writes its own (the one field kept is the X-Pepsi-Warning that
ingress itself added). No key learnt from mail reaches a valid verdict
on its own (pepsi-stage-autocrypt-learn); only a local user
with an enrolled second factor who compared the whole fingerprint can raise one,
with the pin FPR key command (pepsi-stage-encrypt). The “arrived encrypted” input to
that gate has its own weakness, covered in
Unencrypted or merely signed input marked as secure.
96.6.3.6. Encrypted mail stored under the transport key forces key retention¶
Garfinkel et al. pointed out in 2005 that S/MIME clients store a received encrypted message as received, so it stays readable only with the recipient’s original private key [garfinkel2005a]. That conflicts with the good practice of destroying old decryption keys: users must either keep every private key for ever, so that a later compromise of any of them exposes the whole archive, or lose the archive; 58% of the surveyed merchants did not know that losing the key makes stored mail unreadable, and Internet Explorer 4 to 6 even invited users to delete expired certificates and with them the keys. The authors proposed decrypting before storage, re-sealing under a separate storage key, or storing mail on an encrypted file system.
Pepsi: Partly addressed. Impact: low.
Under gateway custody Pepsi does what the paper proposes: pepsi-stage-decrypt
opens mail on arrival, and the filed copy is either plaintext in the trusted mail
store or, when the recipient holds client keys and pepsi-stage-reencrypt
runs, re-sealed to the active client keys of the address (those of the newest
key’s protocol, newest first, at most MAX_CLIENT_KEYS, 8), so a user with a hardware token and its backup,
or one key per device, opens the filed copy with either (Gateway custody (custody = local, the MTA key),
pepsi-stage-reencrypt). Retiring or revoking an MTA key
therefore never makes delivered mail unreadable, and the server need not keep
old keys for the archive’s sake.
The residue is the client key. Mail that correspondents encrypt directly to it is passed through unopened and stored as received. A re-sealed copy opens only with a key that was registered when the copy was filed, and a key added later opens nothing from before it. To read their archive, the user must therefore keep every client key that they ever used (Client custody (custody = client, the MUA key)). This is the trade-off of client custody rather than a defect, and whether old mail is re-encrypted to a storage key is the mail client’s choice; Pepsi could only help by re-sealing to a separate storage key, which would give up the point of client custody.
96.6.3.7. Client-side scanning undermines end-to-end encryption¶
Client-side scanning inspects content on the user’s device before it is encrypted or after it is decrypted, against perceptual-hash lists or machine-learning classifiers. Abelson et al., analysing Apple’s 2021 proposal, argue that this bypasses end-to-end encryption by design. Whoever controls the target list or model can silently extend it to political or religious material: the provider, a curating agency, a government that compels them, an insider or an intruder. Because the list is secret, users do not notice; the scanner can also search content never meant to be shared [abelson2021]. They add that on-device hash lists and models can be extracted and inverted (PhotoDNA hashes to thumbnails, training data from models), that the scanner needs broad access to other applications’ data, and that every device gains privileged, exploitable code. They find no technical mitigation and conclude that the technique cannot be deployed safely.
Pepsi: Partly addressed. Impact: low.
Pepsi ships no client-side scanner, no hash lists and no classifier on users’
devices, and mail encrypted to a user’s client key passes through it unopened,
so no stage can inspect it (Client custody (custody = client, the MUA key)). The analogue lies in gateway
custody: there the end is the server, which opens inbound mail so that the spam,
language, whitelist and any operator-configured pepsi-stage-milter stages
read the plaintext, and a scanner plugged in through a milter can report on
content that the sender believed to be end-to-end encrypted (Gateway custody (custody = local, the MTA key)).
This is documented and the operator is trusted in Pepsi’s model, so it is not a
hidden channel; but a sender cannot tell from outside whether a recipient
domain’s key is a gateway key.
Users who need protection from server-side inspection must use client custody, and an operator can keep scanning stages off the decrypted path. Pepsi could make the distinction visible to correspondents (for example by publishing which keys are gateway-held), at the cost of telling attackers which deployments hold plaintext; whether a compelled operator scans is outside what any software can prevent.
96.6.4. Missing or incorrect checks¶
A signature, certificate, policy or input that is not checked, or checked wrongly.
96.6.4.1. Authentication bypass in gateway, list and portal web interfaces¶
The web interfaces of mail gateways and list managers repeatedly let
unauthenticated attackers in, almost never through cryptography and almost
always through a check that is missing, incomplete or reachable in the wrong
order. Cisco’s Email Security Appliance and Secure Email and Web Manager accepted
a specific login input when LDAP external authentication was configured
(CVE-2022-20798, CVSS 9.8) [cisco2022]. FortiMail’s password-change function
did not authenticate the requester, so anyone could reset a legitimate account’s
password and log in as that user (CVE-2020-9294, CVSS 9.6, fixed in 5.4.11,
6.0.8 and 6.2.3) [fortinet2020]. Zimbra’s mboximport servlet set a 401
status for unauthenticated callers but did not return, so the ZIP import ran
anyway, and that import was itself vulnerable to path traversal. Combined, CVE-2022-37042 and
CVE-2022-27925 gave unauthenticated code execution and over 1,000 compromised
servers in mid-2022 [volexity2022]. Sympa’s SOAP API accepted any string as a
session cookie, rejecting only values matching an expired one (CVE-2020-29668)
[cve-2020-29668]. In SEPPmail’s GINA portal the account-initialisation request
remained accepted after the account existed, letting an attacker overwrite an
external user’s password with a fake upload, and the optional second password of
a GINA mail was checked on the display requests but not on the download request
[doerig2026]. The fixes are structural: one authentication check that every
handler must pass before it runs, and state transitions that are only reachable
from the right state.
Pepsi: Addressed. Impact: low.
pepsi-httpd is built so that the bypass patterns above cannot be written
silently. Every administrative handler receives an authenticated Principal
from admin::auth::authenticate (a Result, so a refusal returns before the
handler is called), every Mailman-compatible list API request passes the central
guard::admit first, bearer tokens are compared as digests in constant time,
sessions are looked up rather than accepted, and there is no LDAP login path
(The administrative API, pepsi-httpd). Password-bearing state changes
start from a token: a list member’s password is set only after a 256-bit
verification or reset token sent to the address is consumed, and registering an
existing address changes nothing but re-sends a token. A console end user signs
in through a one-time link mailed to their served address, which yields a
session holding exactly own:<address> (/ui/enrol, 30 minutes, single
use, stored only as a digest, the same answer for every address). Where the
address has a TOTP second factor the code is checked by pepsi-setup apply
(task confirm-enrolment) before the session is minted, since the web tier
cannot read otp_key. The secure-link portal
has no accounts at all; each message is sealed under a server-generated PIN, and
every path that returns content re-checks a session that only the PIN creates
(The secure-link fallback portal). Privileged changes are only requested by the web tier and
performed by pepsi-setup apply, so even a bypass would not hand over root.
The “button hidden, request still works” pattern is closed for an owner’s key
changes as well: under own:<address>, PATCH /api/v1/identities/{id}
(pepsi-httpd/src/api/keys.rs) and the console’s publish, withdraw, upload and
make-primary actions do not change is_primary, published or
vks_wanted themselves but queue a set-identity-flags task carrying the
otp code, which pepsi-setup apply performs only after checking the
user’s TOTP second factor, as it does for every other owner’s key task; the API
answers 202 with the task. An attacker with only the user’s password cannot
upload the user’s key to a key server, withdraw it from WKD or change the
primary MTA key. An operator holding keys:write still sets the flags
directly.
96.6.4.2. Unencrypted or merely signed input marked as secure¶
GnuPG’s --decrypt does not only decrypt: it also outputs the literal data of
a message that is merely signed or not protected at all. Suter-Dörig found that
SEPPmail took a successful “decryption” as proof of encryption [doerig2026]. In
its PGP path any signed-only or hand-crafted unprotected message received the
[secure] tag, so a user could not tell a signed-and-encrypted message from
one with no protection at all. The GINA web portal encrypts its messages
symmetrically under a passphrase that only the gateway knows, and this is their
only authenticity mechanism. There, an uploaded “GINA message” that was just an
unencrypted literal-data packet was displayed as genuine, letting anyone who can
forge the SMTP sender present arbitrary content as coming from a user behind the gateway.
Neither was fixed when the disclosure embargo ended in January 2026. The fix is
to derive “encrypted” from the cryptographic layers actually processed, never
from the container or from a tool’s success.
Pepsi: Addressed. Impact: none.
The portal case does not carry over: Pepsi’s secure-link portal has no upload
path; a stored message is created only by pepsi-stage-secure-link from a
locally submitted message and sealed with AES-256-GCM under a PIN- and
pepper-derived key with the token as associated data, so anything else opens as
“wrong PIN”, never as content (pepsi-secure-link/src/crypto.rs,
The secure-link fallback portal).
The PGP case is handled by the decrypt stage. The MIME classifier calls any
multipart/encrypted container and any inline -----BEGIN PGP MESSAGE-----
block Encrypted without looking at the packets, so taking encrypted from
it would let a literal-only or signed-only packet sequence read as
encrypted=yes; decrypted=yes to X-Pepsi-Crypto,
pepsi-stage-reencrypt and pepsi-stage-autocrypt-learn’s gossip gate.
pgp::decrypt reports no Encrypted layer when sequoia meets no encryption container, and
the stage takes encrypted from the layers actually removed
(DecryptReport::opened_ciphertext): such a message is delivered with
encrypted=no, no [decrypted] tag, no opening identity and no gossip
accepted, and a signature inside is still verified (stage test
an_armored_message_without_ciphertext_is_not_reported_as_encrypted).
96.6.4.3. Keys and certificates imported or trusted without verification¶
Encryption gateways and services collect keys automatically, and several have
skipped the check that ties a key to the address under which it is filed.
Suter-Dörig found that SEPPmail ran GnuPG with --allow-non-selfsigned-uid,
so a foreign public key with an attacker’s address appended as an unsigned
User ID could be registered as the attacker’s own and the key owner’s signatures
attributed to the attacker; and that it imported every non-CA certificate
carried in a valid CMS signature for later encryption, without checking that it
chained to a trusted CA or was the signer’s, so an attacker attaching a
self-signed certificate for the victim’s address to any signed message made the
gateway also encrypt the victim’s future mail to the attacker, stealthily,
because the victim’s own key kept working [doerig2026]. SEPPmail’s own manual
documents that newly collected root certificates are trusted automatically by
default, with revocation checking of roots off, so a questionable CA is used
until an administrator notices the “New CA added” notification
[seppmail2024a]. ProtonMail’s “Encrypt-to-Outside” flow attaches the sender’s
public key and a link to a web page, and nothing authenticates either, so the
recipient’s own provider can substitute a look-alike page and key, harvest the
password and read the reply [kobeissi2018]. In every case the attacker gains
decryption of future mail or misattributed signatures without breaking any
primitive.
Pepsi: Partly addressed. Impact: low.
None of the four applies as described. ca_trust starts empty, and only the
operator adds anchors, with pepsi-keys ca add, POST /api/v1/ca-trust or
the console’s trust-anchor form. All three go through the same parser, which
accepts a CA certificate alone. Certificates collected from mail go to
peer_key as correspondent keys and CA certificates are skipped, so no
collected root is ever trusted (pepsi-keys, The administrative API). The secure-link
portal attaches no key and needs none: the recipient replies inside the portal,
whose origin is authenticated by WebPKI, and the remaining risk of a look-alike
notification is the generic phishing one (The secure-link fallback portal,
Portal binding data kept in unauthenticated ciphertext fields).
The unsigned User ID case does not apply: iterating cert.userids() would
include User IDs without a binding signature, so a local user could register a
foreign public key with an appended unsigned User ID as their own client key.
pgp::user_ids and trust::cert_addresses in pepsi-crypto read only the User IDs that carry a valid self-signature under the
standard policy and are not revoked (with_policy(...).userids().revoked(false)),
for the signer binding, WKD selection, harvesting, import and client-key
registration alike, so an appended User ID binds nothing.
The certificate case does not apply. collect_smime_certificates in
pepsi-keydisc/src/harvest.rs learns only a certificate that made a
signature in the message: pepsi_crypto::smime::signing_certificates
verifies each SignerInfo (messageDigest over the signed entity, then
the signature under the certificate’s key) and returns the non-CA
certificates that verified, so a certificate attached beside somebody else’s
signature, or carried in a certs-only message, teaches nothing; the
address filter on From: still applies on top. Chain validation is not
required for learning, since what the certificate is worth is decided by the
trust ladder: a certificate from a message that DMARC authenticated, or covered
by a passing DKIM signature aligned with From:, lands on the
inbound-signed rung, anything else on inbound
(pepsi-stage-autocrypt-learn). Our own identities pre-empt
harvested keys, a harvested key never displaces a better-ranked one,
rotations are audited and announced, and one peer key is used per recipient
(Keys of correspondents). Across protocols, pepsi-stage-encrypt picks the
best-ranked key of either protocol and lets PREFER decide only between
keys on the same rung, so a forged Autocrypt: header on unsigned mail,
which lands on inbound, cannot redirect a correspondent whose S/MIME
certificate came from a directory, from DANE, from the operator or from an
authenticated signed message.
What remains is trust on first use within one rung: a correspondent whose
only key is an S/MIME certificate learnt from unauthenticated mail sits on
inbound, the same rung as a planted OpenPGP key, and between the two
PREFER (default openpgp) decides, with no rotation event because the
two keys are of different protocols. Encrypting to a key that nobody published
also raises a background discovery request (recheck_harvested), so a key
that the owner publishes by WKD, DANE, LDAP or a key server replaces the planted
one for later messages. Operators can set MIN_TRUST = inbound-signed,
which refuses every key learnt from unauthenticated mail while keeping those
from authenticated mail, or raise it above harvested altogether, trading
opportunistic encryption to TOFU correspondents for cleartext or secure-link
delivery; the residue is trust on first use itself, which that choice
governs, not a gap in Pepsi’s code. See also
OpenPGP subkey and user ID binding signatures not verified and
Autocrypt and in-band key exchange open to key injection and MITM.
96.6.4.4. Invalid, expired or old signatures reported as valid¶
Some implementations do not check a signature’s validity properly at all, and
many do not check whether a genuinely valid signature belongs to the present
message. Müller et al. found in 2019 that Airmail’s GPG plugin accepted invalid
OpenPGP signatures and did not check the validity of the signing key
(CVE-2019-8338), that Horde/IMP identified keys by 32-bit short key IDs, which
can be collided, and that crafted messages crashed several clients, including a
null-pointer dereference in Mozilla NSS [muller2019]. Suter-Dörig showed that
SEPPmail checked neither the creation time of a signature against the Date:
header nor a PGP signature’s explicit expiration, and stripped inline PGP
signatures before delivery so the recipient’s client could not check either; an
attacker holding an old signed message replays it in a new context and it is
shown as verified, even when the signer limited the signature’s lifetime to
minutes [doerig2026]. The fixes are cryptographic verification before any
verdict, full fingerprints, honouring signature expiration, and accepting a
signature only within a window around the message’s date.
Pepsi: Partly addressed. Impact: low.
The implementation defects do not carry over. Signatures are verified by sequoia
and by Pepsi’s own CMS code before a verdict is formed, a key’s validity is part
of the trust evaluation, keys are identified by full fingerprints (64-bit issuer
IDs only select candidates, so a collision costs a verification, not a
misattribution), and the parsers are fuzzed with a worker that crashes on a
message struck out after three attempts (Test Suite, A remote sender).
OpenPGP signature expiration is enforced, since sequoia’s verifier rejects a
signature not alive at verification time, and an expired signature is handled by
ON_BAD_SIGNATURE.
A signature’s creation time (OpenPGP creation time, S/MIME signingTime) is
related to the message’s arrival time, never to its Date:, which a replayer
writes. A signature is valid-untrusted if it was made more than
MAX_SIGNATURE_AGE_DAYS before this host received the message, or more than a
day after (default 7; sites with delayed queues can raise this integer option).
Such a signature (withheld=old-signature / future-signature) gets no
[verified] tag and no
state.signature_verified, so pepsi-stage-check-whitelist does not honour
it, while the message is still delivered (pepsi-stage-decrypt).
The claimed time is shown as signed-at= in X-Pepsi-Crypto. What remains
is a replay inside the window. An old genuinely signed message that is re-sent
within days with a fresh envelope, Date:, To: and Subject: still
verifies, because the signature covers none of these unless the sender used
header protection; so does one whose signature carries no creation time. Closing that needs the
sender to protect its headers, which is the senders’ and the standards’ part.
96.6.4.5. Recipient verification bypass in qmail-verify¶
Qualys found in 2020 that qmail-verify, a third-party recipient-verification
add-on shipped with Debian’s qmail, never loaded qmail’s control files, so its
default domain was a hard-coded placeholder and every unqualified recipient
address was accepted as “unverifiable” (CVE-2020-3811) [qualys2020c]. On its
own that is an acceptance of mail that should be refused; it mattered because
recipient verification was the barrier in front of the remotely exploitable
integer overflow in qmail-local (CVE-2005-1513), which needs a deliverable
recipient. It was fixed in Qualys’s patch and an updated qmail-verify.
Pepsi: Addressed. Impact: none.
Pepsi’s recipient check (pepsi-recipients, [pepsi-ingress]
VERIFY_RECIPIENTS) derives its plan from the same configuration that the
pipeline uses, so it cannot disagree with the pipeline about which domains are
local (pepsi-ingress). That configuration comprises the delivery
stages’ own locality options, the alias map through the aliases stage’s own
matcher, list routes, service addresses and probes of an LMTP or gateway
backend. An address without a domain is
refused at RCPT with 501 5.1.3 before the check is consulted
(pepsi-ingress/src/smtp/session.rs). The check deliberately accepts when it
is uncertain (an unverified domain, an unreadable map, a database or probe
error), but that is documented and only shifts the refusal to a later bounce,
which BOUNCE_UNAUTHENTICATED = drop keeps from becoming backscatter
(A remote sender). Unlike qmail, Pepsi does not rely on it as a barrier:
the stages are memory-safe Rust and ingress enforces MAX_MESSAGE_SIZE
(552) on every message, whatever its recipients.
96.6.4.6. Signed firmware updates accepted without version check¶
Suter-Dörig found that the SEPPmail appliance verifies the signature on a firmware update but never checks that the update is newer than the installed version [doerig2026]. An attacker can get an old, validly signed image installed by persuading an administrator, or by planting the file through a file-write primitive such as the appliance’s zip path traversal. The attacker thereby downgrades the gateway to a version with known, fixed flaws (such as a command injection fixed in 14.0.6) and from there, combined with other weaknesses, can steal the key material or take over the gateway. The thesis rates it medium; it was not among the issues fixed in 15.0.1. The remedy is an anti-rollback check of the version in the signed image.
Pepsi: Not applicable. Impact: none.
Pepsi has no update installer of its own. It is upgraded through the
distribution’s package manager or make install, and a downgrade needs root
acting deliberately. No Pepsi interface can trigger one: the console performs
no package or service control, and the setup applier’s task kinds contain
nothing of the kind (The administration console). Should an operator install an older build,
the schema check behaves as an anti-rollback check: every database pool runs
schema::check, which reports a database migrated by a later release as
Newer and makes the program exit with code 78 rather than run against it
(pepsi-common schema, db::pool_inner; Installation). Release
tarballs carry a detached OpenPGP signature and the project’s Debian uploads
signed .changes and .buildinfo files (Verifying a download);
version policy at installation belongs to the package manager.
96.6.4.7. Browsers not enforcing CT, revocation and DANE for webmail¶
The browser-to-webmail leg is only as strong as the browser’s certificate checks, and Li et al. found those uneven [li2023a]. Testing 50 browser and operating-system combinations in 2023, they found that Firefox did not enforce Certificate Transparency (Chrome, Edge and Safari did), that outside Windows almost no browser queried CRL or OCSP and almost no Android browser used OCSP stapling, that only desktop Firefox honoured Must-Staple, that no browser implemented DANE-TLSA or HPKP, that Internet Explorer 10 and QQ on iOS lacked HSTS, and that old Internet Explorer, Firefox, QQ and 360 builds accepted certificates without a subject alternative name. A revoked or mis-issued certificate for a webmail domain is therefore accepted by many clients, enabling interception of sessions and credentials by an attacker who holds one. The authors recommend current browsers; no browser fixes are reported.
Pepsi: Addressed. Impact: low.
Pepsi is not webmail, but its browser-facing surfaces depend on the same browser
checks: the administration console, the secure-link portal and the public list
pages (The administration console, The secure-link fallback portal). pepsi-setup obtains
publicly trusted (and therefore CT-logged) certificates through certbot,
pepsi-httpd offers only TLS 1.2 and 1.3 through rustls’s safe defaults, the
portal’s BASE_URL is expected to be https:// and its session cookie is
Secure, and pepsi-setup can suggest TLSA records for the HTTPS
endpoints (pepsi-httpd). None of that helps against a browser
that accepts a revoked or mis-issued certificate, which is the browser vendor’s
to fix.
On its side, pepsi-httpd sends Strict-Transport-Security (one year) on
every TLS listener, so a returning browser cannot be stripped to cleartext by an active attacker answering http:// in front of it
(the first visit and a reverse-proxy front end are discussed under
SSL stripping and certificate-warning click-through); the cost is that an operator who later drops HTTPS for
the name locks out returning browsers until the policy expires. It staples no
OCSP response, which is moot for certificate authorities that no longer run OCSP.
See also Missing HTTPS and HTTP security-header hardening on webmail.
96.6.5. Deployment, configuration and credentials¶
Configuration errors, abandoned resources and weak, reused or stolen secrets.
96.6.5.1. Mail appliances store secrets world-readable or unprotected¶
A mail gateway concentrates credentials: its own TLS and signing keys, the private keys of the users for whom it encrypts, directory bind passwords, tokens for the mailboxes that it delivers to, and the mail in its queue. How these are stored decides how far a compromise of the gateway reaches. After the exploitation of CVE-2023-2868 in the Barracuda Email Security Gateway, the UNC4841 actor harvested plaintext account passwords from the appliance’s configuration database and cleartext credentials, including a domain administrator’s, from mail in its temporary message store. It used them to reach Outlook Web Access and Active Directory. A trigger planted in the configuration database reinfected the clean replacement appliances that victims restored from an exported configuration [mandiant2023b]. In the 2021 Mimecast incident the actor behind the SolarWinds supply-chain attack reached the operator’s production servers. It stole a single certificate that Mimecast used for all customers to authenticate to their Microsoft 365 Exchange Web Services, together with encrypted customer service-account credentials for LDAP, Azure AD, journaling and SMTP routes, and used the certificate against several customer tenants. Mimecast rotated all certificates and keys, strengthened the encryption of stored credentials and moved to per-customer OAuth [mimecast2021].
The analysis of the SEPPmail gateway shows the same weakness as a failure of
defence in depth [doerig2026]. Nearly every file on the appliance is
world-readable, the TLS private key included (mode 644). The local LDAP server
holds all users’ key material and password hashes without any access control.
The control socket of the root-running configuration service, which can execute
shell commands, is writable by the unprivileged nobody account and checks
nothing. Each needs a prior foothold as nobody and was rated low. None was
fixed in SEPPmail 15.0.1. Together they turn any code execution into the
disclosure of every key and into root.
Pepsi: Partly addressed. Impact: low.
Pepsi’s storage of secrets is built against exactly this
(An attacker who has the configuration file, The private-key custody boundary, An attacker who has the database). pepsi.conf is
world-readable but holds no secret: pepsi-setup moves every credential
option that Pepsi defines into a secrets.d/<reader>.secret fragment owned by the
one account that needs it, mode 0640, and verifies ownership
(pepsi-setup/src/secrets.rs). That includes credentials that an operator writes
into the file by hand: pepsi-setup run moves [pepsi-keydiscovery]
LDAP_BIND_PASSWORD to pepsi-keydisc’s fragment, [pepsi-list] API_PASS
to the list fragment and the OAuth client credentials to the token refresher’s,
and a test checks that every secret-shaped option in Pepsi’s option lists is
either moved or names why it is not (a *_FILE path, a public token
endpoint, the telemetry identifier). An option with a secret-shaped name that no
Pepsi program defines stays where it is and is reported on every run. DKIM keys are 0600 in 0700
directories of the signing daemon’s own account, pepsi-dkim. TLS keys stay in certbot’s tree and reach the servers through systemd
credentials. The database is reached by peer authentication only, and each role
gets only what its code uses. A private key is stored as an AEAD blob under a
key-encryption key kept outside the database, in a column that only
pepsi-crypto may read. Administrator and list-member passwords are Argon2id
hashes (64 MiB, three passes). Outside the setuid crypto stages, four programs
hold the key-encryption key, unwrapped keys or the secret fragments:
pepsi-httpd, pepsi-keys, pepsi-config export/import and
pepsi-setup apply. They mark themselves non-dumpable (pepsi_common::process::forbid_core_dumps),
and their units set LimitCORE=0, so neither a core file nor another process
of the same uid reads their memory. Pepsi
holds no credential shared across customers. pepsi-config export writes an
Argon2id/AES-256-GCM encrypted archive that keeps each fragment’s owner and
mode. The root applier’s socket is only a doorbell. The applier takes typed
requests from pepsi.setup_task, which only the pepsi-config role may
write. A compromised stage worker cannot reach it.
The database configuration overlay cannot name an executable: pepsi_common::config_db::check_overridable refuses HELPER,
SCAN_HELPER, MAILBOX_HELPER, PIN_COMMAND and any PROGRAM other than a
bare pepsi-stage-* name, and pepsi-stage-edit-settings refuses HELPER,
so a holder of the pepsi-config role (an administrator with config:write,
or a compromised pepsi-httpd when [pepsi-admin] CONFIG_DB is set) cannot
make pepsi run a binary of its choice
(Command injection and XXE in mail gateway management interfaces).
Two residues remain, and both are the operator’s to manage. First,
pepsi-config export requires a password of at least 12 characters that is
not on the common-password list and is not the host’s name, but
an archive protected by a guessable password that passes those checks still carries every
secret fragment to whoever obtains it, Argon2id notwithstanding. Second, some
exposure is inherent to server-side custody (A compromised component). The
setuid pepsi-crypto stages hold the column grant and the key-encryption key
while parsing attacker-supplied CMS and OpenPGP, and the queue holds decrypted
plaintext. An export archive restores the PROGRAM lines of the host that it came
from, so an archive taken from a compromised host must not be restored unread.
Moving private-key operations into a small non-parsing helper would narrow the
second residue, at real implementation cost.
96.6.5.2. Missing HTTPS and HTTP security-header hardening on webmail¶
Browsers enforce several protections only when the server asks for them: HSTS
against TLS stripping on the first plain-HTTP request, Content Security Policy
against script injection, X-Frame-Options or frame-ancestors against
clickjacking, and nosniff against MIME-type sniffing. In May 2017 only 1.57%
of the Alexa top million sites sent CSP, 5.41% HSTS and 11.1%
X-Frame-Options. 163,183 sites redirected HTTP to HTTPS without setting
HSTS, which leaves the first request open to a downgrade [buchanan2017]. For
webmail the gaps are worse. Of about 21,000 webmail servers, 40.13% presented
certificates that fail verification, only 10.68% sent HSTS, 0.80% still used
TLS 1.0 and 3.83% did not honour TLS_FALLBACK_SCSV. An estimated 17.93% of
all addresses were served by webmail that a network attacker can downgrade
[li2023a]. Earlier, Sohu sent the login over plain HTTP with an unsalted MD5
hash that could be replayed as a password, and 163 served its login page over
HTTP so that it could be replaced in transit [li2017].
Product portals show the same weaknesses on a smaller scale. SEPPmail’s GINA
portal allowed unsafe-inline scripts and served some pages, such as error
pages, without any CSP. An XSS could therefore frame a CSP-free page on the
same origin and load external script into it. The vendor addressed this by
version 12.0.6 [pentagrid2022]. The GINA web server also announced its software
in a Server header, which helps fingerprinting [grossmann2025a]. The cure is
known and cheap: HTTPS everywhere with valid certificates and current TLS, HSTS,
a strict CSP on every response, and the X- headers.
Pepsi: Addressed. Impact: low.
Pepsi has no webmail, but pepsi-httpd serves three browser surfaces: the
secure-link portal (The secure-link fallback portal), the administration console and the
public mailing-list pages (pepsi-httpd). TLS is rustls with its
safe default protocol versions (TLS 1.2 and 1.3, no CBC suites), so version
downgrade and SCSV do not arise, and pepsi-setup obtains certbot
certificates. Every HTML page carries a CSP with default-src 'none' and no
script source, frame-ancestors 'none' with X-Frame-Options: DENY,
nosniff, a referrer policy and no-store. Downloads are
application/octet-stream with a sandbox policy. Session cookies are
__Host- prefixed, Secure, HttpOnly and SameSite=Strict. hyper
adds no Server header and no handler sets one. The CSP bypass reported for
GINA needs script already running on the origin, and no Pepsi page offers that.
Every response of a TLS
listener carries Strict-Transport-Security: max-age=31536000 (add_hsts in
pepsi-httpd/src/router.rs; see SSL stripping and certificate-warning click-through for the first-visit
and reverse-proxy residue), and the plain-text responses built by
router::text (for example the 404 bodies) carry nosniff and a
default-src 'none'; frame-ancestors 'none' policy. What is left is not
Pepsi’s to fix: the optional Outlook add-in task pane has to load Microsoft’s
office.js and so cannot use the strict policy, and a MODE = plain
listener is the operator’s choice behind a reverse proxy, which then provides
TLS and must add HSTS itself.
96.6.5.3. Default passwords and missing application secrets¶
Software that ships a working credential or runs without a secret that it depends on
is insecure until somebody notices. From SEPPmail version 14.1.4 the console
password of the standard support account stays support until it is set
explicitly; version 14.0 had required it to be set. Anyone with access to the
hardware, a remote management board or the hypervisor console can log in and
reinstall firmware or restore a database snapshot [seppmail2026a]. Sympa
before 6.2.62 used one configuration parameter, cookie, as the salt for
stored password hashes and as the secret of its XSS/CSRF protection. Sympa did
not ensure that this parameter was set or unpredictable, so an installation
could run with the parameter missing or guessable and both protections
weakened (CVE-2021-46900, fixed in 6.2.62) [cve-2021-46900].
Pepsi: Addressed. Impact: none.
Pepsi ships no account and no password. A fresh installation has no
administrator. pepsi-setup bootstrap, run as root, mints a bearer token that
is valid for an hour, accepted once and can only create the first account
(pepsi-setup/src/bootstrap.rs). Local administration over the UNIX socket is
authorised by SO_PEERCRED. Console access to the host is governed by the
operating system. Every secret is generated with pepsi-setup’s
random_secret (the SRS secret, the key-wrapping key, the proof-of-origin
key, the pepper, the unsubscribe and VERP secrets) and stored in its reader’s
secrets.d fragment. A component whose secret is missing refuses rather than
falling back to a default. SrsCfg::parse fails when SRS_DOMAIN is set
without a secret or with an empty one. The secure-link portal refuses to seal
without a PEPPER. Without UNSUBSCRIBE_SECRET the list manager issues no
one-click tokens at all, pepsi-stage-list-post and
pepsi-stage-list-bounce refuse to start without VERP_SECRET, and
ListCfg deliberately defaults neither.
Password hashes are Argon2id with a random salt per hash and do not depend on a
site secret. The only residue is that a value the operator writes by hand is
checked for presence, not strength. That is the operator’s choice, like any
password.
96.6.5.4. Weak passwords and guessable account recovery questions¶
Account takeover often goes through the password policy or the recovery path rather than the login. Before 2016, Gmail, Yahoo, Sohu and 163 accepted all-digit or all-lower-case passwords. Their recovery procedures could be passed by people close to the victim [li2017]:
Gmail reset an account after approximate answers about its creation date and last sign-in.
Hotmail reset an account given personal data and the subjects of three mails that the victim had answered, which an attacker can elicit.
163 used three questions from a fixed list of eleven.
Gmail and Sohu put the account ID beside the reset link, so whoever reads the recovery mail owns the account.
SEPPmail’s GINA portal recovers accounts through a security question, and the three suggested ones have very few answers: five digits of an ID card, a time of birth (about 1,440 values) and the city of a first job. The initial burst of guesses precedes the hourly rate limit [doerig2026]. The usual advice is a minimum length rather than composition rules, short-lived single-use reset tokens sent to a verified address, and no knowledge-based questions.
Pepsi: Addressed. Impact: none.
Pepsi has no knowledge-based recovery anywhere. A secure-link recipient who
loses the PIN asks the sender to send the message again, because there is no
portal account (The secure-link fallback portal). Mailing-list members set and reset their
password through a random token mailed to a verified address. The token is
valid for a day, and requests are limited to two per address per hour with an
identical answer for unknown addresses (pepsi-httpd/src/web/account.rs).
Administrators are reset by the operator, and a lost key-management second
factor is cleared with pepsi-keys otp reset (A second factor for key management). Passwords have
a length floor without composition rules: 12 characters for administrative
accounts (pepsi-httpd/src/api/session.rs) and 10 for list members, and either
is refused when it is on a shipped list of common passwords or contains the
account’s name. They are stored as Argon2id hashes. Login attempts are
rate-limited per source and per account, with a daily ceiling per account
(A delegated administrator). Control of the mailbox remains sufficient to take
over a list-member account, the usual trade-off of e-mail based reset.
An administrative account may enrol a TOTP second factor for its password
sign-in (pepsi-keys otp enroll --console), which the setup applier checks.
96.6.6. Resource exhaustion and abuse¶
Exhaustion, amplification and the abuse of a service to attack others.
96.6.6.1. Algorithmic complexity DoS: ReDoS and hash flooding¶
Parsers built on backtracking regular expressions or on hash tables with a
predictable hash can be made to spend super-linear time on short input. In
backtracking engines (JavaScript, Python, Java, PCRE) nested quantifiers, or
adjacent sub-expressions that can match the same text, give exponential or,
more often, quadratic worst cases. About 1% of the unique regexes in npm and
PyPI were super-linear, affecting over 13,000 npm and 705 PyPI modules. Address
recognisers were among the worst categories: 97 of 444 distinct e-mail regexes
in npm. The study also found such regexes in Python’s poplib
(CVE-2018-1060) and in Django’s urlize (CVE-2018-7536) [davis2018]. In
Node.js servers a single request with a crafted Content-Type,
If-None-Match or User-Agent header blocked the event loop. 339 of 2,846
popular sites (12%) were affected, and header-size limits did not help
[staicu2018].
Mail software has the same flaw. Perl’s Email::Address 1.908 and earlier
took a very long time on address lists with parentheses that can be read as
nested comments, so any sender could stall applications such as Request Tracker
(CVE-2015-7686) [cve-2015-7686]. Dovecot’s Sieve engine before 2.3.15
evaluated user-supplied regex tests without bounding their cost
(CVE-2020-28200) [cve-2020-28200]. Cyrus IMAP before 3.4.2, 3.2.8 and 3.0.16
inserted attacker-controlled input into a hash table so that entries collided
in one bucket, and hung for minutes per input (CVE-2021-33582)
[cve-2021-33582]. The fixes are linear-time regex engines or hand-written
parsers, length limits, matching time limits, and keyed hash functions.
Pepsi: Addressed. Impact: low.
Pepsi’s own parsing avoids both causes. Pepsi is written in Rust. Its regular
expressions use the regex crate, which guarantees matching in time linear in
the input and has no backreferences. This includes the list manager’s
owner-supplied header-match rules and ban patterns. The address parsers in
pepsi-common/src/domain.rs (addr_spec_of_header and
strip_cfws) are single-pass scanners that track comment depth with a
counter, so nested comments cost linear time. Hash maps use the standard
library’s randomly keyed SipHash, or dependencies’ randomly seeded hashers, so
collisions cannot be planned. Pepsi implements no Sieve: with
pepsi-stage-relay-to-lmtp the MDA runs it, so CVE-2020-28200 is fixed by
running Dovecot 2.3.15 or later. Each message’s work is bounded by
[pepsi-dispatch] MAX_RUNTIME (default 300 s).
The one place that runs a backtracking engine is pepsi-stage-check-whitelist,
which matches the whitelist_regex patterns in PostgreSQL with ~*.
PostgreSQL’s engine is not a pure DFA and supports backreferences, and the
patterns are written by the operator and, through the setuid pepsi-whitelist,
by any local user in their own namespace; whitelist_regex_valid checks only
that a pattern compiles. The match runs in its own
transaction under a statement_timeout of MATCH_TIMEOUT (5 s); when it
fires, the stage logs a warning naming the whitelists and treats the message as
not whitelisted. A costly pattern therefore costs at most 5 s of one worker per
message that consults it and can only lose the whitelist’s benefit, mainly for
the user who wrote it (and for co-recipients of the same queue row), instead of
tying up workers until the dispatcher’s runtime limit strikes the message.
Pattern length and complexity are still not bounded at add time, which
would turn the slow failure into an immediate refusal.
96.6.6.2. Decompression bombs exhausting attachment scanners¶
A compressed container lets the sender choose the expansion ratio, and software
that unpacks untrusted archives can be driven out of memory, disk or time. DEFLATE
alone is limited to a ratio of about 1032, so classic zip bombs need recursive
extraction. Fifield showed that this is unnecessary. Several central-directory
entries of a zip file can share one highly compressed kernel, with each local
header “quoted” inside the preceding file’s stream. The output then grows
quadratically: 42 kB expands to 5.5 GB, and 46 MB with Zip64 to 4.5 PB. It
works against parsers that read the central directory first: Info-ZIP UnZip
6.0, Python’s zipfile, Go’s archive/zip, yauzl and Android’s
libziparchive. It also works in JAR, APK and office documents
[fifield2019]. The overlap is easy to detect (the UnZip fix for CVE-2019-13232),
but other bombs need no overlap. Fifield’s conclusion is that only limits inside
the parser, or a sandbox with time, memory and disk limits, protect a content
scanner.
Pepsi: Addressed. Impact: none.
Pepsi does not unpack attachments: there is no archive scanner in the pipeline,
and attachment scanning is left to an external milter
(pepsi-stage-milter), which must protect itself. The one place
where Pepsi decompresses attacker-chosen data is an OpenPGP Compressed Data
packet inside a message it decrypts. gpg compresses by default, so almost every
inbound OpenPGP message carries one. pepsi-crypto stops reading at
pgp::MAX_PLAINTEXT (64 MiB) and reports Failure::TooLarge instead of
materialising the output (pepsi-crypto/src/lib.rs,
pepsi-stage-decrypt). Pepsi’s only other compression is gzip
for the TLS reports it sends. pepsi-helper-mailbox-scan does not negotiate
IMAP COMPRESS (async-imap is built without it), talks only to a server
the user names, and runs with that user’s privileges. hyper does not decompress
request bodies.
96.6.6.3. Local denial of service via the MTA control socket¶
An MTA’s local control socket is reachable by every user of the machine, and a single daemon that dies takes the whole mail system with it. Qualys’s audit of OpenSMTPD 5.7 found several ways for a local user to kill or hang it through its control socket [qualys2015]:
a malformed message;
passing about 1024 file descriptors;
wrapping the connection identifier;
a stopped child together with a
.forwardopen that blocks on a FIFO.
The portable fgetln() replacement could also return a zero length, which
callers used to index before the buffer. The invalid-message crash was fixed in
5.4.6p1. The report lists no release for the rest.
Pepsi: Addressed. Impact: low.
Pepsi’s local sockets are the ingress submission socket that pepsi-sendmail
dials (mode 0666), the administrative socket of pepsi-httpd and the
applier’s doorbell socket. None of them accepts file descriptors. Line parsing
is memory-safe Rust. A panic in one connection task ends that connection only.
The tasks the process cannot live without are spawned with
spawn_essential, so that systemd restarts the service. The caller’s identity
comes from SO_PEERCRED. .forward processing runs in a separate helper
process as the user, per message, under the dispatcher’s runtime limit
(pepsi-stage-dot-forward). It cannot block a daemon.
Local connections share one ceiling, MAX_LOCAL_CONNECTIONS (default 32),
and one uid, root included, may hold at most half of it
(pepsi-ingress/src/conn.rs), so a single local user cannot make every other
user’s pepsi-sendmail (and cron’s mail) fail with EX_TEMPFAIL. Colluding
accounts cannot fill the ceiling either. When it is full, a new local
connection from a uid holding fewer local connections than the heaviest uid
evicts the heaviest uid’s longest-idle connection with 421 4.3.2, provided
that connection has sent no complete command line for five seconds. pepsi-sendmail reads its
whole message before it connects and never pauses that long, so held-open
connections are what gets evicted, never a legitimate submission; a newcomer
from the heaviest uid is refused. A
connection that keeps sending a body byte by byte is not idle and holds its
slot until DATA_TIMEOUT, SESSION_TIMEOUT (30 min) or the local message
rate ends it. Remote SMTP is not affected.
96.6.6.4. Provider notification workflows send attacker-controlled mail¶
A notification that a provider sends on a user’s behalf passes SPF, DKIM and DMARC by construction, because the provider really is the sender. If the server does not bind the person who triggers the mail, their tenant, the object, the recipient and the allowed content together, an ordinary account can make a trusted provider deliver phishing. Nigam studied three workflows of a large cloud provider in 2026 [nigam2026]:
An application-sharing message field was limited and stripped of HTML only in the user interface, so raw HTML, CSS and links reached the delivered mail and could hide the provider’s own text.
A collaboration-sharing backend accepted any recipient address and directory object together with a caller-supplied subject and HTML body.
An approval application lacked object-level and role checks, so consumer accounts could trigger business notifications about other tenants’ records.
Sender authentication and reputation filtering do not stop such mail, and its links can lead to device-code or consent phishing. The services were fixed after disclosure. The paper recommends treating notification origination as a privileged action: resolve recipients on the server, use typed templates instead of free subject and HTML fields, and record the initiating principal.
Pepsi: Partly addressed. Impact: low.
Pepsi originates several kinds of mail under the deployment’s domains, and most are built from fixed templates with escaped fields:
The public list forms send a confirmation or reset mail to an address supplied by an anonymous visitor. Its text is a fixed template naming the site, the address and a token. The forms are limited to two mails per target address per hour as well as per client (
spend_budgetinpepsi-httpd/src/web.rs);[pepsi-list] WEB_REGISTRATION = noremoves the registration form.pepsi-stage-edit-settingsand the wallet control address answer only the authenticated local sender.pepsi-stage-secretarychallenges only an envelope sender that passed SPF or DMARC.pepsi-stage-bouncesends no DSN for unauthenticated mail underBOUNCE_UNAUTHENTICATED = drop.Secure-link notifications go only to recipients of mail that an authenticated user sent.
The residue is the automatic replies to inbound mail. pepsi-stage-anti-spam
sends its payment request, pepsi-stage-vacation its notice and
pepsi-stage-list-command its results to the envelope sender. None is sent
when SPF or DMARC failed definitely at ingress (fail;
pepsi_common::autoreply), but by default none requires a pass either, so a
forged address at a domain that publishes no failing SPF policy and no DMARC
record is answered. What such a reply carries is fixed text. The inbound
sender’s words are quoted only to a sender that passed SPF or DMARC or submitted
locally (autoreply::may_quote); these words are the From: display name,
the subject, the list command lines and echo arguments. Otherwise, the payment request
omits the greeting by name and the quoted subject, the vacation notice
carries the bare SUBJECT_PREFIX and names the address to which it is sent, the
secretary challenge (when REQUIRE_AUTHENTICATED = no) greets the address
and gives no subject hint, and the list results replace the original’s details
and the unprocessed lines with counts. A forger can therefore still make Pepsi
send a fixed, DKIM-signed notice to a victim, but no text of the forger’s
choosing. The volume is small: RFC 3834 suppression in
pepsi_common::autoreply, at most one reply per correspondent per
BLOCK_RESPONSE_SUPPRESS (1 h) or SUPPRESS_DAYS (7). This is the
reflection described under Bounces, auto-replies and MDNs reflected at forged return addresses.
REQUIRE_AUTHENTICATED = yes on these stages withholds the reply itself
unless SPF or DMARC passed or the mail was submitted locally, as the secretary
does by default. It defaults to no because its cost is no notices to
senders whose domains publish no policy; the wizard writes it as a commented
hint.
96.6.7. Information leaks and tracking¶
Unintended disclosure of content, metadata or the reader’s activity.
96.6.7.1. Remote content and personalised links reveal opens, device and location¶
HTML mail may reference remote resources, and clients fetch them when a message is opened. A URL personalised per recipient therefore becomes a read receipt that the recipient never agreed to. Each fetch reveals that and when the message was opened, how often, the IP address (location, organisation) and the user agent. It is repeated at every reopening and works across devices [bender2016] [xu2018] [kalantari2021] [clark2021]. Measurements show it is the norm in commercial mail:
In 2015, 51% of large companies’ newsletters contained tracking images [bender2016].
85% of 12,618 mailing-list mails embedded third-party content, 70% contained known trackers, and 29% leaked the recipient’s address, often hashed, to third parties [englehardt2018].
24.6% of 2.3 million mails received by disposable-address services carried tracking, and trackers hid behind false image sizes and first-party redirects [hu2019].
89% of newsletters embedded third-party resources, and tracking served from the sender’s own subdomains (CNAME to the mail service) defeated blocklists [kalantari2021a] [kalantari2021].
Up to 20% of senders leaked the address to third parties, often only MD5-hashed [maa2019].
From opens alone, city-level location (about 90% accuracy), devices and daily routines can be inferred, and 52% of surveyed users did not know that opening a mail can be tracked [xu2018].
Defences are partial. In 2015 no tested client fetched images before a message was opened, but none filtered tracking images selectively either [bender2016]. Image proxies such as Gmail’s hide the IP address but still report the open and its time [hu2019] [xu2018]. Blocking all remote content is reliable but breaks legitimate layouts. The proposals are selective blocking by a classifier, including a server-side anti-tracking mail server [bender2016] [fabian2020], HTML filtering on the mail server after DKIM verification with e-mail-specific filter lists, which cut address leaks by about 87% [englehardt2018], beacon detection with a user indicator [xu2018], and MDN-style consent for read receipts [kalantari2021].
Pepsi: Partly addressed. Impact: low.
Where Pepsi renders mail itself, it renders none of it as HTML. The secure-link
portal folds every message to text and serves it under a policy that names no
remote image source (img-src 'none', or data: for an inlined logo), so a
tracking pixel cannot report that a portal message was opened
(The secure-link fallback portal). The mailing-list archive pages are likewise script-free and
use a strict policy. Mail that Pepsi originates (DSNs, list notices, payment
requests) contains no tracking references, and the payment request’s QR code is
inline (cid:).
Ordinary mail is filed as it arrived unless its recipient asks otherwise.
pepsi-stage-defang is the server-side filter that the studies recommend, for
each user who turns it on (DEFANG = on by settings mail or
pepsi-settings; pepsi-stage-defang). pepsi-setup --wizard
wires it in just before local delivery, switched off. The stage runs after every stage that verifies a
signature and after ~/.forward, so DKIM, ARC and DMARC have been judged and
a forwarded copy keeps its bytes, and it removes everything an HTML or CSS part
would load by itself: images, srcset, backgrounds, style sheets, fonts,
frames, url(), @import and URL strings, <meta http-equiv=refresh>.
Inline data: images and cid: parts stay, and so do links. The HTML is
read by the HTML tokenizer’s own rules, so markup written to look like
something else to a filter is read the way the client reads it
(Remote references in HTML). A changed message is marked X-Pepsi-Warning:
remote-content-defanged.
What remains is outside the stage by design. It is off by default, since it
costs layout. It never touches content under a signature that the client
checks again (multipart/signed, S/MIME, inline OpenPGP), nor mail that is
end-to-end encrypted for a client key, so for those the client’s own blocking
decides. And a personalised link still reports the click: following it is the
reader’s act. Users who want protection turn the stage on and keep remote
content blocked in their client (Remote content); client
vendors decide the rest.
96.6.7.2. Backchannels and CSS bypass remote-content blocking and fingerprint¶
Blocking remote images does not stop a client from contacting the network while
it renders a message. In the EFAIL study, 13 of 48 clients loaded images by
default. Others could be made to fetch through other HTML elements and URI
schemes (22 clients), CSS (11) or JavaScript (5), and three loaded remote
content only for encrypted mail. S/MIME added OCSP, CRL and intermediate
certificate fetches (seven clients fetched intermediates from attacker-chosen
servers). OpenPGP added automatic key download, and message/external-body
triggered DNS requests. Each such backchannel leaks privacy, and combined with
ciphertext malleability it exfiltrates plaintext [poddebniak2018]. Modern CSS
needs no script. Media, @supports and @container queries, font
availability and arithmetic make a remote request depend on the rendering
environment, so the set of requests fingerprints application, operating system,
hardware and preferences. 18 of 21 mail clients exposed at least one technique
and 8 to 9 exposed all of them, including clients that proxy remote content.
Thunderbird and SOGo filtered external stylesheets more weakly than inline
styles [trampert2025b]. Spot fixes for individual features have not kept up.
The proposed general fix is a proxy that fetches and inlines all remote
resources unconditionally and turns stylesheets into style attributes.
Pepsi: Partly addressed. Impact: low.
Pepsi’s own processing opens few backchannels. X.509 validation on a
message’s behalf fetches nothing: no OCSP, no AIA intermediates, and it uses
only the certificates it is given plus the CRLs already cached in
pepsi.crl_cache and, under CA_ISSUERS_FETCH, the intermediates in
pepsi.ca_issuer_cache. pepsi-keydisc fetches both for the certificates
in its cache on its own schedule (lists at each nextUpdate and at least
daily, intermediates weekly), so a CA learns at most that this host holds some
certificate that it issued, never which message was processed when.
message/external-body is never resolved. A DSN for mail that arrived
encrypted carries neither content nor subject, whether or not decryption
succeeded. Key discovery is the one network request made on a message’s behalf.
A decrypted message whose signature cannot be checked may park while
pepsi-keydisc queries the claimed From: domain. The decrypt stage starts
no such lookup for content from a container without integrity protection, so
the lookup cannot serve as a CBC oracle. Content isolation
(ISOLATE_ENCRYPTED, default on) moves every part beside a ciphertext into an
inert attachment before decryption, so attacker HTML wrapped around a captured
ciphertext is never rendered beside the plaintext
(EFAIL direct exfiltration: plaintext spliced into attacker content).
The portal renders text only, under a CSP without remote sources.
Pepsi does not sanitise HTML in the mail it delivers by default: users read in
any client, and a rewrite of authenticated HTML would break a signature that the
client checks again. For a user who turns it on, pepsi-stage-defang removes
every remote reference outside a signature, which takes the network out of the
CSS fingerprinting techniques and the HTML backchannels as well
(Remote content and personalised links reveal opens, device and location). Decrypting at the gateway also
removes the “this was encrypted” context that makes some clients block more
strictly. Which backchannels and CSS fingerprinting techniques fire is
therefore up to the recipient’s client, and the manual tells users and
operators how to block remote content in Thunderbird, Outlook, Apple Mail, K-9
Mail and FairEmail, in all mail rather than only in encrypted mail
(Remote content). The one case where decrypted HTML was itself
the attack vehicle, malleability gadgets inside a single CBC ciphertext, does
not reach a renderer: a plaintext from an unauthenticated container that no
inner signature covers is delivered with every markup part relabelled
text/plain ([stage-decrypt] UNAUTHENTICATED_PLAINTEXT = text, the
default; EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail). Authenticated encrypted mail
keeps its HTML under the default DECRYPTED_MARKUP = keep; text, for a
site or, through an overlay or pepsi.settings, for one user, reduces every
decrypted plaintext the same way (sanitised=text in X-Pepsi-Crypto),
at the cost of layout in legitimate encrypted newsletters. Mail that was never
encrypted is not touched either way. Pepsi already emits the structural fix,
authenticated encryption, but cannot impose it on senders. By default it sends
AES-256-GCM AuthEnvelopedData, and CBC only to a correspondent whose
recorded smime_capability says that their client cannot read
AuthEnvelopedData.
96.6.7.3. Webxdc app sandbox escapes leak data via CSP bypass and DNS¶
Delta Chat runs Webxdc apps, small HTML/JavaScript bundles received as mail attachments, in a sandbox meant to have no network access. Data entered into an app should leave only as chat messages. Cure53’s 2023 test of the desktop (Electron) client found three ways to defeat the CSP that enforced this [cure532023]:
XDC-01-002, high: the client-served
webxdc.jswas same-origin but had no CSP, so an app could frame it and fetch through its window.XDC-01-005, high: Chromium’s built-in PDF viewer replaces a PDF response and drops its CSP.
XDC-01-004, medium: DevTools could be opened with F12 and made to fetch URLs.
Even with network loads blocked, the engines still resolved host names. The
desktop client honoured dns-prefetch hints (XDC-01-001), and Android’s
WebView resolved iframe sources and navigations (XDC-01-003). An app could
therefore encode chat data, the user’s name and address in subdomains of an
attacker’s zone and leak them through the victim’s resolver [cure532023]. The
recommendations were a CSP on every served resource, refusing application/pdf
with nosniff, no easy DevTools access, and a proxy that refuses DNS
resolution.
Pepsi: Not applicable. Impact: none.
Pepsi is a server and runs no code received in mail. Neither pepsi-httpd nor
the portal executes attachments, and nothing in Pepsi embeds a browser engine.
The nearest analogue is the portal serving attacker-supplied attachments from
its own origin. Every download is sent as application/octet-stream with
Content-Disposition: attachment and a default-src 'none'; sandbox policy,
regardless of the type that the message claims. The portal pages name no script
source, so no page can frame another to escape the policy (The secure-link fallback portal).
The short plain-text error bodies carry a default-src
'none'; frame-ancestors 'none' policy too (Missing HTTPS and HTTP security-header hardening on webmail).
96.6.7.4. Scriptless CSS exfiltration of decrypted plaintext¶
After EFAIL, clients stopped splicing decrypted text into attacker HTML, but several still render decrypted parts in the same context as an attacker’s stylesheet. Trampert et al. showed in 2025 that CSS alone then reads the plaintext [trampert2025]. Lazy-loaded web fonts with crafted contextual ligatures give a matching character sequence a distinctive width. A container query measures that width and loads a unique remote image. CSS animations cycle through fonts, so the whole plaintext leaks character by character in one rendering pass, without JavaScript or visible artefacts. The attacker needs the ciphertext and sends it to the victim wrapped in their own HTML.
Thunderbird, KMail and Apple Mail with GPGSuite were vulnerable. KMail, which had resisted EFAIL, was vulnerable to this. In Thunderbird, linked stylesheets allowed the needed features, and remote-content blocking did not apply in the mixed context. The technique passed DOMPurify’s default configuration and defeated Meta’s Code Verify. Mozilla announced a fix and KDE planned one, while the sanitiser maintainers kept their defaults. The recommended mitigations are isolating decrypted content or refusing to mix encrypted and unencrypted parts, blocking remote content correctly, and stricter sanitiser defaults.
Pepsi: Partly addressed. Impact: low.
Pepsi implements the first recommendation on the server. Before decrypting,
pepsi-stage-decrypt reduces a message for a local recipient that carries
ciphertext beside other content to its first encrypted unit and moves every
other part into an application/octet-stream attachment
(ISOLATE_ENCRYPTED, default on, pepsi_crypto::mime::isolate). It applies
the rule again to each recovered plaintext, and also when the message is passed
through for a key the user holds in their own client
(pepsi-stage-decrypt). The attacker’s stylesheet therefore
reaches the client only as a file that is never rendered, and what is rendered
is only what the ciphertext itself decrypts to. The portal never renders
HTML.
What remains: an operator can turn isolation off, and then protection depends entirely on the client. Isolation applies only to local recipients, so mail that Pepsi merely relays is the next hop’s responsibility. Styling that an attacker smuggles inside one CBC ciphertext through malleability is not removed; that is EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail. Clients still need to isolate content that they decrypt themselves from a source that Pepsi does not filter, such as a mailbox outside the deployment.
96.6.7.5. Bounces after gateway decryption reveal decrypted content¶
A decrypting gateway hands plaintext to whatever comes after it, and a delivery failure there produces a bounce to the SMTP envelope sender. For a replayed message, the attacker chooses that sender. Three gateway findings exploit this. CipherMail Gateway before 6.3.3 bounced after decryption, by itself or through a next-hop server. Such a bounce could quote the plaintext, and the presence of an “S/MIME encrypted” info header showed whether a chosen ciphertext had decrypted. That is a CBC padding oracle needing about 128 bounces per byte and no victim interaction. A failed OpenPGP decryption also left the “was encrypted” marker unset, so protections keyed on it were skipped [ciphermail2026]. The fix lets operators rewrite the envelope sender of every message detected as encrypted to an internal address, and limits the gateway’s own bounces to headers.
SEPPmail implements S/MIME header protection by copying every header of the decrypted entity into the outer message, and a downstream bounce returns them. Through CBC malleability (and AES-GCM recast as CFB) the attacker can also move body content into header position (#31). Because the internal server returns full messages in bounces, a captured message crafted to pass SEPPmail but be rejected downstream comes back in plaintext (#55). Both were rated high and were unfixed at the end of the embargo [doerig2026].
Pepsi: Addressed. Impact: none.
Pepsi decrypts early, so later stages hold plaintext. It therefore records in
state.crypto.in that a message arrived carrying ciphertext, whether or not
it decrypted and also when it was passed through for a client key. For such a
row pepsi-stage-bounce ignores RET=FULL and quotes only From,
Sender, To, Cc, Date and Message-ID, with no subject, no
X-Pepsi-* field and no body
(pepsi_common::crypto_state::dsn_must_withhold_content). The DSN is the same
whether decryption succeeded or failed. Pepsi does not copy the recovered
entity’s headers outwards. pepsi_crypto::mime::entity_headers_only keeps
only Content-*, MIME-Version and Autocrypt-Gossip, so a header line
forged by a CBC gadget has no route into a DSN. AES-CFB is refused. When such a
message is relayed, DsnParams::from_state turns RET=FULL into
RET=HDRS for the next hop. Automatic replies do not quote the subject of
encrypted mail (pepsi-stage-bounce,
pepsi-stage-decrypt).
A local recipient with off-site forwarding (a remote alias target or
~/.forward) receives a plaintext copy, because pepsi-stage-reencrypt
sits after forwarding so that forwarded copies stay readable, and a remote
host may fail such a copy after accepting it and return it whole whatever
RET said. Pepsi therefore rewrites the envelope sender of every forwarded
copy to an address of its own, as CipherMail does: a forward return address
(fwd+<sealed>=<tag>@SRS_DOMAIN, pepsi-stage-srs) that seals
the original sender, the address that the sender used and the fact that the message
arrived encrypted. The remote host’s bounce comes back to ingress, which drops
it after logging its status fields and has pepsi-stage-bounce answer the
sender with a DSN that quotes nothing of the message at all. The address is not
length-capped, so a long envelope sender cannot force the SRS address that
would route the remote bounce back unchanged.
That the remote host holds the plaintext copy is what forwarding to it means: a user who forwards encrypted mail off-site chooses to trust that host with it, and nothing of it returns to the sender.
96.6.7.6. Decrypted mail, keys or subjects persisted to logs and local storage¶
Encryption protects mail only as long as nothing writes the plaintext, or the keys, somewhere less protected. In the German healthcare messaging system KIM, one vendor’s client module logged the complete SOAP traffic with the connector by default. This included the Base64-encoded plaintext of every message sent and received, which ended up in rotated log files and routine backups on practice servers, although the specification forbade it. T-Systems disabled the logging by default in May 2022 [saatjohann2024]. Webmail wrote subjects into browser session and history files through page titles and URLs, and 163 and Sohu stored the password in the session file even when the user had not asked to be remembered [li2017]. Thunderbird 78.8.1 to 78.10.1 stored imported OpenPGP secret keys unencrypted, without the master-password protection, so anyone who could read the profile obtained them (CVE-2021-29956, fixed in 78.10.2) [mozilla2021].
Pepsi: Partly addressed. Impact: medium.
Pepsi writes no message content to its logs. Stage logs carry identifiers,
addresses and verdicts. The opt-in [pepsi] MAIL_LOG records the envelope and
at most the outer Subject:; content is never written at any setting
(pepsi-common/src/mail_log.rs, Logs). Workers may not
write to stdout. Browser pages are sent with no-store, and the portal shows
no subject in a URL. Private keys are stored only as AEAD blobs under a
key-encryption key held outside the database (The private-key custody boundary).
The KIM lesson applies in another form: plaintext ends up where backups and
people outside the trust boundary can read it. Decrypted plaintext is committed
to pepsi.workqueue_body. It stays there while the message is queued: up to
INBOUND_TIMEOUT when parked for a signer key, in failed rows until
pepsi-failure-bouncer acts (an hour by default), and at a quarantine stage
until pepsi-queue gc bounces it [pepsi-queue] QUARANTINE_MAX_AGE_DAYS
(default 14) days after arrival, with a DSN that returns no content whatever
RET asked (or drops it, when it came out of an AES-CBC EnvelopedData). It is also in the PostgreSQL WAL and in every pg_dump,
including the dump that pepsi-setup schema --backup-dir takes on package
upgrades, of which only the newest two are kept (--backup-keep). Mail filed in the
mailbox is plaintext unless pepsi-stage-reencrypt applies, and inbound
milters see plaintext and may log it. A disk image that holds both the database
and secrets.d yields the wrapped private keys together with their wrapping
key. Backup and restore warns that dumps hold queued plaintext, and
Threat model treats the operator as trusted. The risk is copies outside
that boundary: backups, third-party milters and stolen disks. What remains for
the operator is disk and backup encryption, a shorter quarantine limit where
review is quick, and pepsi-stage-reencrypt for users who hold client keys.
None of them costs compatibility, and nothing further is left for Pepsi’s code.
96.6.7.7. Portals and APIs disclosing user data or key material without auth¶
Mail systems grow web surfaces, such as secure-mail portals, REST APIs and customised self-service front ends. These sometimes answer questions about users without checking who asks. In authorised penetration tests of Chinese providers’ customised mail systems, Yu et al. found endpoints that returned users’ phone numbers and even login verification codes to unauthenticated callers, which is enough to take over accounts or to prepare targeted social engineering; no technical details were published [yu2022a]. In the SEPPmail gateway, the REST endpoint that returns the key material of a named user or domain fell back to returning the data of every user and domain when the name did not exist, until release 15.0.2 (January 2026) made it answer with an error [grossmann2026b]. Pentagrid’s 2020 test of SEPPmail 11.1.10 found a milder variant: the portal’s account-initialisation endpoint stayed reachable with self-registration disabled and answered differently for addresses that already had an account, so an attacker could enumerate who receives confidential mail from the organisation and create unactivated accounts; it was addressed in 12.0.6 [pentagrid2022].
The common cause is an access check or a filter that fails open: a missing authentication step, an empty filter treated as “everything”, or an error path that tells known from unknown users. The fixes are to authenticate every non-public endpoint, to treat an unknown name as an error rather than as no filter, and to answer identically for known and unknown identities.
Pepsi: Partly addressed. Impact: low.
The administrative API in pepsi-httpd is mounted only on listeners flagged
ADMIN = yes and requires a principal (peer credentials, bearer token or
session cookie; pepsi-httpd). Key listings pass the
address filter into SQL (IDENTITY_FILTER_SQL in
pepsi-common/src/keystore/db.rs), so an unknown address yields an empty
page rather than every row, and a principal confined to own:<address> is
forced to its own address and refused for any other (address_filter in
pepsi-httpd/src/api/keys.rs). Private key material cannot leak through the
web tier at all, because crypto_identity.private_wrapped is granted to the
pepsi-crypto role alone (An attacker who has the database). /metrics is served only on
administrative listeners, the autoconfig endpoint ignores the
emailaddress parameter, and the secure-link portal has no accounts: its
URL token names one message, which is unreadable without its PIN
(What this protects, and what it does not). The list web tier’s registration, resend
and reset forms answer identically whether or not an address is known, re-send
a live token instead of minting a new one, and are rate-limited per client and
per target (pepsi-httpd/src/web/account.rs). Each does its database work in
one statement that is the same for a known and an unknown address
(account_register and account_reset_token in
pepsi-list/src/rest.rs), and a test counts the round trips of both paths.
[pepsi-list] WEB_REGISTRATION = no removes web self-registration while list
pages, sign-in and password resets stay served.
Three disclosures remain, all of them of addresses rather than data. The WKD
endpoint answers any number of guesses about which local parts publish a key;
this is a documented decision, since WKD is a public oracle by design
(pepsi-httpd/src/endpoints/wkd.rs). VERIFY_RECIPIENTS refuses unknown
recipients at RCPT, which tells a remote client which addresses exist, at
ten guesses per connection (MAX_INVALID_RECIPIENTS, A remote sender);
turning it off brings back backscatter. And where web registration is on, its
default, anyone can create unverified user rows for arbitrary addresses,
bounded by the rate limits; a site whose list accounts come from invitations,
imports or owners turns it off.
96.6.7.8. mailto attach parameter exfiltrates private keys and files¶
Some mail clients honour the undocumented attach or attachment
parameters of a mailto: URI and add the named local files to the message
being composed. Müller et al. showed in 2020 that a web page, PDF or RSS item
can open such a link addressed to the attacker and attach the GnuPG secret
keyring, SSH keys or wallets, hidden among innocuous attachments; Thunderbird
expanded wildcards, KMail and Evolution attached whole directories,
Thunderbird could attach (and decrypt) messages from the user’s IMAP store by
imap:// URL, and IBM Notes fetched files from network shares, leaking the
user’s NTLM hash merely by opening the composer [muller2020]. Apart from the
NTLM case the victim has to send the pre-filled message, or the attacker must
read the auto-saved draft. The findings were assigned CVE-2020-4089,
CVE-2020-11879, CVE-2020-12618 and CVE-2020-12619, among others. The fix is to
drop support for attachment parameters and to restrict mailto: to
recipients and subject. When Veit et al. re-tested seven clients in November
2022, the technique worked in none of them [veit2024].
Pepsi: Not applicable. Impact: none.
Pepsi is a server and contains no mail composer that interprets mailto:
URIs. Its own generated mail (secure-link notices, list confirmations,
automatic replies) contains https: and taler: links but no mailto:
link with attachment parameters, and no by-mail command surface
(pepsi-stage-edit-settings, the key and wallet commands, list commands)
reads a file named in a message. The weakness concerns the user’s own mail
client.
96.6.7.9. Recipient verification discloses file existence¶
The qmail-verify patch that Debian shipped with qmail checks recipients
against files in users’ home directories while running as root and without
dropping privileges. Its answer therefore reveals whether a path exists, and a
local user can probe for files and directories anywhere on the system,
including in directories they cannot read. Qualys reported it in 2020 as
CVE-2020-3812, together with a verification bypass (CVE-2020-3811); both were
fixed in an updated qmail-verify that checks files with the user’s own
credentials [qualys2020c].
Pepsi: Addressed. Impact: none.
Pepsi’s recipient check (pepsi-recipients, used by pepsi-ingress under
VERIFY_RECIPIENTS) runs unprivileged in the ingress process and decides
from the passwd database, the alias and list maps and the configured stages,
not by testing paths in home directories. The components that do touch a
user’s files are the setuid-root helpers pepsi-helper-maildir-writer and
pepsi-helper-dot-forward. Both drop fully and irreversibly to the target
user (real, effective and saved ids, supplementary groups first) before they
look at ~/Maildir or ~/.forward, so whatever they report is what that
user could have learnt anyway. Both are also mode 4750 and executable only
by their stage’s group, so an ordinary local user cannot run them at all
(The privilege split). pepsi-whitelist scans mailboxes through
pepsi-helper-mailbox-scan, which runs with all three uids set to the
invoking user. What VERIFY_RECIPIENTS does disclose to remote clients is
which addresses exist, the ordinary property of any MTA that refuses unknown
users; it is discussed under Portals and APIs disclosing user data or key material without auth.
96.6.8. Misleading display and user decisions¶
Indicators and displays that mislead, and decisions a user cannot be expected to get right.
96.6.8.1. Missing or misleading indicators for forged or external sender mail¶
A provider knows whether a message was submitted by one of its authenticated
users or arrived from the internet with a forged sender, but most interfaces do
not tell the reader. Garfinkel et al. noted in 2005 that Gmail showed a message
from outside carrying an @gmail.com From: exactly like one from an
authenticated Gmail user, whereas AOL marked external mail “Sent from the
Internet”; they recommended that such “walled gardens” mark internal mail
[garfinkel2005a]. Hu and Wang’s end-to-end measurement of 35 providers (2018)
found that once forged mail is delivered, only 9 providers showed any warning
(6 on the web, 4 consistently in mobile apps) and none of the third-party
clients tested did. Worse, 25 providers automatically showed the spoofed
contact’s profile photo, name card or conversation history, and one displayed
a green “trusted address” mark on a forged address. In their user study a
warning reduced the click rate on a spoofed phishing mail only from 48.9% to
37.2% [hu2018]. After the report Gmail added a warning banner and stopped
loading profile photos for unverified mail in its new mobile app.
The attacker needs only the ability to send mail, plus a target domain without an enforced DMARC policy or a receiver that does not enforce it (see Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment)). The recommended fixes are consistent warnings on every client, no contact enrichment for unverified senders, and marking mail that comes from outside the organisation.
Pepsi: Partly addressed. Impact: low.
Pepsi authenticates inbound mail but, by design, records rather than enforces
the result (A remote sender). pepsi-ingress writes an honest
Authentication-Results field and deletes any inbound field that claims its
own authserv-id (RFC 8601 section 5, pepsi-common/src/auth.rs), so a
client or filter that reads that field gets a trustworthy verdict. The reader
is also shown the verdict where it matters. Ingress marks four cases with an
X-Pepsi-Warning value:
a message from an unauthenticated session whose
From:is at a served domain with no DMARC pass, aligned DKIM pass or aligned SPF pass behind it (served-domain-not-authenticated);a message whose DMARC
failwas recorded but not acted on (DMARC_ENFORCEoff, orp=none;dmarc-fail-not-enforced);a
From:that cannot be read one way only (from-ambiguous);an unauthenticated
Sender:at a served domain (served-sender-not-authenticated).
Each of these puts [external] at the front of the Subject
(pepsi-ingress/src/external.rs, Mail from outside that claims to be ours is marked,
What a security indicator means): the walled-garden marker that Garfinkel et al. asked for,
applied to the mail that claims to be inside. The tag gets the same
anti-forgery treatment as the crypto tags: rendered copies are removed from
every inbound subject first (pepsi_common::indicator::strip_own_tags), and a
message without a subject gets one. state.auth.warnings carries the values
for Sieve rules and client plug-ins. The display-name marker
(Sender display deception: display names, look-alikes, RTLO and truncation) and the [verified] tag of
pepsi-stage-decrypt remain separate indicators with their own meanings.
What remains is what a tag cannot do: Hu and Wang measured that a warning
reduced clicks on a spoofed message by a quarter, not to zero, and a subject
tag is in-band by construction (Inconsistent, missing or opt-in e-mail security indicators).
A correspondent’s own domain earns no subject tag whatever its results. A
From: domain that renders like a served domain (the same UTS #39 skeleton,
pepsi_common::lookalike) gets only the header mark X-Pepsi-Warning:
from-domain-resembles-served-domain, which a reader sees only through a filter
or the client extensions, and a look-alike of any other organisation’s domain is
not caught here (Look-alike and IDN homograph domains, confusable characters and alias addresses).
Operators who want refusal rather than marking publish p=reject once their
DMARC reports are clean and set DMARC_ENFORCE = yes (the wizard’s default;
the code’s is no), listing the forwarders that they trust in
ARC_TRUSTED_SEALERS. Contact enrichment is the mail client’s business.
96.6.8.2. Inconsistent, missing or opt-in e-mail security indicators¶
Mail clients signal protection through padlocks, seals, check marks and colours that differ from client to client and are hard to interpret. Lausch et al. surveyed eight clients in 2017: almost all use a padlock for encryption, signatures get unrelated symbols, combined states become confusing, and Apple Mail, iOS Mail, Outlook and Thunderbird show nothing at all for a message that is neither encrypted nor signed. There is no established indicator for a corrupted message, and 12.2% of their participants associated the open (“not encrypted”) padlock with security. They proposed three states only: postcard, closed envelope, torn envelope [lausch2017]. Tolsdorf and Lo Iacono summarise the usable-security literature: users rarely notice the absence of a positive indicator, indicators placed in the message area can be imitated by the content, passive warnings are ignored, the meaning of signature errors is unclear even to experts, and protection that must be switched on is forgotten by 10% to 100% of study participants. They propose changing how a message is rendered according to its security level instead of adding icons [tolsdorf2020].
Moecke and Volkamer observed in 2013 that Gmail gave no visible indication of whether SPF or DKIM had authenticated a message, that both rest on DNS records fetched without authentication and vouch only for the provider, and that opportunistic encryption learns keys from received mail without verifying them [moecke2013]. Ferreira and Anacleto’s 2017 review of ten secure-mail tools found protection offered as an extra opt-in path, no feedback about the risk of sending unprotected, tools that protect a message only if security was switched on before writing (so drafts reach the webmail provider in clear), and opaque or jargon-laden status [ferreira2017]. The consequence in all cases is that an attacker who strips or breaks the protection of a message is less likely to be noticed, and users send protected-looking mail in clear.
Pepsi: Partly addressed. Impact: low.
Pepsi cannot change how a mail client draws its indicators; it can only decide
what it writes into the message. pepsi-stage-decrypt writes its tags at
the front of the Subject and a machine-readable X-Pepsi-Crypto summary,
and their meaning is defined exactly (What a security indicator means): [decrypted]
says nothing about the sender, [verified: <address>] requires a signature
over the plaintext by an anchored key and names the address to which it is bound, and
a signature inside a ciphertext that falls short of that earns [unverified
signer] or [bad signature]. pepsi-ingress adds [external] to mail
from outside that claims a served domain without authenticating it
(Missing or misleading indicators for forged or external sender mail).
Because Pepsi applies protection at the server, the user’s client needs no
setup and the user makes no per-message opt-in decision for keys that exist;
an author can raise protection with a [secure] subject keyword or the
Outlook add-in (pepsi-stage-encrypt). Authentication-Results
carries the SPF, DKIM and DMARC verdicts.
For cleartext signatures the indicator scheme is the one that the studies
criticise. It is positive only there: unprotected mail carries no mark, a bad
cleartext signature is silent by default (TAG_BAD_SIGNATURE is empty and
ON_BAD_SIGNATURE = record, see
Invalid, expired or old signatures reported as valid), a valid-untrusted cleartext
signature looks like no signature, and the tags sit in a field that the sender writes
(Forged security tags in the Subject bypass gateway sanitisation). Whether the user notices the tag’s
absence is up to them. Operators can set TAG_BAD_SIGNATURE or
ON_BAD_SIGNATURE = quarantine; a negative tag for unprotected mail would
mark nearly all mail and soon be ignored. Outlook and Thunderbird users have
a trustworthy display: the Outlook add-in’s read pane and the Thunderbird
extension render X-Pepsi-Crypto outside the message area, with a neutral
state for mail about which the gateway said nothing (Mail client extensions,
Security status spoofed in-band in message body or headers); other clients still have only the
tags. Unauthenticated key learning is assessed under
Keys and certificates imported or trusted without verification.
96.6.8.4. Security status spoofed in-band in message body or headers¶
When the verification result is shown inside or next to the message content, the sender can draw it too. Müller et al. reproduced the “valid signature” display of five OpenPGP and four S/MIME clients with HTML, CSS and inline images in unsigned mail; where a plug-in injects HTML into the body (Roundcube), the genuine snippet can simply be copied [muller2019]. Ghanta and Gottipati’s review lists such inadequate verification feedback among the recurring weaknesses of both OpenPGP and S/MIME clients [ghanta2025]. In the German healthcare KIM service, the T-Systems client module appended the signature result as a plain footer to the body while HTML with CSS was allowed, so any KIM participant could hide the genuine “verification failed” footer and append a fake “signature verified” one. The module also skipped the specified comparison of inner and outer sender, so anyone could appear correctly signed by anyone; gematik’s hotfix required discarding messages with invalid signatures and checking the envelope sender [saatjohann2024]. FriendlyMail’s protected messages carried a footer with an install link that an attacker can imitate to push a malicious “update” [pirouz2014]. RFC 9787 generalises the point for gateways and proxies: a proxy that reports cryptographic status in an added header field must remove any such field arriving from outside, the user cannot otherwise tell what protection a message has, and a proxy not under the user’s control turns end-to-end protection into transport protection [rfc9787].
The fix is to show status only in user-interface areas that message content cannot reach, to remove inbound copies of any status header a component adds, and to discard or clearly reject mail that fails verification rather than annotating it inline.
Pepsi: Addressed. Impact: low.
Pepsi adds no footer or banner to the body. Its machine-readable status, the
X-Pepsi-Crypto field, is believable because every X-Pepsi-* field that
arrived from outside is stripped on every path of pepsi-stage-decrypt, and
ingress deletes inbound Authentication-Results fields that claim its
authserv-id. This is exactly RFC 9787’s requirement for a proxy
(What a security indicator means). Ingress removes a sender’s own X-Pepsi-Warning, and
the decrypt stage keeps only the warning that ingress itself added. The signer
is bound to the From: address (the check that the KIM module skipped), and
ISOLATE_SIGNED drops unsigned content beside a signed entity, so a genuine
[verified] cannot be borrowed by attacker text. That Pepsi is itself a
gateway holding keys, which RFC 9787 warns about, is an explicit custody choice
(Gateway custody (custody = local, the MTA key)).
The display the fix asks for exists for two clients: the Outlook add-in’s
read pane and the Thunderbird extension (Mail client extensions) read
X-Pepsi-Crypto and X-Pepsi-Warning inside the client and render the
verdict in a task pane or a toolbar button and popup, where the message
content cannot draw; valid-untrusted is shown as unsigned mail with an
explanation, an absent field as a neutral “no gateway verdict”, and a
message with more than one field as inconsistent. One parser serves both and
is held to the decrypt stage’s vocabulary by make check. The subject tag
stays in-band for every other client (Forged security tags in the Subject bypass gateway sanitisation),
and there a body can still contain a fake “verified” banner; mail with an
invalid cleartext signature is delivered by default (ON_BAD_SIGNATURE =
record) and looks like unsigned mail to a client without the extension (an
invalid signature inside a ciphertext is tagged [bad signature]). The field
is trustworthy only on mail that passed a decrypt stage, so the extensions are
for mailboxes that receive the managed domains only through Pepsi. The
secure-link notification is a fixed, recognisable template that an attacker can
imitate with a link to a look-alike portal; since the portal has no accounts,
such a page can harvest a PIN, which is useless without the real token, but it
also accustoms recipients to following links in mail. An operator who
configures NOTICE_SIGNER on a pepsi-stage-encrypt instance has that
notification and Pepsi’s other notices signed by a deployment identity, so a
client that checks signatures tells the genuine one from the imitation; it is
not configured by default. The KIM hotfix maps to
ON_BAD_SIGNATURE = quarantine and DMARC_ENFORCE = yes (the wizard’s
choice for a new installation), which cost legitimate mail broken by lists and
forwarders not named in ARC_TRUSTED_SEALERS.
96.6.8.5. Clients silently send mail unencrypted¶
The user means to send encrypted mail, and the system sends it in clear without saying so. Orman’s book on encrypted mail recalls an iOS mail client that encrypted the text part but not the attachments, and systems that forward decrypted mail unencrypted when the new recipient’s key is unknown; clients generally give no error when a message could not be encrypted [orman2015]. In usability studies, the open padlock and a dismissible warning on iOS Mail led two of eleven participants to send unencrypted, one believing the open lock meant encrypted [schiller2022]. Thunderbird gave students no clear indication whether an outgoing message had actually been encrypted, and key-import failures pushed them towards cleartext [huq2025]. With Mailvelope one participant typed the sensitive data next to the PGP block, outside the encrypted part [ruoti2015]. Google warns that enabling hosted S/MIME in Workspace can take up to 24 hours to propagate, and messages sent meanwhile are not encrypted [google2026].
The result is a loss of confidentiality of exactly the content that the user wanted to protect, without the user finding out. The recommended fixes are to refuse or ask before sending a message that was meant to be protected but cannot be, to protect whole messages including attachments, and to confirm protection visibly.
Pepsi: Partly addressed. Impact: low.
pepsi-stage-encrypt protects whole messages (PGP/MIME or CMS over the
entire MIME tree, no inline mode), so attachments cannot be left out, and the
user’s client needs no setup or key import. Its policy on a missing key is
explicit (ON_NO_KEY, pepsi-stage-encrypt): under
ENCRYPT = required a message goes to the secure-link portal or bounces and
never degrades to cleartext. A message can raise the policy to required
itself, with a [secure]/[encrypt] subject keyword or the Outlook
add-in’s X-Pepsi-Encrypt; such a message never falls back to cleartext even
when an operator set ON_NO_KEY = cleartext. ON_OVERSIZE defaults the same
way, so a large attachment does not turn required into cleartext. A key lookup
that fails in the DNS is not read as “no key” either: where opportunistic
encryption would send in clear, the stage defers the recipient or routes it to
the secure-link stage, unless the sender accepts cleartext with [clear-ok] or
CLEAR_ON_DNS_FAILURE (A key lookup that fails in the DNS). On the
transport hop the same holds for a recipient domain that publishes DANE: both
relay stages default to DANE = strict, so a TLSA
mismatch or a stripped STARTTLS defers the message instead of letting it
leave over an unauthenticated or cleartext connection without anyone noticing
(Opportunistic STARTTLS can be stripped by an active attacker).
The shipped default is ENCRYPT = opportunistic, and under it a recipient
without a usable key gets cleartext; the copy in the author’s Sent folder was
made by their client before the gateway acted, so nothing there shows what left
the server. [stage-encrypt] NOTIFY_CLEARTEXT = author (off by default, set
by the operator or per address in pepsi.settings) closes that gap: the
author of a locally submitted message receives one notice per copy that left
unencrypted, naming its recipients and the reason, and the keyless recipients
of a message travel together on one row so that they share one notice. A
subject may start with a near miss of a request keyword: misspelt, with a
look-alike letter, or [encrypted] where [encrypt] is configured. By
default, such a message is answered with a warning that names the keyword that
it resembled (compared by skeleton, as the security tags are); a keyword
translated into another language is not recognised. An edit to pepsi.conf reaches the pipeline
within seconds: pepsi-dispatch watches the file’s modification time,
re-reads it and retires its workers, as it does for the database overlay. With
the notice off, an author who believes “the server encrypts” is still not told;
operators who want no cleartext at all set ENCRYPT = required with a
secure-link stage, globally or per address, at the cost of portal links for
every keyless correspondent. The levers exist; using them is for operators and
users, and nothing further is left for Pepsi’s code.
96.6.8.6. Link-target deception (mismatched text, fake tooltips, homographs)¶
HTML mail lets the sender make the visible link differ from its target. Veit
et al.’s systematic review and client test (November 2022, seven clients)
found that every desktop and webmail client allowed fake CSS tooltips (Apple
Mail on macOS showed the fake one first), and that an HTML base element
can make the hover show only the relative part. Form buttons hide their action
URL, userinfo before @ and hex-encoded, homographic or overlong host names
obscure the domain, and UTF-8 homograph spoofing worked in all but one client.
Mobile clients have no hover, and a long press on iOS already loads the page.
Ropemaker, which uses remote CSS to swap a link after the user has checked it,
worked in clients that load remote content. 41.3% of the link cases were rated highly
susceptible, and only Thunderbird warned on a text/target mismatch
[veit2024]. The authors’ follow-up catalogue adds percent-encoded URLs,
misleading suffixes, shorteners and open redirects, QR codes, and tel:,
data: and custom-scheme deep links [veit2026]. The user follows a link
believing it legitimate. Proposed fixes are to compare link text, title and
form action with the real target and warn, to show punycode and highlight the
registered domain, to restrict CSS and to block remote content by default.
Pepsi: Addressed. Impact: none.
Displaying links is the mail client’s job, and Pepsi delivers mail to the
user’s mailbox without rewriting links. Pepsi itself shows message content in
two places, the secure-link portal and the list archive, and both render text
only: pepsi-secure-link/src/view.rs folds HTML to text and escapes it,
nothing becomes a hyperlink, no remote content is loaded (img-src 'none'),
and HTML parts are offered only as application/octet-stream downloads
(The secure-link fallback portal). So there is no anchor whose text could disagree with its
target and no tooltip to fake. The links Pepsi writes into its own mail
(portal notices, confirmations) point to the configured BASE_URL and are
shown in full next to the button. Look-alike domains and sender display
deception are assessed under Look-alike and IDN homograph domains, confusable characters and alias addresses and
Sender display deception: display names, look-alikes, RTLO and truncation.
96.6.8.7. Attachment type deception (double extensions, padding, RTLO)¶
An attachment’s file name can hide its type: double extensions such as
invoice.pdf.exe, padding with spaces or very long names that the client
truncates before the real extension, unknown extensions, and the Unicode
right-to-left override, which reverses the end of the name so an executable
displays as ...exe.pdf. In Veit et al.’s 2022 client test only 12.5% of the
attachment cases were rated highly susceptible: most clients showed a type
icon, warned or blocked the override, while Canary hid the end of a long name
and showed no icon [veit2024]. Many clients still do not make bidirectional
control characters visible [veit2026]. The user opens an executable believing
it to be a document. The fix is to always show the real final extension and a
type icon derived from it, and to neutralise bidirectional controls.
Pepsi: Addressed. Impact: low.
Mail delivered to a mailbox is displayed by the user’s client. Pepsi shows
attachment names itself in two places: the secure-link portal and the list
archive (plus the attachment placeholders of list digests). Both serve every
part as a download with Content-Disposition: attachment (the portal
additionally as application/octet-stream), never inline, and both clean the
name: path syntax, quotes and control characters are removed (safe_name in
pepsi-secure-link/src/view.rs, sanitise in
pepsi-archive/src/attach.rs). The cleaning also removes
the right-to-left override and the other bidirectional format characters
(Unicode category Cf, pepsi_common::filename::is_bidi_control), which a
char::is_control filter would pass, and a name over the length limit is
cut in the stem so that its final extension (up to 16 characters) survives
(filename::truncate_keeping_extension), so neither a reversed extension nor
padding can make report.pdf<spaces>.exe look like a PDF in the display or the
saved name. The portal still shows the sender-declared media type next to the
name rather than one derived from the extension, which is information, not a
decision that Pepsi takes. What remains is in the user’s mail client, which renders
the attachments of delivered mail.
96.6.8.8. Content imitating client UI and local resource inclusion on reply¶
Message content can break the visual boundary between the message and the
client. Veit et al.’s 2026 catalogue lists HTML and CSS that imitate a client
password prompt or other controls, and references to guessable local file paths
that display the victim’s own images for intimidation. It also describes a
technique that is new in that work: clients that resolve file: references
when replying or forwarding embed the local file in the outgoing message, so an attacker who provokes a
reply receives the file [veit2026]. Preconditions are a client that
renders such HTML or resolves local resources on reply, and a victim who
replies; the gains are credentials and local files. No countermeasures are
given; the obvious ones are strict isolation of content from client chrome and
never resolving local resources.
Pepsi: Addressed. Impact: none.
Pepsi has no mail client. Its only reading interfaces are the secure-link
portal and the list archive, and both render message content as escaped text,
never HTML, under a Content Security Policy that allows no script and no
remote content (The secure-link fallback portal, pepsi-httpd). A message cannot draw
a fake prompt there, and there is nothing to resolve a file: reference. A
portal reply is composed in a plain form, and files reach it only through the
browser’s own upload control, chosen by the user. Mail delivered to a mailbox
is displayed by the user’s client, which is where this weakness lives.
96.6.8.9. Portal passwords sent over the same unprotected channel¶
Encryption to outside recipients by a shared password, as in depot or portal systems, leaves the key exchange to the users, and they use the channel they already have: e-mail. In Ruoti et al.’s paired-novice study of Tutanota, 17 of 25 pairs sent the password in clear by e-mail and about half chose passwords weak enough for quick offline guessing; with Virtru one participant typed the sensitive data into the unencrypted greeting field [ruoti2015a]. The replication in the journal version found the password mailed in clear far less often (two pairs, 7%), and the authors suggested a depot that cannot communicate with outside parties at all [ruoti2019a]. Anyone who can read the recipient’s mailbox or the mail in transit then reads the protected message as well. The recommended fixes are to generate strong secrets automatically, to deliver them by a second channel, and to explain to both parties why.
Pepsi: Partly addressed. Impact: medium.
Pepsi’s secure-link portal is built around this failure (The secure-link fallback portal).
The PIN is generated by the server (default ten characters from a 31-symbol
alphabet, minimum ten, PIN_LENGTH), never chosen by the user, and it is
stretched with Argon2id together with a pepper outside the database, so it
cannot be guessed offline from a stolen database. It is never put in the
recipient’s notification. By default (PIN_DELIVERY = sender) it is mailed
to the sender, whose notice says plainly that it must be passed on by
telephone, text message or in person and that mailing it to the same mailbox
would undo the protection; the recipient’s notice says the PIN will never
arrive by e-mail. PIN_DELIVERY = command hands the PIN to an SMS or other
gateway, so no human relays it.
Under the default the second channel still depends on the sender, who can
forward the PIN mail to the recipient, and then the recipient’s mailbox (and
the transport) is again the only factor; the deployment cannot tell. An
operator who sets PIN_DELIVERY = none puts the PIN in the link itself and
makes this the configured behaviour. PIN_DELIVERY = command removes the
human step, at the cost of an SMS gateway and recipient phone numbers. Pepsi
could make the mistake harder by refusing, at submission, a message from the
sender to the recipient that contains the PIN, or by asking the recipient for a
second factor established out of band.
96.7. End-to-end encryption and keys¶
OpenPGP and S/MIME as used for e-mail, X.509 certificate validation and the PKI, and the distribution and trust of keys.
96.7.1. Implementation defects¶
Memory safety, injection, parser differentials and logic errors in a particular implementation.
96.7.1.1. OpenPGP cleartext and detached signature parsing lets unsigned text pass¶
The OpenPGP Cleartext Signature Framework (CSF) puts the signed text, a set of
armor header lines and the signature into one plain-text body, with no boundary
that a reader can see. The verifier checks only the dash-escaped text between the
BEGIN PGP SIGNED MESSAGE marker and the signature; text before or after the
block, and the Key: value armor header lines after the marker, are not
covered, yet a reader sees all of it next to a “good signature” result. The gpg
manual itself warns that gpg verifies only the cleartext-signed data and
not extra data outside it or the header lines after the dash marker, and
recommends detached signatures, --output to obtain the really signed data,
and --assert-signer [gnupg2024]. A sender who holds one genuine
clearsigned message of the victim can therefore add text around the block or in
its header lines and have it displayed under the victim’s verdict. Any old
public post will do, as signature freshness is not part of the scheme.
Groves and Wachter’s gpg.fail disclosure (2025) showed that the parsing around
the framework is fragile in GnuPG itself [groves2025b]: the cleartext was
truncated before hashing, so text not covered by the hash appeared inside a
validly signed block; the NotDashEscaped armor header allowed outright
cleartext signature forgery, as did a second, separate cleartext flaw; Radix64
line truncation produced polyglots that GnuPG and other parsers (such as a mail
client) read differently; detached-signature verification admitted a “multiple
plaintext” attack; and the authors describe the framework itself as susceptible
to format confusion. The landing page gives only the titles; fixes were
announced as forthcoming. The MIME-level counterpart belongs to the same class
(Signature spoofing via partial signing and MIME/CMS wrapping): a multipart/signed part beside an
unsigned sibling in multipart/mixed or multipart/alternative.
Pepsi: Addressed. Impact: low.
Pepsi does not run gpg; it verifies with sequoia-openpgp 2.4.2
(pepsi_crypto::pgp::verify). Its armor reader has no NotDashEscaped
mode and reads whole lines without truncation, and its detached verifier refuses
anything but signature and marker packets. The GnuPG-specific bugs are
therefore not in its path, and Pepsi never emits cleartext signatures
(pepsi-crypto writes PGP/MIME only). Text around the block is removed by [stage-decrypt]
ISOLATE_SIGNED (default yes): before anything is verified,
pepsi_crypto::mime::isolate drops text before and after a clearsigned block,
re-emits a block found inside other HTML as a text/plain part holding only
the armor, and drops unsigned siblings of a signed part; a second signed unit
kept beside the first is classified but not evaluated, which signature_of
reads as unverifiable, so it cannot ride on the first one’s verdict (see
“Protected content stands alone” in Security model and What a security indicator means).
Inside the block, the verified text is delivered as it arrived, so that the
reader’s own client can re-verify it, and the verdict says what else the reader
sees. Sequoia accepts any Key: value line between the marker and the
signed text as an unsigned armor header; pgp::verify records any such line
other than Hash: on the layer (LayerDetail::unsigned_surface =
armor-headers), and a block that is the body of a text/html part, which
counts as standing alone and is rendered as markup, is recorded the same way
(html). pepsi-stage-decrypt reports either as partial rather than
valid: no [verified] tag, no state.signature_verified, the reason
in X-Pepsi-Crypto (unsigned-surface=). A line such as Note: pay
invoice 4711 to ... placed by whoever re-sends an old genuine clearsigned post
therefore arrives under no verdict at all, while a block with the one header
the framework defines stays valid. [pepsi] CRYPTO_INLINE_PGP = reject
still removes the surface together with all inline PGP, and ISOLATE_SIGNED =
no brings back the surrounding-text and MIME variants.
Two things remain. Nobody has tested whether sequoia’s own end-of-text
heuristic and find_armor’s markers can be made to disagree on where a block
ends; running the gpg.fail proofs of concept through pepsi_crypto::verify,
and a differential fuzzer of payload against the bytes between the markers,
would settle it. And a legitimate signer who writes a Comment: header into a
clearsigned block loses the tag, which is the cost of not parsing the header
lines for intent.
96.7.1.2. GnuPG status-line and output injection fools front ends¶
GnuPG reports its results to front ends through an in-band text interface, and
message content can reach that channel. A literal data packet carries an
“original file name” field of up to 255 bytes that the author chooses. With the
verbose option, GnuPG printed this field to stderr without escaping newlines.
Front ends that read status lines and log lines from one pipe (--status-fd
2) and split them by prefix then accepted complete forged GOODSIG, VALIDSIG, TRUST_FULLY
and DECRYPTION_OKAY lines, so a bare literal packet with no signature and no
encryption appeared signed by any key and encrypted. Brinkmann disclosed this
“SigSpoof” flaw in 2018 (CVE-2018-12020, GnuPG 0.2.2 to 2.2.7; Enigmail up to
2.0.6.1, GPGTools up to 2018.2, python-gnupg up to 0.4.2) [brinkmann2018], and
Müller et al. found it together with Enigmail’s own parsing flaws – unanchored
regular expressions and confused results for several signatures, which let a
crafted User ID inject a fake VALIDSIG (CVE-2018-12019) [muller2019]. On a
terminal, newlines and ANSI escapes in the file name made plain gpg
output look like a good signature. The general form, that GnuPG’s output does
not separate its own verification result from message content, was listed again
by gpg.fail in 2025 [groves2025b].
Fixes: GnuPG 2.2.8 and 1.4.23 escape the file name; Enigmail 2.0.7, GPGTools
2018.3 and python-gnupg 0.4.3 were fixed. Front ends should pass
--no-verbose, use a status descriptor separate from the log, anchor all
patterns and track several signatures via NEWSIG.
Pepsi: Partly addressed. Impact: low.
Pepsi neither runs gpg/gpgsm nor parses a text status channel: OpenPGP
and S/MIME results are typed values (sequoia’s VerificationHelper mapped in
pepsi_crypto::pgp::Helper, Pepsi’s own CMS code), carried as Rust enums
(Verdict, Failure) and JSON in state.crypto. The literal-data file
name is never read. The one in-band channel that Pepsi itself writes is the
X-Pepsi-Crypto header. pepsi-stage-decrypt’s report module builds it
from a fixed vocabulary, passes every value taken from the message through
header::sanitise_value (which replaces CR, LF, NUL and control characters)
and quotes it, so a hostile User ID cannot add a field or a
signature=valid pair; the stage strips the whole inbound X-Pepsi-*
namespace first, even when it is otherwise disabled. Stage bodies never write to
stdout, the worker protocol channel. This removes the vulnerability class from
Pepsi’s own processing.
What remains is the indicator for humans, which lives in fields that the
sender writes. STRIP_SUBJECT_TAGS (default yes) runs
pepsi_common::indicator::strip_forged_tags on the decoded subject, folding
look-alikes (Unicode’s UTS #39 confusables table) and removing bracketed
security words, check marks and bidi controls at its front
(What a security indicator means); a signed part’s protected Subject: that carries
such a tag cannot be cleaned without breaking the signature, so the stage
withholds valid instead (Header fields not protected by signature or encryption). But a tag-like string in the
middle of the subject, the display name, or a fake “signature verified” banner
in the body still reaches the user, and a deployment that does not run the
decrypt stage leaves a forged X-Pepsi-Crypto in place (where no Pepsi
indicator is expected either). Exploitation needs a client that renders such
text prominently and a user who believes it. The answer is an indicator
outside sender-controlled content: the Outlook add-in’s read pane and the
Thunderbird extension (Mail client extensions) read X-Pepsi-Crypto
and X-Pepsi-Warning inside the client and render the verdict where the
message cannot reach it, reporting a message with more than one field as
inconsistent; a reader on any other client still sees only the in-band tags.
96.7.1.3. X.509 name parsing confusion (NUL bytes, multiple CNs, string types)¶
A certificate binds a key to names, and the binding is only as good as the
agreement between the parser that validated the name (the CA) and the parser
that relies on it (the client). Kaminsky, Patterson and Sassaman showed in 2009
that they disagree in many ways [kaminsky2010]: with several Common Names in
one subject OpenSSL took the first, CryptoAPI accepted all and NSS used the
last; non-minimal encodings of the CN object identifier were still recognised
by CryptoAPI but ignored by CAs; and an embedded NUL made CryptoAPI and NSS stop
reading, so bank.example<NUL>.attacker.example, validated by the CA for the
attacker’s domain, was read as the bank’s name. Clark and van Oorschot list the
NUL and OID tricks among certificate parsing flaws that let any certificate
holder impersonate any server [clark2013], and the same flaw hit sendmail’s
STARTTLS (before 8.14.4, CVE-2009-4565): a man in the middle could impersonate
SMTP servers, and a client could bypass access rules based on its certificate’s
name [cve-2009-4565].
Recent measurements show the area is still unsettled. Sun et al. tested 23
libraries and found 119 deviations [sun2025]: phpseclib matched names as
regular expressions, OpenSSL suffix-matched after a leading dot and decoded
teletexString as Unicode, wolfSSL mis-handled wildcards, 11 libraries applied
wildcards to the CN, and Node.js before 18 consulted the CN despite a SAN; no
library implements RFC 5280’s stringprep comparison for name chaining, 12 match
different string types and axTLS truncates at NUL, though each chain link is
still signature-checked. Zhang et al. linted 34.8 million internationalised
certificates and tested 9 parsers [zhang2025b]: all deviated (Forge decodes
UTF8String as ISO-8859-1, GnuTLS nearly everything as UTF-8, pyOpenSSL takes the
first duplicated CN and Go the last), unescaped output lets a.com DNS:b.com
read as two names, and CT monitors, Snort, Zeek and Suricata pick different
names or miss Unicode variants. Exploitation needs a CA that issues the crafted
name; fixes are strict, length-delimited, type-aware decoding, rejection of
ambiguous names, and keeping parsed names structured rather than as strings.
Pepsi: Addressed. Impact: none.
Where TLS names matter, Pepsi uses rustls with rustls-webpki: the relay stages
check the server name with verify_is_valid_for_subject_name (also in the
DANE verifier, pepsi-common::smtp::dane), which matches SAN dNSName
entries only, never the CN, after strict DNS-name parsing. MTA-STS mx
patterns are matched by Pepsi’s own mta_sts::mx_covers, which allows a
wildcard in the leading label only, as RFC 8461 requires. Ingress’s client
certificate authentication (pepsi-ingress/src/smtp/clientcert.rs) is the
one TLS path where Pepsi reads names from a certificate, and it is the sendmail
access-control case: a pinned client key (TLS_AUTH_CLIENT) authenticates
whatever SENDER_MAP binds the pin to and the certificate around it is not
consulted, while a leaf issued by a TLS_AUTH_CLIENT_CA anchor is confined to
the mailboxes it names. Those names are read through the same strict decoder
and rule as S/MIME signers (pepsi_crypto::smime::CertFacts): only a bare
addr-spec in an rfc822Name or the subject’s emailAddress counts, a
certificate whose only names are malformed authenticates nobody, and an
embedded NUL cannot shorten a Rust string. For S/MIME, pepsi_crypto::smime
parses certificates with the strict DER decoder of the RustCrypto
der/x509-cert crates and binds the signer to the From: address
through rfc822Name SANs, falling back to the
PKCS#9 emailAddress subject attribute only when there is no SAN; names are
Rust strings compared over their full length, so an embedded NUL cannot
truncate a name, and the CN is never used. Path building
(pepsi_crypto::trust) chains issuer to subject by comparing RFC 4514 string
forms, so names in different string types match (lenient, but every link’s
signature is verified).
A certificate is bound by trust::bind_certificate, which normalises only the
message side. A certificate value such as attacker@a.test <victim@b.test> is
not a valid rfc822Name, but Zhang et al. show that CAs issue such names.
Such a value is never read as the victim’s address: only a bare addr-spec counts
as a declared address (is_bare_mailbox), and a certificate whose only names are malformed binds as
Mismatched, never as the address inside them. Internationalised addresses
(RFC 9598 SmtpUTF8Mailbox otherName entries) are read into a separate
list and compared as that RFC says: the local part octet for octet, and the
domain as lower-case A-labels (smime::utf8_mailbox_comparison_form). A value
that is not local@domain counts as malformed. The emailAddress fallback
reads an IA5String, as PKCS#9 specifies, and a UTF8String only when its content
is ASCII; such a value has the same octets as an IA5String that a CA tagged
wrongly, and it is read identically. A non-ASCII
UTF8String there is a mailbox outside SmtpUTF8Mailbox, the one form whose
comparison is defined, so it is recorded as malformed and the certificate binds as
Mismatched. A certificate that names no mailbox at all is handled under
Weak binding between signer certificate or key and the From address.
96.7.1.4. Lenient and divergent X.509/DER parsing of certificates¶
X.509 certificates are DER-encoded ASN.1 whose recognition needs a
context-sensitive parser: length fields must match their contents, the inner
and outer signature algorithm identifiers must be equal, whether a certificate
is self-signed depends on comparing arbitrarily long names, and BIT STRING and
OCTET STRING containers hold further structures that admit two readings.
Barenghi, Mainardi and Pelosi argue that this is why every library parses by
hand and why parsers disagree, and propose a regular replacement format with a
generated linear-time parser (not deployed) [barenghi2017]. The disagreement
is measurable. Tatschner et al. fed 186.6 million real certificates to six
parsers [tatschner2024]: Mbed TLS and wolfSSL rejected about 13% while
OpenSSL rejected 0.003%, GnuTLS and OpenSSL accepted invalid version numbers,
only Go rejected malformed URIs and IP addresses, handling of invalid RSA
exponents and ECDSA parameters differed, and a wolfSSL build regressed between
5.5.4 and 5.7.0. Orlando, Barenghi and Pelosi checked 30.15 million certificates
against eight libraries in 2024 [barenghi2021]: 4.39 million were rejected by
at least one library, with little agreement between libraries on which, and
48% of 8.85 million chainless device and internal-CA leaves had syntax errors,
including the security-relevant ones (key usage not allowed by the key
algorithm, keyCertSign without a CA basic constraint, duplicated
extensions). Chen et al.’s differential fuzzing found GnuTLS, NSS and OpenSSL
accepting negative and 37-octet serial numbers, which matters for revocation
lookups keyed on the serial [chen2018a].
None of these works shows a concrete exploit; the risk is that two relying parties, or a filter and an end point, reach different conclusions about the same certificate, and that a lenient parser accepts a certificate whose key-to-subject binding the issuer never meant. The recommended fixes are strict, grammar-driven parsing, consistent error categories, and narrowing the format.
Pepsi: Addressed. Impact: none.
Pepsi parses certificates with two strict DER decoders, each in one place:
rustls-webpki for the TLS server chains it verifies (outbound relays, DANE-TA
chains) and the RustCrypto der/x509-cert crates for S/MIME
(pepsi_crypto::smime), for the DANE SubjectPublicKeyInfo match and for
the client certificates pepsi-ingress validates against
TLS_AUTH_CLIENT_CA (pepsi_crypto::trust::validate).
Both reject BER, non-minimal lengths and trailing data, so a DER encoding has a
single reading and the “same bytes, two meanings” differentials of the papers
do not arise between Pepsi’s components. The semantic checks that the
measurement studies found missing are made explicitly in pepsi_crypto::trust: an issuer
must be a CA with keyCertSign and be valid at the time, every link’s
signature is verified, an unrecognised or undecodable critical extension makes
the certificate unusable (RFC 5280 section 4.2), name, policy and path-length
constraints are enforced (trust/constraints.rs, checked against NIST PKITS),
a certificate with a repeated extension, with extensions in a version 1 or 2
certificate, or with a unique identifier in a version 1 certificate is refused
as structurally defective, and x509-cert accepts only
versions 1 to 3 and serial numbers of at most 21 octets. Negative serial numbers are accepted, which is harmless because CRL
entries are matched by exact bytes. The CMS and certificate parsers are fuzzed
(fuzz/fuzz_targets/cms.rs and the mutation sweep in
pepsi-crypto/tests/sweep.rs).
What remains is the divergence inherent in the ecosystem rather than in Pepsi: a certificate that Pepsi refuses may be accepted by a recipient’s client and vice versa, which affects interoperability (an S/MIME correspondent whose malformed certificate Pepsi cannot use is sent cleartext or a secure link), not the binding Pepsi relies on. Path-validation divergences are treated under Divergent and non-compliant X.509 path validation across libraries and Missing CA and chain constraint checks (basicConstraints, pathLen, keyUsage).
96.7.1.5. OpenPGP literal-data file name enables path traversal and overwrite¶
An OpenPGP literal data packet carries a “file name” field that the sender of
an encrypted or signed message chooses. gpg --use-embedded-filename writes
the output under that name, which the gpg manual calls dangerous because it
lets a crafted message overwrite files of the user who decrypts it; the option
is off by default and --output overrides it [gnupg2024]. gpg.fail (2025)
reported that GnuPG accepted path separators and traversal sequences in the
field, so a message could make GnuPG write outside the intended directory when
the recipient let it use the embedded name; no fix was described on the
landing page [groves2025b]. The same field was the vehicle of the status-line
injection in GnuPG status-line and output injection fools front ends.
Pepsi: Not applicable. Impact: none.
Pepsi uses only the literal packet’s content: pgp::decrypt and the inline
verifier read the data stream into memory and never look at the file name, and
nothing in Pepsi writes a file under a name taken from a message –
pepsi-helper-maildir-writer generates its own Maildir file names. When
pepsi-stage-decrypt opens a separately encrypted file into an attachment,
the attachment is named after the ciphertext part’s MIME
filename with the encryption suffix removed, reduced to its last path
component and a conservative character set, never after the literal packet’s
field. On emission, pgp::encrypt_entity builds the literal packet with sequoia’s
LiteralWriter and no file name, so Pepsi’s output cannot steer a recipient’s
--use-embedded-filename either. Ciphertext that Pepsi cannot open is relayed
unchanged, as by any MTA; what the recipient’s own GnuPG does with it is
outside Pepsi.
96.7.1.6. OpenPGP packet framing ambiguities alter parsing and verification¶
Barenghi, Mainardi and Pelosi’s 2017 language-theoretic audit of RFC 4880 found two framing weaknesses in the packet format itself [barenghi2017a]. First, version 3 packets may use an “indeterminate” length that leaves the end of the packet to the application. Suppose an attacker appends a User ID packet of indeterminate length to someone’s certificate on a key server: a parser that ends this packet at the end of input then takes every packet appended later (such as new subkeys) into it without a syntax error, so those subkeys are erased or blocked. Second, the One-Pass Signature packet that precedes signed data is not itself signed, and the specification did not require its fields to match the final Signature packet; a verifier that takes its parameters from it can be steered, for example by switching the type from binary to text so that canonicalisation restores a deleted byte and modified data still verifies. Neither was exploitable in GnuPG 1.4.18/2.1.18, Symantec PGP 10.4.0 or SKS, which reject or ignore the constructs. The authors propose delimiters instead of length fields and a mandatory consistency check between the two signature packets.
Pepsi: Addressed. Impact: none.
Pepsi parses OpenPGP with sequoia-openpgp 2.4.2. For the One-Pass Signature,
sequoia selects the hash context for a signature by the Signature packet’s own
hash algorithm and type (HashingMode::for_signature), not by the one-pass
packet’s declaration, so a one-pass packet announcing a different type or
algorithm leaves no matching hash and the signature fails. PGP/MIME signatures,
which are detached, carry no one-pass packet at all. Sequoia does accept
indeterminate lengths on old-format packets, but the certificate attack needs a
key server that lets third parties append packets: Pepsi’s discovery uses WKD,
DANE, VKS (which re-serialises only verified material) and LDAP, and
pepsi_crypto::pgp refuses fetched key material containing compressed,
encrypted or literal packets. A truncated copy of a certificate would gain an attacker
nothing that sending a copy without the subkeys would not, and that question is
the subject of Keyservers accept and serve unauthenticated key material and revocations. Pepsi’s own
output uses new-format packet headers. The packet parser is fuzzed
(fuzz/fuzz_targets/pgp.rs).
96.7.2. Cryptographic weaknesses¶
Weak or broken algorithms, parameters and randomness, oracles, malleable encryption and side channels.
96.7.2.1. EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail¶
S/MIME encrypts with CBC and classic OpenPGP with CFB, and without an
enforced integrity check both are malleable. Poddebniak et al. showed in 2018
that one known plaintext block suffices [poddebniak2018]: the decrypted
entity of a signed-then-encrypted S/MIME message starts with a predictable
Content-Type: multipart/signed line. From it, the attacker turns ciphertext
block pairs into chosen plaintext (“gadgets”) and builds an HTML element, such
as an image whose URL takes in the secret blocks that follow; attributes that
the client ignores absorb the random blocks in between. The client
that renders the result sends the plaintext to the attacker; 23 of 35 S/MIME
clients had usable exfiltration channels, 17 without user interaction. For
OpenPGP the attacker guesses the first compressed block (possible for about 40%
of messages) and builds a new compressed packet whose back references splice
exfiltration fragments around the victim’s text; this works only against
clients that release plaintext whose MDC failed, which RFC 4880 permitted
[halpin2020]. An inner signature does not help, because it can be stripped
[schwenk2022b]. Schwenk’s summary counts the back channels: 13 of 48 clients
loaded images automatically, 22 more through other elements, 11 through CSS
[schwenk2022c]. The attacker needs a copy of the ciphertext and a way to send
the modified message to a recipient. Housley [housley2022], Gerig et al.
[gerig2023] and RFC 9787 [rfc9787] recount the attack and the answer:
authenticated encryption (AES-GCM or ChaCha20-Poly1305 in AuthEnvelopedData,
S/MIME 4.0, RFC 8551; SEIPD with MDC or AEAD in OpenPGP), never releasing
plaintext that failed its check, and never generating, or marking as encrypted,
messages under weak or unauthenticated schemes.
The fix has not displaced CBC. S/MIME still mandates AES-CBC and senders still
use it; the OpenSSL CMS_encrypt documentation even recommends triple-DES CBC
as “the algorithm of choice for S/MIME use because most clients will support
it”, and only a GCM cipher yields AuthEnvelopedData [openssl2025b]. A
gateway that decrypts and forwards plaintext makes things worse, because the
client’s own EFAIL defences depend on an encrypted part that the client no
longer sees:
Suter-Dörig found the CBC gadget attack still working against SEPPmail in 2026
(rated high) [doerig2026], and CipherMail Gateway forwarded gadget-modified
plaintext unchanged and, separately, accepted spliced OpenPGP packet streams in
which an attacker’s cleartext literal packet sat beside the genuine encrypted
one, outside the MDC’s coverage [ciphermail2026]. CipherMail 6.3.3 fixed both.
A filter, on by default, sanitises decrypted messages that show signs of
tampering (non-7-bit bytes, a random-looking first block, deep MIME nesting,
missing Content-Type): it strips external references and neutralises URLs.
For any layer that does not hold exactly one content packet, the gateway
delivers the original ciphertext.
Pepsi: Partly addressed. Impact: low.
OpenPGP is protected. pgp::read_policy rejects the unprotected SED
packet under every setting, sequoia raises ManipulatedMessage for a wrong
MDC or AEAD tag, and pgp::decrypt reads the whole plaintext with
read_capped and discards everything on any error, so no modified OpenPGP
plaintext is ever committed. Sequoia’s message grammar refuses a stream that
yields more than one literal packet, which rules out CipherMail’s splicing
(this relies on sequoia; Pepsi has no test of its own for that shape). Content
beside a ciphertext is moved into inert application/octet-stream
attachments before decryption by ISOLATE_ENCRYPTED
(EFAIL direct exfiltration: plaintext spliced into attacker content), and decryption outcomes are not
reflected to the sender (CBC padding and format oracles against unauthenticated S/MIME). Outbound
OpenPGP is SEIPDv1 with MDC or SEIPDv2, negotiated per recipient.
S/MIME: the gateway reads CBC but renders nothing from it. pepsi_crypto::smime
must read AES-CBC EnvelopedData (“reading is never gated”), and under
CRYPTO_ALLOW_DOWNGRADE = yes (an explicit operator choice) also 3DES-CBC; the
layer is recorded as unauthenticated (Untrusted, a downgraded note,
container enveloped-data in state.crypto.in and container= in
X-Pepsi-Crypto). What pepsi-stage-decrypt then delivers depends on whether
a valid signature inside the container covers the plaintext (valid or
valid-untrusted; a signature around the ciphertext does not count, since the
attacker re-signs). If such a signature covers it, the plaintext is authentic and
goes out as it is. If not, UNAUTHENTICATED_PLAINTEXT = text (the default)
relabels as text/plain every part that a client would render as markup
(text/html, text/enriched, application/xhtml+xml, inside attached
messages too), reduces a multipart/alternative to its plain alternative
(pepsi_crypto::mime::plain_text_only), tags the subject [decrypted,
unauthenticated] in place of [decrypted] and records unauthenticated=yes;
sanitised=text: the gadget’s HTML arrives as visible source and nothing is
fetched. This removes the exfiltration channel, as CipherMail’s filter does.
require-signature passes such a message on unopened instead, so the user’s own
client sees the S/MIME container and applies its own EFAIL defences (an unsigned
CBC message to a user without a client key then stays unreadable); open
restores rendering, still tagged. The choice is observable by the recipient
alone, so it is no padding oracle (CBC padding and format oracles against unauthenticated S/MIME); the
broken inner signature of a rewritten message is still invalid under the
default ON_BAD_SIGNATURE = record, and pepsi-stage-reencrypt re-seals the
sanitised plaintext. Isolation moves the content beside the ciphertext out before
any of this (EFAIL direct exfiltration: plaintext spliced into attacker content). Outbound, Pepsi emits
AES-256-GCM AuthEnvelopedData by default and EnvelopedData/AES-256-CBC
only to a correspondent whose record of S/MIME capabilities says that their
client cannot read AEAD (Which S/MIME container a correspondent gets). Thunderbird (NSS) cannot,
and fails silently (Thunderbird: the gate, and how a GUI client is tested without a GUI). Only those recipients’ clients
therefore face the gadget attack on mail that Pepsi encrypted. See Gateway custody (custody = local, the MTA key) and
“Protected content stands alone” in Security model.
What remains lies in the standard and its deployed clients. CBC mail that Pepsi
sends to a client that announces no AEAD is exposed in that client; the open
setting hands the exposure back to a site that chooses it; and delivering plain
text costs unsigned CBC mail its HTML formatting. The outbound container is
already chosen per recipient, from the SMIMECapabilities that a
correspondent’s verified signature announces or from a record that the operator
configures.
96.7.2.2. OpenPGP integrity protection (MDC) missing, strippable or not enforced¶
OpenPGP encrypts with a CFB variant that is malleable: flipping ciphertext bits flips the same plaintext bits and garbles one block, and blocks can be cut, spliced and truncated without the key. Integrity protection was bolted on late as the Modification Detection Code, a SHA-1 hash of the plaintext inside the SEIP packet, and the standard left it optional and its failure handling undefined. RFC 2440 did not require an integrity check at all, made compression optional and obliged implementations to accept “uncompressed” inside a compressed packet, so an implementation written from the letter of the specification was open to the chosen-ciphertext attacks of the time [jallad2002]. The older unprotected SE packet stayed valid, an SEIP packet can be relabelled as SE or have its MDC stripped, and GnuPG released plaintext to its callers even when the MDC did not match [latacora2019]. Poddebniak et al. found five clients that accepted a stripped or wrong MDC and six that decrypted SE packets in 2018, which is what made the CFB gadget variant of EFAIL work [poddebniak2018].
The problem keeps returning in two shapes. The first is a decryptor that does not
treat an MDC failure as fatal: GnuPG still offers --rfc2440 (no MDC on
output) and --ignore-mdc-error [gnupg2024], and in 2025 GnuPG 2.4.8 was shown
to report some manipulations as harmless-looking truncation or decompression
errors and to parse and output packets before the MDC is checked, so a captured
message can be rewritten to decrypt into, for example, a public key whose fields
carry the original plaintext through DEFLATE back-references, which the victim
then signs and uploads [groves2025a]. The second is a caller that ignores the
decryptor’s verdict: SEPPmail decrypts GINA mail with GnuPG and only checks that
the output file is non-empty, so tampered GINA mail is accepted and can be
rewritten to exfiltrate a secret or to disable the second-password check.
Because gpg --decrypt also “decrypts” signed-only or plain literal input with
success, a caller that equates success with confidentiality can be fed forged
plaintext outright [doerig2026]. The fixes are known: treat every missing or
failed MDC as a hard error with no partial output, refuse SE packets, and move to
AEAD (SEIPDv2 in RFC 9580).
Pepsi: Partly addressed. Impact: low.
The integrity check itself is enforced. read_policy in
pepsi-crypto/src/pgp.rs calls reject_packet_tag(Tag::SED) under every
option, so the unprotected packet and an SEIP-to-SE relabelling are refused;
sequoia treats a SEIPDv1 MDC mismatch and a late AEAD chunk failure as hard
errors; and pgp::decrypt reads the whole plaintext through read_capped
before using any of it, discarding everything on an error (classify_io_error
maps it to decryption-failed). No garbled or partial plaintext reaches the
pipeline, there is no --ignore-mdc-error equivalent, and success is the
library call finishing without error rather than a non-empty output. Compressed
data is only reached inside an integrity-protected container, so the RFC 2440
relabelling is caught, and decompression is capped by MAX_PLAINTEXT. On
output Pepsi writes SEIPDv2 (AES-256-GCM) when the recipient’s certificate
advertises it and SEIPDv1 with MDC otherwise, never SE (The SEIPDv2 negotiation, confirmed against the real gpg).
The secure-link portal uses AES-256-GCM with the token as associated data.
The analogue of the gpg --decrypt behaviour is closed:
an armored PGP MESSAGE that contains no encryption packet is not
reported as encrypted or decrypted, because the stage takes the flag from the
packet stream, not the armor label (Unencrypted or merely signed input marked as secure).
One residue remains. Under the default
ON_DECRYPT_FAILURE = passthrough a ciphertext that Pepsi found tampered with is
delivered still encrypted, and a user who also holds the key in a vulnerable
client decides again on their own. quarantine exists but deliberately does
not distinguish “tampered” from “no key here”: whether a modified AES-CBC
ciphertext decrypts depends on its padding, so a route that differed between the
two would be a decryption oracle (pepsi-stage-if). What remains
is for client vendors: a client that holds the key must refuse an integrity
failure itself. The S/MIME analogue of GINA, AES-CBC
EnvelopedData with no integrity at all, is assessed under
Chosen-ciphertext attacks via a reply oracle on unauthenticated encryption and EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail.
96.7.2.3. Downgrade from authenticated to unauthenticated encryption under the same key¶
The cause is that the content key is not bound to the encryption mode. A receiver that accepts both an authenticated mode and an unauthenticated one, uses the same symmetric key for both, and takes the choice from unauthenticated metadata can be handed a captured AEAD ciphertext relabelled as the weak mode. Jager, Paterson and Somorovsky showed in 2013 that any CBC oracle (padding or format) then serves as a raw block-cipher decryption oracle, which suffices to test guesses of AES-GCM counter-mode blocks; a block with three unknown alphanumeric bytes took about 143,000 queries against WSS4J and Nimbus-JWT, and the same principle unwraps AES Key Wrap [jager2013]. For mail the precondition holds: S/MIME 4.0 makes AES-GCM and AES-CBC both mandatory and the CMS content-encryption algorithm identifier is not authenticated.
Strenzke and Roth carried this to CMS and LibrePGP in 2024: an AES-CBC
EnvelopedData built around the RecipientInfo of an AES-GCM or AES-CCM
message confirms guesses of low-entropy plaintext blocks, possibly all in one
query if the oracle returns the full plaintext, and the same trick recovers a key
wrapped with AES Key Wrap as content encryption. In LibrePGP the session key of an
OCB packet can be paired with a crafted legacy SE packet, whose decryption gives
an ECB oracle that forges OCB chunks [strenzke2024]. Suter-Dörig demonstrated the
CMS variant against SEPPmail, with the CBC padding check read from a [secure]
subject tag in bounces, and an AES-CFB variant against OpenSSL, which decrypts CFB
content that S/MIME never asked for [doerig2026]. OpenPGP had the older form of the
same flaw: an SEIP packet can be relabelled as the unprotected SE packet, its MDC
and signature stripped and its first bytes arranged into a valid header
[magazinius2015], and because both packet types share the session key and CFB
construction, any oracle on the unprotected path decrypts integrity-protected
messages too [maury2015]. The fixes are key separation (RFC 9580’s SEIPDv2
derives a key per mode; RFC 9709 adds an optional HKDF derivation of the CMS
content key over the algorithm identifier [rfc9709]), refusing the legacy mode,
and removing the oracles.
Pepsi: Partly addressed. Impact: low.
OpenPGP is not affected: read_policy refuses Tag::SED unconditionally,
so neither the SEIP-to-SE relabelling nor the OCB-to-SE downgrade can be
decrypted, SEIPDv2 derives its key per mode, and Pepsi decrypts only with
public-key PKESKs, so masquerading as a symmetric session-key packet is moot.
content_cipher_name in pepsi-crypto/src/smime.rs accepts only AES-GCM in
AuthEnvelopedData and AES-CBC (plus 3DES under CRYPTO_ALLOW_DOWNGRADE =
yes) in EnvelopedData; CFB, OFB, CTR and AES Key Wrap as content encryption
are refused before any key is used, and Pepsi’s own AES key wrap (in ECDH
KeyAgreeRecipientInfo) uses a derived KEK that never decrypts content.
The CMS GCM-to-CBC downgrade is closed where both sides can close it.
pepsi-crypto::smime implements RFC 9709: a container whose
content-encryption algorithm is id-alg-cek-hkdf-sha256 is opened with the
delivered key run through HKDF-SHA256 over the real algorithm identifier (nonce
or IV included), so the same RecipientInfo under another algorithm yields
another key. Pepsi derives keys this way for every correspondent whose own
signed SMIMECapabilities name the identifier (a learnt capability record,
smime_capability.cek_hkdf), and its own signatures advertise it, so mail
between Pepsi deployments carries no key that a CBC container can reuse. Reading
EnvelopedData stays on by default, because Thunderbird, Outlook and most
other clients still send CBC (S/MIME: OpenSSL, The AuthEnvelopedData question), and
Pepsi itself emits CBC to a correspondent recorded as unable to read AEAD
(Which S/MIME container a correspondent gets). [stage-decrypt] OPEN_ENVELOPED_DATA = no is
the opt-in for a site that wants no AES-GCM key ever applied to a CBC
ciphertext: every EnvelopedData is passed on unopened for the recipient’s
client, as UNAUTHENTICATED_PLAINTEXT = require-signature does with an
unsigned one. It can be set for the whole site or, through an address: or
domain: overlay, for chosen recipients; not per correspondent, since the
sender of a relabelled container is known only from an outer From: that the
attacker writes.
With the defaults, then, an attacker who captured a GCM message sent without
the derivation (by a client that does not announce it, or by Pepsi to such a
client) can still submit a synthetic CBC message under its key. Nothing that the
sender can observe answers the padding question (CBC padding and format oracles against unauthenticated S/MIME):
no DSN, auto-reply or key lookup depends on it, and no bounce setting does. The
plaintext of such a synthetic message is delivered with its markup relabelled
text/plain and the [decrypted, unauthenticated] tag unless an inner
signature covers it (UNAUTHENTICATED_PLAINTEXT,
EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail), so known keystream blocks do not
serve as CBC gadgets that the user’s client fetches, and no gate after
decryption bounces or answers according to such content (CBC padding and format oracles against unauthenticated S/MIME).
What remains is a guess confirmed through timing.
96.7.2.4. CBC padding and format oracles against unauthenticated S/MIME¶
S/MIME EnvelopedData encrypts with CBC and no integrity protection, so any
observable difference between a modified ciphertext that opens and one that does
not is a decryption oracle. Klima and Rosa showed in 2003 that changing the
padding scheme does not help, because PKCS#7 encrypts the BER type and length
octets with the content: a receiver that parses the decrypted structure confirms
whether length and padding agree, and with about 128 queries per byte an attacker
inverts the block cipher; error messages, log entries or timing all suffice
[klima2003a]. Ising et al. found two practical oracles in 2023. Google’s SMTP
servers decrypted hosted S/MIME mail during the transaction and rejected mail
without a valid inner signature with 554 5.7.5 while accepting mail that
failed to decrypt, which answered a Vaudenay padding oracle synchronously to
anyone who could send mail; Google stopped bouncing and now marks such mail as
suspicious. iOS Mail counted decryption as failed unless the plaintext contained
an empty line, which an attacker reads from whether the client fetches remote
content; a 16-byte
block took about 12 minutes and 224 mails [ising2023]. Suter-Dörig showed the
asynchronous variant against SEPPmail, which tags the subject [secure] only
when decryption succeeds: a modified message that bounces later returns the
subject, and with it the padding verdict, and through a synthetic CBC message the
same oracle confirms guesses of AES-GCM blocks; it was unfixed at the end of the
embargo [doerig2026]. The general fix is authenticated encryption; short of that,
nothing the sender can observe (SMTP replies, bounces, auto-replies, lookups,
timing) may depend on a decryption or format outcome.
Pepsi: Partly addressed. Impact: low.
Pepsi has the first ingredient: AES-CBC EnvelopedData is always read and
cbc_open distinguishes a padding failure (Decryption::Failed) from valid
padding, even for a garbled plaintext. In the default configuration, Pepsi
removes the observable signals that the papers used. Ingress never decrypts, so no SMTP
reply depends on decryption. For a message that arrived carrying ciphertext,
pepsi_common::crypto_state::dsn_must_withhold_content makes
pepsi-stage-bounce ignore RET=FULL and quote only From, Sender,
To, Cc, Date and Message-ID, whether or not decryption succeeded;
every DSN drops X-Pepsi-*; vacation notices, the pay-to-send request and the
secretary challenge use subject_for_reply. pepsi-stage-decrypt starts no
key discovery for a signature inside content from an unauthenticated container
(opened_unauthenticated, judged from the DER), so a lookup to an
attacker-chosen From: domain cannot reveal the padding verdict. The default
ON_DECRYPT_FAILURE = passthrough tells the sender nothing, and
bounce-if-unproblematic bounces only integrity-protected ciphertexts, with a
diagnostic that names no failure class, and silently drops failed CBC messages. There is
no iOS-style format check: recovered bytes are only reduced to entity headers,
which cannot fail, and ISOLATE_ENCRYPTED (default on) delivers only the first
encrypted part as the message and every other ciphertext as an inert attachment,
denying a downstream client the 100-copies amplification. Pepsi itself opens at
most 16 such moved ciphertexts per message, and no route or reply depends on
whether one opened.
No bounce setting of the stages that decrypt answers the padding question
either. bounce-if-unproblematic is the only bouncing
ON_DECRYPT_FAILURE value, and bounce is an alias for it: the bounce is
only sent on messages where the CBC oracle does not apply because the message is
not encrypted with CBC. ON_BAD_SIGNATURE =
bounce drops instead of bouncing a message whose signature came out of an
EnvelopedData container (route_for in pepsi-stage-decrypt), so a CBC
gadget that makes a padding-valid garbled plaintext look signed draws no more
reaction than a padding failure, and pepsi-stage-reencrypt with
ON_NO_CLIENT_KEY = bounce drops rather than bounces a message that opened
from such a container (crypto_state::opened_unauthenticated). A dropped
message looks to its sender like one that did not open; the telemetry key
decrypt-dropped counts them. quarantine holds a message rather than
bouncing it, and pepsi-queue gc ends the hold after [pepsi-queue]
QUARANTINE_MAX_AGE_DAYS (default 14) under the same rule: a held message
whose content came out of, or failed to open from, an EnvelopedData
container (crypto_state::unauthenticated_ciphertext, read from
state.crypto.in) is dropped, not bounced, so whether a modified CBC
ciphertext was held or delivered never turns into a DSN two weeks later.
The stages after decryption keep to the same rule for every message whose
content came out of, or failed to open from, an EnvelopedData container.
pepsi-stage-milter drops it where a filter’s REJECT (or ON_FAILURE =
reject) or an expired TEMPFAIL would bounce it; a stage that keeps
failing on it until its MAX_LIFETIME drops it instead of rerouting it to
its BOUNCE_STAGE, and pepsi-failure-bouncer drops it instead of
bouncing it. pepsi-stage-block-language under ENFORCEMENT = hard marks
and delivers it as soft mode does: the detected language depends on the
padding, and a language filter is no reason to lose a message. Pay-to-send and
confirm-to-send read no plaintext, but whether they ask the sender to pay or
to confirm follows the whitelist verdict, so pepsi-stage-check-whitelist
never lets a signature from such a container satisfy signature_required.
DSNs, vacation notices, payment requests and challenges about such a message
are written in the default language, not the one detected in it
(notice::detected_langs). What remains is processing time, which a queued
pipeline does not show the sender.
Refusing CBC inbound would remove the oracle at its root but cut Pepsi off from
most S/MIME senders, so it is an opt-in ([stage-decrypt] OPEN_ENVELOPED_DATA
= no). Outbound, the authenticated container stays the default for every
correspondent without a record: the first message to an unrecorded certificate
carries a plaintext notice beside the ciphertext instead of falling back to CBC
(What a correspondent on an unmeasured client sees). Mail that Pepsi sends therefore offers these
oracles only to a recipient recorded as reading nothing else.
96.7.2.5. Chosen-ciphertext attacks via a reply oracle on unauthenticated encryption¶
Mail encryption long used malleable, unauthenticated modes: OpenPGP’s CFB variant
and CBC in PEM, PKCS#7, CMS and S/MIME. Katz and Schneier pointed out in 2000 that
an attacker who has captured an encrypted message can reuse its public-key
encrypted session key, keep the first blocks so that OpenPGP’s two-byte key check
passes, and replace or interleave the remaining blocks with random ones; the
recipient’s client decrypts the result to garbage, and if the recipient replies
“what did you mean?” quoting it, the original plaintext follows by XOR, whatever
the strength of the algorithms [katz2000]. Jallad, Katz and Schneier implemented
the attack against PGP and GnuPG in 2002: it works on uncompressed messages and
on already-compressed attachments, which PGP did not compress again, and against
GnuPG’s compressed packets by flipping the compression header into a literal
packet header, which was stopped only by GnuPG’s MDC warning, a warning that batch
mode and front ends did not pass on [jallad2002]. Lin, Yen and Chen extended it in
2004 to the RFC 2440 packet format, to compressed and signed messages (signature
packets can simply be removed), and to a “backward compatible” attack that
rewrites a new-format compressed header into an old-format literal header and
bypasses implementation-specific MACs by converting the message to a format
that another implementation accepts without one [lin2004]. The proposed fixes were not
replying to garbled mail, signing all encrypted mail, refusing reused session
keys, and, as the real fix, a CCA-secure (authenticated) mode, which OpenPGP
gained with the MDC and later AEAD, and CMS with AuthEnvelopedData.
Pepsi: Partly addressed. Impact: low.
For OpenPGP the attack fails: SE packets are refused by read_policy, and an
interleaved, replaced or relabelled ciphertext breaks the MDC or AEAD tag, which
sequoia reports as a hard error and pgp::decrypt turns into
decryption-failed with no plaintext at all (see
OpenPGP integrity protection (MDC) missing, strippable or not enforced); there is no front end that could drop the
warning, because the decision is made inside the library call.
S/MIME is different. open_enveloped in pepsi-crypto/src/smime.rs always
accepts AES-CBC EnvelopedData (and 3DES-CBC under an explicit
CRYPTO_ALLOW_DOWNGRADE = yes, which no shipped configuration sets), and it
also opens a GCM key encapsulation relabelled as CBC
(Downgrade from authenticated to unauthenticated encryption under the same key). An attacker who
captured an S/MIME message to a Pepsi user can splice its blocks, reuse its
RecipientInfo and send it to the same user, and pepsi-stage-decrypt
decrypts it server-side. The result is not presented like authenticated mail:
unless a valid signature inside the container covers the plaintext (valid
or valid-untrusted; a signature around the ciphertext does not count, since
the attacker re-signs), the subject tag is [decrypted, unauthenticated]
rather than [decrypted], every markup part is relabelled text/plain and
X-Pepsi-Crypto records the layer as unauthenticated ([stage-decrypt]
UNAUTHENTICATED_PLAINTEXT = text, the default; What a security indicator means). The
operator can instead leave such EnvelopedData encrypted for the user’s own
client (require-signature), which costs unsigned CBC mail its server-side
decryption, or restore the markup (open). What remains is inherent to CBC
S/MIME, which most clients still send (S/MIME: OpenSSL): the partly garbled
text arrives as a message from the attacker, and if the user replies quoting it,
the original plaintext follows; the tag is the only cue. The more dangerous
exfiltration variant of the same malleability is
EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail.
96.7.2.6. OpenPGP CFB quick-check oracle recovers plaintext¶
OpenPGP’s CFB variant repeats the last two bytes of the random first block at the start of the second, a “quick check” that lets a receiver detect a wrong session key early. Mister and Zuccherato showed in 2005 that an implementation which reports a failed quick check distinguishably (GnuPG’s “bad key”, Cryptix’s “No good session key found”, or a timing difference) is a validity oracle. With a captured session-key packet reused, about 2 to the 15th setup queries and 2 to the 15th further queries per block reveal the first two bytes of any ciphertext block, 16 bits per block; the setup needs two known plaintext bytes, usually the predictable header of the compressed packet. Against GnuPG 1.2.4 this took about two hours per block. The MDC does not stop it, because the quick check is reported before the hash. The authors judged it realistic against automated, server-side OpenPGP recipients that return errors [mister2006]. The attack resurfaced in the 2019 audit of the Rust library rPGP, which checked the quick-check bytes during decryption [includesec2019], and Halpin’s survey lists it beside the reply attacks as one of the oracles of unauthenticated PGP-CFB [halpin2020]. The fix is not to report the check separately (decrypt everything, then verify the MDC over the whole message before reporting any error), or to use AEAD, which has no quick check.
Pepsi: Addressed. Impact: none.
Sequoia, which Pepsi uses for OpenPGP, still performs the quick check, but Pepsi
never exposes which check failed. The DecryptionHelper in
pepsi-crypto/src/pgp.rs records that one of our keys unwrapped the PKESK
before trying the session key, so a quick-check failure (MissingSessionKey
with the key fitted) and an MDC failure (ManipulatedMessage) both classify as
decryption-failed (classify_openpgp_error), take the same
ON_DECRYPT_FAILURE route and produce the same DSN text and X-Pepsi-Crypto
value even under bounce. Decryption happens in a pipeline stage after the SMTP
transaction has ended, so the time saved by an early abort is not observable
remotely. SEIPDv2, which Pepsi emits whenever the recipient supports it, has no
quick check at all. This depends on the fitted-key flag being set before sequoia
tries the session key, which is how the helper is written; no test pins the two
failure paths to the same code.
96.7.2.7. OpenPGP packet-format error oracles reveal CFB plaintext¶
Decrypted OpenPGP data has constrained structure (packet tags, algorithm and
compression identifiers, a single literal packet, a fixed two-byte MDC packet
header), and implementations parse it while they decrypt, before the integrity
check. Maury, Reinhard, Levillain and Gilbert showed in 2015 that the resulting
errors are format oracles: because CFB is malleable, an attacker can place a
chosen ciphertext byte where the next packet tag will be read, and GnuPG’s
invalid packet (ctb=XX), OpenPGP.js’s “Compression algorithm XX not
implemented” and End-to-End’s Unsupported id echo the decrypted value, at
about two queries per byte. A “multiple plaintexts” warning gives a double-literal
oracle at about 2 to the 6th queries per byte, and a malformed MDC header reported
differently from a wrong hash gives an oracle at 2 to the 16th queries for the
first two bytes and 2 to the 8th for each further byte, so the integrity
mechanism itself supplies the leak. All three decrypt integrity-protected messages, since
the parsing precedes the check [maury2015]. End-to-End and OpenPGP.js sanitised
their errors; GnuPG 1.4.17 and 2.0.23 partly removed the MDC header oracle. The
Rust library rPGP went further in 2019 and returned the decrypted MDC bytes in its
error message, so splicing blocks into the MDC position echoed chosen plaintext,
with early returns adding a timing oracle [includesec2019]. The remedy is
verify-then-release with a single, content-free error, or AEAD with per-chunk
authentication.
Pepsi: Addressed. Impact: low.
Pepsi decrypts attacker-supplied OpenPGP automatically, which is exactly the
setting that the paper warns about, and it mostly does what the paper recommends:
plaintext is used only after the whole message was read, sequoia’s error text is
never echoed to anyone (classify_openpgp_error and classify_io_error in
pepsi-crypto/src/pgp.rs collapse it into a small taxonomy), no decrypted
bytes appear in any error, Pepsi never passes an “allow multiple messages”
option, and the outcome is decided asynchronously after the SMTP transaction.
SEIPDv2 authenticates each chunk before parsing it and is not affected. With the
default ON_DECRYPT_FAILURE = passthrough the sender learns nothing. With
quarantine or bounce-if-unproblematic, the sender learns at most that a
message did not open, never why. quarantine bounces held mail, headers only,
after [pepsi-queue] QUARANTINE_MAX_AGE_DAYS (held S/MIME EnvelopedData
mail is dropped instead, CBC padding and format oracles against unauthenticated S/MIME), and
bounce-if-unproblematic uses one diagnostic, which names no class, for every
failed OpenPGP message.
The taxonomy still has two classes after a key has fitted: an MDC mismatch is
decryption-failed, while a MalformedPacket or MalformedMessage from
the inner packet stream (an invalid tag, a second literal packet, a broken MDC
header) is malformed. No DSN carries that class: the only bouncing
ON_DECRYPT_FAILURE value, bounce-if-unproblematic (bounce is an
alias for it), uses one class-free diagnostic
(bounce_diagnostic in pepsi-stage-decrypt), and the class reaches only
the operator’s log and X-Pepsi-Crypto, which stays on the recipient’s side.
What the sender sees under it is whether a bounce came, which for an OpenPGP
container separates a message that opened from one that did not, never one
failure class from another; every modified SEIPD ciphertext fails alike.
96.7.2.8. Short keys and weak digests in deployed certificates and keyrings¶
Mail keys live for many years, so weak key sizes and hash functions linger long after they are broken. The S/MIME specifications already treated RSA and DSA keys below 1024 bits as insecure, yet allowed agents to accept them for old mail with a warning, and asked servers without a user interface to reject weak signatures, certificates and CRLs [rfc5750] [rfc5751]. Measurements show the gap. In the 2009 SKS keyserver data, 41,700 of 446,325 Web-of-Trust signatures used MD5, and of 44,952 well-connected keys 36,555 were DSA-1024 and several hundred RSA keys had 768 or 512 bits, many of them acting as introducers [ulrich2011]. In 2015, 8,260 RSA keys under 600 bits, 11,205 between 600 and 800 bits, keys sharing primes and about 155,000 keys with MD5 signatures meant that around 70% of the strong set could be reached by an attacker who broke the weak keys and forged a certification within the default path length [barenghi2015]. On the X.509 side half of trusted TLS leaf certificates had a 1024-bit key in their chain in 2013 and CAs still signed with MD5 [durumeric2013], and a 27-year study of a whole university found 237 S/MIME RSA keys of 1024 bits and 6 of 512 bits (two created in 2020), 20.77% of certificates signed with SHA-1 and 1.52% with MD5 [stransky2022]. SEPPmail imported and encrypted to collected S/MIME certificates with moduli as short as 353 bits, factorable on a laptop in about 30 minutes [doerig2026]. The fixes are minimum key sizes for encryption and verification, refusing MD5 and SHA-1 signatures, and treating mail to a weak key no better than cleartext.
Pepsi: Partly addressed. Impact: low.
[pepsi] CRYPTO_MIN_RSA_BITS (default 2048) is enforced on every path that a
peer key reaches: build_recipient_info in pepsi-crypto/src/smime.rs and the
OpenPGP recipient check refuse to encrypt to a shorter RSA key, the S/MIME leaf
check in pepsi-crypto/src/trust.rs and verify_one_signer refuse such a
signer (Failure::WeakKey), and OpenPGP applies an exact modulus test
(rsa_bits_ok) plus bucket rejection in read_policy; the encrypt stage then
treats the recipient as having no usable key. MD5 is refused under every setting
and, with CRYPTO_ALLOW_WEAK_DIGESTS off (the default), SHA-1 too, in OpenPGP
signatures and in S/MIME message signatures, certificate chain links and CRLs
(verify_certificate_signature), not merely after sequoia’s date cutoff. Pepsi does not use Web-of-Trust
certifications to authenticate keys at all: a key’s trust comes from how it was
obtained (Keys of correspondents), so a forged third-party certification gains
nothing. Configuration parsing refuses a CRYPTO_MIN_RSA_BITS below 1024.
The size check also applies to every intermediate along an
S/MIME chain (path building in pepsi_crypto::trust skips a shorter RSA
issuer and reports weak-key); only a configured trust anchor in
ca_trust, the operator’s own choice, is exempt. What remains is small. An
operator can lower the threshold to anything from 1024 up; an RSA key below
2048 bits admitted that way is logged as a warning wherever it is used
(trust::warn_if_short_rsa), S/MIME does not encrypt to it at all (AWS-LC
encrypts only to keys of 2048 bits or more), its S/MIME signatures verify under
SHA-256, SHA-512 and an admitted SHA-1 but not SHA-384 (Unsupported), and pepsi-setup warns about a DKIM RSA key
below 2048 bits. The settings themselves are accepted, but pepsi-setup
validation warns about each one that weakens the defaults (crypto_weakening_warnings):
CRYPTO_MIN_RSA_BITS below 2048, CRYPTO_ALLOW_WEAK_DIGESTS = yes (which
opens the digest substitution of CMS signature and digest algorithm identifier substitution), and
CRYPTO_ALLOW_DOWNGRADE = yes (S/MIME 3DES read, the unauthenticated CBC
container for every S/MIME recipient). Whether to set them stays with the
operator. DSA and ElGamal key sizes are left to sequoia’s standard policy. Screening for published or
shared-prime keys is a separate issue (Private keys shared across devices or publicly known).
96.7.2.9. Legacy, export-grade, 64-bit-block or ECB content encryption in mail¶
The mail-encryption standards were written for whatever cipher every agent could
be assumed to support, and every agent kept supporting it long after it was
broken. S/MIME version 2 made RC2 with a 40-bit key the only mandatory content
cipher and told a sender that knew nothing about the recipient to use it, so an
eavesdropper recovers such a message by exhaustive key search; when the same
message went strongly encrypted to some recipients and RC2/40-encrypted to others,
breaking the weak copy disclosed all of them [rfc2311]. S/MIME version 3 still
permitted the 40-bit algorithms and repeated the warning that the weakest copy
decides the confidentiality of every copy [rfc2633]. OpenPGP kept its own legacy
set: the 64-bit-block ciphers CAST5, IDEA and 3DES, compression before
encryption, a weak passphrase KDF, MD5 and SHA-1. It also offered so many
algorithms for negotiation that every one of them became a code path to get wrong
[green2014] [latacora2019] [orman2015]. A 64-bit block cipher becomes
distinguishable after a few gigabytes under one key (the birthday bound), which
is why GnuPG now refuses to encrypt with one unless --allow-old-cipher-algos
is given [gnupg2024].
The weakness survives in deployed products in two forms. A gateway that ignores
the SMIMECapabilities that a correspondent announces and always uses its own
legacy defaults (SEPPmail sends 3DES-CBC with RSA PKCS #1 v1.5 key transport)
forces every correspondent to enable those primitives, and because S/MIME has no
key separation, the correspondent’s other, strongly encrypted mail can then be
downgraded and attacked through padding or EFAIL-style oracles [doerig2026].
And Microsoft Office 365 Message Encryption encrypts its RPMSG attachments with
AES in ECB mode for backwards compatibility, so identical plaintext blocks give
identical ciphertext blocks and a collection of messages reveals structure and
content offline to anyone who stored them; Microsoft declined to fix it (MSRC
VULN-060517, no CVE) [withsecure2022]. The fixes are the obvious ones: a single
strong, authenticated content cipher, honouring announced capabilities, never
sending a copy weaker than the original, and refusing the legacy algorithms on
both emission and decryption.
Pepsi: Partly addressed. Impact: low.
Nothing weak is ever emitted. pgp::Emission::new in pepsi-crypto/src/pgp.rs
fixes the OpenPGP content cipher at AES-256 whatever the recipient’s preferences
(SEIPDv2 with AES-256-GCM, or SEIPDv1 with MDC when the recipient’s certificate
proves it cannot read AEAD), and S/MIME is AES-256-GCM AuthEnvelopedData or
AES-256-CBC EnvelopedData, the content key carried by RSAES-OAEP key
transport to an RSA certificate and by ephemeral-static ECDH key agreement
(KeyAgreeRecipientInfo) to an EC one; ECB is used nowhere. Announced capabilities are honoured: pepsi-stage-autocrypt-learn
records the RFC 8551 SMIMECapabilities attribute of a correspondent’s
verified signature against the signing certificate, and pepsi-stage-encrypt
sends EnvelopedData only to a recipient recorded (learnt, or configured with
pepsi-keys peer capability) as unable to read AES-GCM; a correspondent who
announces AES-GCM, and one with no record, gets AuthEnvelopedData
(Which S/MIME container a correspondent gets). CRYPTO_ALLOW_DOWNGRADE = yes still sends CBC to
everybody, but it is an explicit operator choice that no shipped configuration makes. Because pepsi-stage-encrypt
encrypts each recipient’s copy separately and every container uses AES-256, there
is no weak copy that discloses a strong one. On reading, RC2, single DES, MD2 and
the unprotected OpenPGP SED packet are refused under every setting
(content_cipher_name in pepsi-crypto/src/smime.rs, pgp::read_policy),
as are MD5 signatures, and SHA-1 signatures are accepted only under CRYPTO_ALLOW_WEAK_DIGESTS
(Client interoperability, S/MIME: OpenSSL).
What remains is legacy acceptance and the clients that cannot read AEAD. 3DES
OpenPGP ciphertext is decrypted under the default negotiate, and Blowfish
with it (read_policy refuses it wherever it refuses OpenPGP 3DES, i.e.
under CRYPTO_ALLOW_DOWNGRADE = no), and 3DES S/MIME only under yes, an
explicit operator choice that no shipped configuration makes. Thunderbird
(Thunderbird: the gate, and how a GUI client is tested without a GUI) does not read AES-GCM, so a correspondent who uses
it still gets unauthenticated AES-CBC (the consequences are discussed under
EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail, CBC padding and format oracles against unauthenticated S/MIME and
Downgrade from authenticated to unauthenticated encryption under the same key), and one who has never sent a signed
message needs a configured record to get readable mail at all, or receives
the one-time plaintext notice that asks for a signed reply
(What a correspondent on an unmeasured client sees). Accepting a sender’s 64-bit cipher does not give
an attacker a birthday-bound volume of blocks, so that part is hygiene. Pepsi’s
own S/MIME signatures announce SMIMECapabilities (smime::sign passes
ADVERTISED_CAPABILITIES: AES-256-GCM, AES-256-CBC and the RFC 9709
derivation), so other gateways can apply the same rule to mail for Pepsi’s
users.
96.7.2.10. Short OpenPGP key ID collisions allow key confusion¶
OpenPGP key IDs are the low 32 or 64 bits of the key fingerprint, too short to
resist a deliberate search. Klafter and Swanson showed in 2014 that a GPU
generates a key with any chosen 32-bit ID in seconds, and produced a colliding
twin for every key in the web of trust’s strong set; key servers accepted the
twins, GnuPG used short IDs throughout its interface without warning about
ambiguity, and gpg --recv-keys imported whatever a key server answered over
unencrypted HTTP without checking that it matched the requested ID or
fingerprint [klafter2014] [green2014]. A user who refers to a key by short ID,
or fetches it that way, can thus end up encrypting to, or trusting signatures
from, an attacker’s look-alike key. The same shortness hurts systems that index
keys by ID: SEPPmail stores external users’ PGP keys in LDAP under a
distinguished name built from the 64-bit key ID, so an attacker who uploads a key
with the victim’s ID first makes the victim’s own upload fail, a denial of
service against using PGP with that gateway [doerig2026]. GnuPG was fixed to
check that received keys match the request; the general rule is to identify keys
only by full fingerprint and to refuse to act on an ambiguous identifier.
Pepsi: Addressed. Impact: none.
No part of Pepsi identifies a key by key ID. pepsi.peer_key and
pepsi.crypto_identity are keyed on address, protocol and full fingerprint
(the OpenPGP fingerprint, or the SHA-256 of the certificate DER), so a crafted
colliding key can neither overwrite nor block another key, and pepsi-keys and
the console address keys by fingerprint. pepsi-keydisc looks keys up by
address only (WKD, DANE, LDAP and the VKS by-email path), always over HTTPS
or DNSSEC-validated DNS, and discards any returned certificate whose User ID does
not name the queried address (wkd::select_matching); it deliberately speaks
the verifying VKS protocol rather than HKP, whose servers accept a key that
anybody uploaded for anybody (pepsi-keydisc, Key management). The
only key-ID use is the recipient handle in a SEIPDv1 PKESK packet, where
sequoia tries every matching secret key, so a collision costs at most one failed
unwrap. A key can still be planted for an address by other means; that is
discussed under Autocrypt and in-band key exchange open to key injection and MITM.
96.7.2.11. CMS signature and digest algorithm identifier substitution¶
In a CMS SignerInfo the digestAlgorithm and signatureAlgorithm fields
(and in AuthenticatedData the digest and MAC algorithms) lie outside the data
the signature covers, unlike the algorithm identifier of an X.509 certificate. An
attacker can therefore replace the identifier, or its parameters, with another
that the verifier will accept: a different hash of the same output length (SHA-0
or RIPEMD-160 for SHA-1), a longer hash truncated to what the signature scheme
uses, or altered parameters of a randomised hash. Forgery then needs only a
cross-algorithm collision or second preimage against the weakest acceptable
algorithm rather than against the one that the signer chose. RSASSA-PKCS1-v1_5 embeds
the hash identifier in the signature and resists the swap; RSASSA-PSS, ECDSA and
schemes where a third party signs only a digest do not
[rfc6211] [rfc8933]. No practical exploit was known when either RFC was
written; the risk is greatest for long-lived signed documents whose original
algorithm has since degraded. RFC 6211 defines the CMSAlgorithmProtection
signed attribute, a copy of the identifiers inside the signed attributes, which
verifiers must compare with the unprotected fields [rfc6211]; RFC 8933 further
requires the same digest algorithm for the message-digest attribute and for the
signed attributes, and recommends the attribute for all signers [rfc8933].
Pepsi: Addressed. Impact: low.
verify_one_signer in pepsi-crypto/src/smime.rs meets the RFC 8933 rule by
construction: one Digest taken from digestAlgorithm is used both for the
messageDigest check (check_signed_attrs) and for the signature over the
signed attributes. The set of identifiers that an attacker can substitute is
narrow: only SHA-256,
SHA-384 and SHA-512 are accepted by default (SHA-1 only under
CRYPTO_ALLOW_WEAK_DIGESTS, MD5 and MD2 never), RSA signatures are verified only as
PKCS #1 v1.5, which binds the hash, and RSASSA-PSS is not accepted at all. The
remaining room is ECDSA, where the declared digest is applied as a prehash; to
swap SHA-256 for a truncated SHA-384 or SHA-512 an attacker needs a
cross-function second preimage, which is not feasible.
Pepsi follows RFC 6211 on both sides. Its own signatures (smime::sign,
sign_opaque, sign_for) carry CMSAlgorithmProtection with exactly the
identifiers of the digest and signature algorithms that the SignerInfo
declares, so a peer
that checks the attribute catches a swap of either. When a received signature
carries the attribute, check_algorithm_protection compares it with the
SignerInfo: identifiers that differ make the signature bad-signature, like
a messageDigest that does not match. The attribute makes the signature
malformed if it occurs twice, has other than one value, lacks
signatureAlgorithm or carries a macAlgorithm. The comparison is DER
equality of the whole identifier with one equivalence: absent and NULL parameters
count as equal, because RFC 5754 and RFC 4055 let a signer write them either way. A signature without the attribute is accepted, since most clients
do not emit it (OpenSSL 3.5 does not; it verifies Pepsi’s). What remains is the
operator’s: a site that enables CRYPTO_ALLOW_WEAK_DIGESTS widens the
substitutable set to SHA-1 for signatures from such clients, and should
know that it does.
96.7.2.12. ElGamal short-exponent and small-subgroup attacks in OpenPGP¶
OpenPGP transports session keys with ElGamal but never specified how its groups and exponents must be chosen. De Feo, Poettering and Sorniotti compared RFC 4880, the Go, Crypto++ and gcrypt libraries and about 835,000 key-server keys in 2021 and found that the interpretations combine insecurely [defeo2021]. Some keys use a generator of a group whose order has many small factors, while gcrypt (GnuPG) and Crypto++ pick short ephemeral exponents when encrypting. When such a sender encrypts to such a key, a passive eavesdropper combines Pohlig-Hellman computations in the small subgroups with Pollard’s lambda method to recover the ephemeral exponent and hence the session key; the authors decrypted a GnuPG-encrypted message to a real 2048-bit key in under 2.5 hours on one core, and over 2,000 registered keys were exposed to some degree. The same group structure enables an active attack: ElGamal is malleable, so an attacker who multiplies an intercepted ciphertext by small-subgroup elements and learns whether the recipient’s software still decrypts it correctly obtains the secret key modulo each small order, and the Chinese Remainder Theorem yields the whole private key [defeo2021]. Any client or gateway that reacts observably to a failed decryption supplies that oracle. Affected key owners were asked to revoke their ElGamal subkeys, and gcrypt was changed to forbid short encryption randomness (CVE-2021-33560); the paper recommends safe primes or Lim-Lee primes, or checking the order of received ciphertext components before decrypting.
Pepsi: Not applicable. Impact: none.
Pepsi has no ElGamal at all. It generates only Ed25519/Cv25519 or RSA OpenPGP
identities (pepsi-crypto/src/keygen.rs, [pepsi]
CRYPTO_OPENPGP_ALGORITHM), and the sequoia nettle backend of release builds
reports ElGamal as unsupported for both encryption and decryption, so Pepsi never
produces a short-exponent ciphertext for a weak-group key and never holds an
ElGamal key that could be probed (Key management). The analogous
key-agreement paths validate their inputs: S/MIME KeyAgreeRecipientInfo
parses the originator’s point with AWS-LC (eckey::EcPublic), which rejects
points not on the curve, and OpenPGP ECDH uses Curve25519, whose
clamped scalars make small-order points harmless. The only consequence is
availability: a correspondent whose sole encryption subkey is ElGamal gets no
OpenPGP encryption, and pepsi-stage-encrypt falls back as its ENCRYPT
policy says (cleartext, secure link or refusal;
pepsi-stage-encrypt).
96.7.2.13. Traditional public-key algorithms broken by quantum computers¶
OpenPGP and S/MIME have used RSA, ElGamal, DSA, ECDH, ECDSA and EdDSA. Every one of these public-key algorithms rests on factoring or discrete logarithms, which a cryptographically relevant quantum computer breaks. Encrypted mail is stored for years in mailboxes, backups and on the path, so ciphertext recorded today can be decrypted once such a machine exists (“harvest now, decrypt later”), and traditional signatures can then be forged. RFC 9980 (2026) adds post-quantum algorithms to OpenPGP: ML-KEM combined with X25519 or X448 as a composite KEM, ML-DSA combined with Ed25519 or Ed448 as composite signatures, and stand-alone SLH-DSA. Its security considerations also address attacks on the new constructions: stripping one component of a composite signature, recombining components of two signatures, cross-protocol reuse and multi-target attacks on the ECC part. They recommend fresh, independent component keys, hashes of at least 256 bits and AES-256 for the encrypted data [rfc9980].
Pepsi: Vulnerable. Impact: low.
All of Pepsi’s key material is traditional. pepsi-crypto/src/keygen.rs
generates Ed25519/Cv25519 or RSA for OpenPGP and ECDSA P-256 (the default),
P-384 or RSA for S/MIME, the S/MIME implementation (Pepsi’s own CMS code) has
no ML-KEM or ML-DSA,
and the sequoia nettle backend selected for release builds reports every RFC 9980
algorithm as unsupported, so Pepsi can neither generate a post-quantum identity
nor encrypt to a correspondent’s ML-KEM key. A packager who builds with
CRYPTO_BACKEND=crypto-openssl against OpenSSL 3.5 or later gets sequoia’s
post-quantum support, and that build is tested: the CI job
6-crypto-openssl builds every program with it and runs the
pepsi-crypto suite there, including a message signed with an
ML-DSA-65+Ed25519 key and encrypted to an ML-KEM-768+X25519 subkey through
Pepsi’s own signing, encryption and decryption code, which opens and verifies
(pepsi-crypto/tests/postquantum.rs; on Nettle the same file checks that the
backend still offers none of the algorithms). Key generation offers no
post-quantum suite on either backend. The symmetric layer is already adequate
(AES-256 everywhere).
The impact is rated low because no attacker can exploit it today; the
confidentiality loss is real but deferred, and it falls on every message
encrypted now. It is not inherent: the OpenPGP standard and the library exist.
When this happens depends on the release backend: once the backend used for
releases supports RFC 9980 (Nettle, or a switch to OpenSSL), Pepsi offers a composite
ML-KEM + X25519 encryption subkey and an ML-DSA signing option in
CRYPTO_OPENPGP_ALGORITHM; for S/MIME the LAMPS work on ML-KEM in CMS has to
settle first. The cost is larger keys and messages and correspondents who
cannot yet read the new algorithms, which per-recipient negotiation, as already
done for SEIPDv2, would handle.
96.7.2.14. Proxy re-encryption forwarding: collusion key recovery and subgroup leak¶
To let a mail server forward end-to-end encrypted mail without reading it,
Vial-Prado and Wussler adapted Blaze-Bleumer-Strauss proxy re-encryption to
OpenPGP ECDH on Curve25519: the forwarding user Bob creates a key pair for the
forwarded party Charles and gives the MTA a proxy factor k = d_B / d_C, with
which the MTA transforms each message’s ephemeral point so that Charles can
decrypt it [vialprado2022]. The scheme has inherent weaknesses, which the paper
states. It is not collusion resistant: the proxy factor together with Charles’s
secret gives Bob’s secret key, so a rogue MTA colluding with the forwarded party
recovers Bob’s encryption subkey and decrypts every message ever sent to it,
including old and unforwarded ones. Proxies can compose re-encryptions, so a
malicious MTA can deliver mail along a chain directly, or drop, sabotage or keep
forwarding selectively. And because k is not a multiple of the curve
cofactor, transforming an ephemeral point in a small subgroup leaks information
about k unless the MTA checks the point first. The authors recommend
short-lived, per-setup forwarding keys, deprecating them when forwarding ends,
and a mandatory small-subgroup check.
Pepsi: Not applicable. Impact: none.
Pepsi has no proxy re-encryption and holds no proxy factors. Forwarding
(pepsi-stage-aliases, pepsi-stage-dot-forward, lists) works on whatever
the message is when it reaches those stages: mail encrypted to a gateway-custody
key was opened by pepsi-stage-decrypt at the start of the inbound path, so a
forwarded copy leaves as plaintext or is encrypted afresh to the new recipient by
pepsi-stage-encrypt with that recipient’s own key; mail encrypted to a
client-custody key passes through unopened and stays readable only by the
original recipient’s client (Gateway custody (custody = local, the MTA key), Client custody (custody = client, the MUA key)). No key is
derived for a third party, so there is nothing that a colluding MTA and
recipient could combine, and no ephemeral point is transformed. The trust placed in the
gateway when it decrypts in order to forward is the gateway-custody model itself,
documented in Threat model.
96.7.2.15. Online guessing against secret-comparison authentication (OTR SMP)¶
Password-based equality tests such as the Socialist Millionaires’ Protocol (SMP) in OTR let two users authenticate each other’s keys with a shared low-entropy secret and are meant to limit an active attacker to one online guess per run, with failures counted. Vazquez Sandoval, Atashpendar and Lenzini observed that an attacker in the middle can evaluate a guess just before the final message of the SMP exchange and, if it was wrong, drop that message so that the failure looks like a network error rather than a failed authentication; the zero-knowledge proofs attached to the messages do not prevent this [sandoval2020a]. The attacker can thus make repeated, unnoticed online guesses in both directions and against many parties, which with a low-entropy secret eventually leads to impersonation. The authors propose auditable PAKEs, with commitments, blinding and delay functions at the key-confirmation step, so that an aborted adversarial attempt can be told apart from a network failure.
Pepsi: Addressed. Impact: none.
Pepsi has no user-to-user secret comparison; its low-entropy secrets are the
secure-link PIN and the TOTP second factor, and both are checked by the server,
which counts every attempt before the requester learns its outcome. For the
portal (pepsi-httpd/src/endpoints/secure.rs) the PIN is an input to an
Argon2id derivation, and the check of the AEAD tag accepts or refuses the
derived key. The attempt is
charged by the secure_link_claim_attempt database function, in the statement
that checks the lockout, before the key is derived, so a client that disconnects
during the derivation has still spent a guess. Ten
wrong PINs lock a token for LOCKOUT (15 minutes, doubling per lockout), a
per-peer limiter bounds walks across tokens, and the default PIN is 10
characters from a 31-symbol alphabet (about 50 bits;
The secure-link fallback portal, What this protects, and what it does not). TOTP codes go through the
otp_attempt function, which refuses a replayed step and locks after ten
consecutive failures until an operator resets it (A second factor for key management). An attacker
therefore cannot abort a guess to avoid it being counted, and if charging the
attempt fails with a database error the portal answers with an error page
without testing the PIN.
96.7.3. Protocol design gaps¶
Weaknesses of the design itself: missing bindings between identities, optional protection that can be stripped, and other design flaws.
96.7.3.1. Undetectable key substitution or equivocation by key directories and CAs¶
Whoever vouches for the binding between a name and a public key can lie about it. A certificate authority can issue a false certificate for any name, as the Comodo and DigiNotar compromises showed, and because certificates are reissued routinely a fake one cannot be proven fraudulent; an identity-based key generator can compute every user’s private key; and the provider-run key directories of messengers and encrypted mail services can hand out a key of their own for a user, or different keys to different askers (equivocation), so that a compromised or coerced operator reads and re-encrypts traffic without the sender or the key owner noticing [alsabah2017] [melara2015] [ryan2014] [unger2015]. Yadav et al. implemented the four variants of such fake-key attacks (pair- or client-targeted, man-in-the-middle or impersonation) against an unmodified Signal server. They showed that if a fake key is not equivocated on the log, even key transparency detects it only at its victim, and without a proof that convinces others; they also showed that client gossip can be defeated by partitioning the communication graph [yadav2022]. Cohn-Gordon et al. note the same power in WhatsApp’s re-transmission mechanism, which resends a message under a changed identity key, so an adversary controlling key registration receives it [cohngordon2020].
The proposed remedy is transparency rather than prevention: providers publish signed, chained snapshots of a Merkle tree of name-to-key bindings, clients check inclusion and consistency proofs and monitor their own entry, and auditors or gossip detect split views. CONIKS introduced this for end users [melara2015], CIRT added efficient revocation and evidence that a “malicious-but-cautious” provider would leave behind [ryan2014], SEEMless made the directory private and fixed the tracing leak of CONIKS’s fixed tree positions [chase2019], PriviPK combined it with certificateless keys so that a second key for an address is itself evidence of attack [alsabah2017], and Proton deployed ProtonKT for its mail address keys, anchoring epoch roots in Certificate Transparency logs [proton2023]. Each design leaves residues: a key can be registered for a user who has not yet registered one, detection depends on owners checking their entries, and openly malicious providers are exposed, not stopped.
Pepsi: Partly addressed. Impact: medium.
Pepsi plays both roles. As a key directory it publishes its users’ keys through
WKD, DANE OPENPGPKEY and SMIMEA and VKS uploads. An operator, or code
running as the pepsi-crypto role, can publish a different key for a
client-custody user and so redirect future mail (the ordinary service roles may
not write an identity’s public half or fingerprint); the threat model states this
openly (Client custody (custody = client, the MUA key), Key management). For gateway-custody keys the operator
holds the private keys anyway, which is the chosen model (Gateway custody (custody = local, the MTA key)).
What is served is checked from the outside: pepsi-setup check,
pepsi-status and pepsi-keys identity list --served fetch both WKD methods
and the OPENPGPKEY and SMIMEA records for every published identity, the
way a correspondent would, and report any fingerprint that the key store does not
publish for that address. Such a fingerprint may come from another web server
answering the domain’s apex, a DNS record left over from a rotation, or a zone or
web server that somebody else controls. The console’s identity page shows a user
who is logged in for their own address the fingerprints that the world is given,
so that they can compare them with the key in their own mail client
(Checking what is actually served). For a key server,
pepsi-stage-vks-confirm re-asks after following its confirmation links and
logs a warning naming the address when the server serves another key for one
of the site’s addresses. A key substituted in the
store is invisible to the operator’s check by construction; it is the user’s
comparison that can reveal it. Both checks ask from the deployment’s own host,
once: an answer that differs only for a chosen querier (equivocation) is not
detected, and there is no transparency log or signed history of published keys
that a correspondent could audit. A Pepsi-specific log would not be checked by
any client and would make the list of addresses holding keys enumerable.
As a key consumer, pepsi-keydisc trusts the correspondent’s
domain (WKD, DNSSEC-validated DANE), an operator-configured LDAP directory, a VKS
server, and any S/MIME trust anchor the operator added to pepsi.ca_trust (none
ships by default); a malicious or compelled source of that kind can substitute a
key, and the trust ladder only arbitrates between sources; it cannot detect a
lying one (Keys of correspondents, Keys published in DNS are only as trustworthy as the zone operator).
The analogue of the WhatsApp re-transmission problem is the rotation of TOFU-tier
keys: within a rung of the Autocrypt tier pepsi-stage-autocrypt-learn lets
the newest key win (a key from an unsigned message cannot replace one learnt
from DKIM-signed mail, Autocrypt and in-band key exchange open to key injection and MITM), the peer-key cache
is shared by the whole deployment, and messages parked by
pepsi-stage-encrypt while discovery runs are released to whatever key
arrives. Rotations are recorded (key.peer.rotate, pepsi-status) and the
local recipients of the triggering message are told (A rotation is never silent),
but the users who later send to that correspondent see nothing.
ACCEPT_ROTATION = expired prevents the silent replacement at the cost of
blocking genuine key changes. E-mail has no deployed, standardised key
transparency. This underlying gap is not Pepsi’s alone; closing it needs a standard (the
IETF KEYTRANS work) and support at both ends, and nothing further is left for
Pepsi’s code until then: a Pepsi-specific log of published keys and a rotation
notice to later senders are both decided against (docs/ROADMAP.md).
96.7.3.2. Opportunistic E2EE trusts server-supplied keys without verification¶
Usable end-to-end encryption fetches the recipient’s public key automatically and uses it without authentication. That defeats a passive eavesdropper and nothing more. Whoever supplies the key can substitute its own and relay the conversation: the provider’s key server, an attacker who compromised it or the registration path, or a hosted S/MIME or identity-based encryption service [alatawi2023] [clark2021] [orman2015]. Alatawi et al. found every popular messenger running in this opportunistic mode by default, with key-verification ceremonies that are optional, hidden in settings, inconsistent between apps and, in the user studies they summarise, rarely found or completed correctly [alatawi2023]; Gloor and Perrig make the same point for Signal-protocol messengers, where few users compare safety numbers and most do not understand key-change warnings [gloor2023]. The pattern is general: Hofmann and Truong found Sync and Tresorit sharing files under server-supplied public keys that the client cannot authenticate [hofmann2024]. For mail, Ruoti and Seamons observe that transparent key management also hides the exposure from users, who overestimate the protection, and that users who lose keys and simply generate new ones teach everyone to ignore key changes [ruoti2019]. The older mechanisms do not fill the gap: the web of trust does not scale, revocation is fetched ad hoc and a compromised or revoked key may continue to be used, and CAs cannot detect all fraud [orman2015] [clark2021]. The remedies proposed are authentication ceremonies that are prominent and usable, introductions by already verified contacts [gloor2023], and key transparency (Undetectable key substitution or equivocation by key directories and CAs).
Pepsi: Partly addressed. Impact: medium.
Pepsi encrypts opportunistically by design: with [pepsi-keydiscovery]
MIN_TRUST = any (the default) pepsi-stage-encrypt uses any cached key for a
correspondent, whatever its source, because the alternative is cleartext
(Keys of correspondents, Key management). What it does better than the
systems above is to rank and constrain the sources: every key carries its
provenance on a trust ladder (own identity, operator-entered, DNSSEC-validated
DANE, WKD, LDAP, VKS, harvested from DKIM-signed mail, harvested from unsigned
mail, gossip), a better-ranked source always wins a conflict, DANE answers
without the DNSSEC AD bit are refused, WKD and VKS are fetched over HTTPS and
must name the queried address, a message encrypted to a harvested or gossiped
key makes pepsi-stage-encrypt ask discovery in the background whether the
owner published a key that would outrank it, and an operator can raise
MIN_TRUST (for instance to owner-confirmed) to prefer cleartext or the
secure-link portal over an unauthenticated key. For inbound signatures the
distinction is shown: only an own, pinned, operator-entered, DNSSEC-validated
DANE or WKD key, or a chain to a ca_trust anchor, can produce a valid
verdict and the [verified] tag; TOFU-tier keys yield valid-untrusted.
Keys for addresses for which Pepsi holds an identity are never taken from the cache
(lookup_own_first).
What remains is that a domain, directory or key server that answers with a wrong
key is believed, and that a sending user is not told when their mail went to an
unverified key. The ceremony that exists starts from a key change: the
key-change notice shows each fingerprint in hex and as PGP words, names the
new key’s trust rung and advises comparing in person, and a user who compared
can send pin FPR CODE from their ordinary mail client, which raises every
cached key with that whole fingerprint to the manual rank for the whole
deployment. The command is refused without an enrolled second factor and for
anything shorter than a full fingerprint, and it is audited (A user’s own pin).
pepsi-keys and the console let an operator pin a key entered by hand
(rank manual) as well. A correspondent first seen without a key change
prompts no comparison. The residue is inherent to opportunistic encryption, so the
choice between availability and authentication rests with the operator
(MIN_TRUST); the stage records each copy’s key source and rung in
state.crypto.out, but the author’s Sent copy is made by their client before
the gateway acts, and authenticating a key that nobody vouched for is an open
problem
rather than something left for Pepsi’s code.
96.7.3.3. Autocrypt and in-band key exchange open to key injection and MITM¶
Autocrypt and pretty Easy privacy (p≡p) distribute public keys inside the mail
itself: in an Autocrypt: header or an attached key, accepted without any
authentication, and replaced when a newer header arrives so that a user who
reinstalls a client is not cut off. Anyone who can forge mail from a contact, and
anyone on the path including either party’s provider, can therefore inject or
replace a key and read and re-encrypt the traffic that follows
[halpin2020] [krekel2019]. Vazquez Sandoval and Lenzini’s symbolic analysis of
p≡p shows the attack concretely: a Dolev-Yao attacker replaces the key attached
to the first, cleartext message, decrypts the reply, learns the other party’s key
and from then on impersonates both; only the optional trustwords handshake over a
second channel detects it, and a failed handshake marks the peer as mistrusted
for ever, a denial of service [sandoval2020]. Gossip, which spreads the keys of
other recipients, extends the attacker’s reach, and because no party has a global
view a malicious correspondent or provider can show different keys to different
recipients undetectably [kulynych2018]. Fingerprint verification checks only the
current key, so a temporary substitution reverted later goes unnoticed, and the
NEXTLEAP project computed that random out-of-band verification detects a single
attacked connection in a group of ten with about 2 % probability [krekel2019].
Autocrypt Level 1 explicitly excludes active attackers. Proposed defences are
QR-code verified contact and group setup and history verification (partly
implemented in Delta Chat), DKIM signatures over Autocrypt headers with a key
change in unsigned mail treated as suspicious [krekel2019], and ClaimChain’s
signed, access-controlled claim chains against equivocation [kulynych2018].
Pepsi: Partly addressed. Impact: low.
pepsi-stage-autocrypt-learn implements Autocrypt Level 1 and therefore
inherits its exposure, but it narrows it in several ways
(pepsi-stage-autocrypt-learn, Key management). It runs
after the spam stages and, under the default LEARN_FROM_SPAM = no, learns
nothing from mail judged spam. For any address for which Pepsi holds an
identity, that identity’s key takes precedence over the cache
(lookup_own_first), so injected keys for its
own users are never used; a sender’s own key is stored whatever domain the
From: names (a local address without an identity is a residue the project
accepts), while gossip never introduces a key for an address on a local domain
(may_introduce). Gossip is learnt only from mail that arrived encrypted, only for
To:/Cc:/Reply-To: addresses other than the sender, never when a
gossip field appears in the outer header block, and onto its own lowest rung,
so a third
party’s introduction cannot displace what an owner advertised
(A gossiped key its owner confirms is promoted); a key learnt from gossip can never make a signature
valid. Every replacement of a stored key is written to the audit log in the
same statement and announced to the local recipients of the message that caused
it (A rotation is never silent).
Krekel et al. propose DKIM over the Autocrypt header, with a key change in
unsigned mail treated as suspicious. Pepsi implements this defence as a rung of
the trust ladder. A key learnt from a message whose DKIM signature passed at
ingress, was aligned with From: and covered the key (the Autocrypt:
header in its h=, the body for an attached key or signer certificate) is
stored as inbound-signed, above the unsigned inbound rung, and the
conflict rule then refuses a key from any unsigned message against it, however
new the message claims to be; a signed key replaces an unsigned one whatever its
date, audited and announced like a rotation. The stage decides this from the
verdicts that ingress recorded, matching the passing signature back to its
DKIM-Signature field by domain, selector and the start of b= so that a
second field added on the path cannot borrow the genuine pass
(pepsi_common::auth::dkim_pass_coverage). So once a correspondent whose
domain signs its mail has been seen, forging their From: does not redirect
mail to them. Nor does a cached harvested key stop discovery:
pepsi-stage-encrypt encrypts to it and raises a lookup in the background,
at most once per NEGATIVE_TTL, so a key that the owner published through WKD,
DANE or a key server replaces it for the next message.
What remains concerns a correspondent whose domain signs nothing, or does not
sign the Autocrypt: header (which most providers’ default h= lists
omit). At first contact, or with an unsigned key, a forged From: still seeds
or replaces a TOFU key for such a correspondent, and the message is encrypted to
the attacker, who still has to obtain the ciphertext. A provider on the sending path that holds
the domain’s DKIM key can rewrite the headers of genuine mail too, which no
gating can stop. Options for the operator: ACCEPT_ROTATION = expired refuses
replacement of a live key (genuine changes then need the operator), MIN_TRUST
= harvested drops gossip, MIN_TRUST = inbound-signed accepts only signed
claims, and a floor above the Autocrypt tier disables in-band keys altogether at
the cost of cleartext or the secure-link portal for most correspondents.
96.7.3.4. TOFU and key continuity miss first-contact and new-identity attacks¶
Trust on first use, or key continuity management, accepts the first key seen for an address and only checks afterwards that it does not change. It therefore protects nothing at first contact, cannot tell a benign key change (a lost device, a reinstall) from a man in the middle, and in its non-strict form asks users to accept new keys, which inattentive users do; with several devices an attacker can simply claim a new device [unger2015]. GnuPG’s documentation of its TOFU model adds that an attacker who controls an address that merely looks like a trusted one evades the conflict detection entirely, and calls TOFU’s guarantees significantly weaker than the web of trust’s [gnupg2024]. Garfinkel and Miller’s 2005 user study of key continuity for S/MIME measured the human side: with colour-coded indicators and a short briefing the new-key attack (known address, different key) fell from 71 % to 13 % success, but the new-identity attack, a fresh address with a fresh self-made certificate, still persuaded 50-79 % of participants to send a secret document, because a first-seen key is indistinguishable from a legitimate new correspondent; plain Outlook Express also added a signer’s certificate to the address book automatically, so it encrypted the secret to the attacker [garfinkel2005]. The proposed answers are out-of-band verification, strict TOFU at the cost of key recovery, and distinguishing keys trusted only through continued use from keys certified or verified independently [unger2015] [garfinkel2005].
Pepsi: Vulnerable. Impact: medium.
Pepsi deliberately uses TOFU for opportunistic encryption: keys from
Autocrypt: headers and attached keys are stored at rank 7 when an aligned
DKIM signature covered them and at rank 8 otherwise, gossip at rank 9, and the
default MIN_TRUST = any lets pepsi-stage-encrypt use them, so the
first-contact weakness exists as shipped (Keys of correspondents). Pepsi does keep
the distinction that Garfinkel and Miller call for on the verification side: a
signature checked against a TOFU-tier key is reported valid-untrusted and
never earns the [verified] subject tag or state.signature_verified, which
only an own, pinned, operator-entered, DNSSEC-validated DANE or WKD key, or a
chain to a ca_trust anchor, can produce. The Outlook Express behaviour has a
direct analogue, though: the certificate whose signature verifies over a signed
message is learnt as a TOFU-tier encryption key for the From: address
(other certificates the message merely carries are not), so an attacker who
signs with a fresh certificate gets later mail to that address encrypted to it,
unless a better-ranked key is on record. pepsi-stage-encrypt chooses by
rank across both protocols, and a certificate from unauthenticated mail never
replaces one from authenticated mail. Key
changes are handled by Autocrypt’s newest-wins rule within a rung (a signed
claim outranks an unsigned one); every replacement is audited and announced to
the local recipients of the message that caused it (A rotation is never silent), and
ACCEPT_ROTATION = expired turns this into strict TOFU.
The new-identity attack is outside what any key logic can catch: a look-alike
address is a different address, its key is learnt like any other, and mail
signed with it is valid-untrusted for that look-alike address, so the user
has to notice the address itself (Certificates do not convey sender role; look-alike name attacks). On the
sending side users are not told that their mail went to a key that was only
seen, not verified. The options are the operator’s: MIN_TRUST = harvested
removes gossip, a floor above the Autocrypt tier removes TOFU at the cost of
cleartext or the secure-link portal for most correspondents, and
ACCEPT_ROTATION = expired refuses silent key changes at the cost of genuine
ones. A key learnt from a DKIM-signed message cannot be replaced by an unsigned
one (Autocrypt and in-band key exchange open to key injection and MITM), which raises the cost of substituting
a key for an existing correspondent whose domain signs, though not of seeding
one for a look-alike; and encrypting to a TOFU key also asks discovery
whether the owner published a key.
96.7.3.5. Key escrow, provider-held keys or provider-served crypto code defeat E2EE¶
End-to-end encryption protects only against parties who cannot reach the private key or the code that uses it. Abelson et al. argued in 1997 that any key recovery or escrow scheme adds a second, covert path to plaintext outside the key owner’s control: insiders can abuse it, its key database is a target whose theft unlocks a whole organisation, and retained keys destroy forward secrecy [abelson1997]. The same structure recurs whenever the provider holds the keys or runs the cryptography. Identity-based schemes give the key generator every user’s private key (PostGuard’s private-key generator, Pwm 2.0’s key server) [alsabah2017] [botros2023] [ruoti2015b]; symmetric key distribution centres such as EASEmail hold a master key whose compromise exposes all past traffic [segeberg2009]; FriendlyMail rests on the mail provider and a social network not colluding [pirouz2014]. Several commercial services generated and stored users’ keys themselves: Hushmail’s server generated keys and certified every user key it issued [moecke2013], and in 2007 handed decrypted mail of three accounts to US authorities, because in its server-side mode the passphrase passed through the provider and even its Java mode could have been targeted with a modified applet [singel2007]. Some S/MIME vendors still generate the subscriber’s private key [mueller2024].
A second form is crypto code served by the party against which it should protect: ProtonMail’s webmail delivers its OpenPGP client and the user’s server-stored, password-wrapped private key on every login, so the provider can serve a modified client undetectably, and its low bcrypt cost let anyone holding the key database guess passwords offline [kobeissi2018]; Swiss Post’s IncaMail portal decrypts every message on the server [gerig2023]. A third form makes mailbox access the key: when the key server authenticates users by a mail round trip, the mail provider or anyone who takes over the account obtains the decryption key [botros2023] [segeberg2009] [ruoti2015b]. Proposed remedies are certificateless keys and key transparency [alsabah2017], keys generated on the client (ACME for S/MIME) [mueller2024], threshold key servers, stronger key-server authentication, and locally installed rather than served clients [kobeissi2018].
Pepsi: Vulnerable. Impact: medium.
Pepsi is a gateway, and in its default mode it is exactly the provider-held key
this literature warns about. Under gateway custody (custody = local, see
Gateway custody (custody = local, the MTA key)) the server generates the key, holds the private half and
signs and decrypts for the user. It generates the key automatically, since
[pepsi-crypto] AUTO_CREATE_IDENTITY and [stage-encrypt] ENABLE_PEP
default to yes.
The threat model says so plainly: the protection is between domains and against
a passive reader of the database or of secrets.d, not against the operator,
root or a compromised pepsi-crypto stage, and mail is plaintext in the queue
and, without pepsi-stage-reencrypt, in the mailbox. Pepsi narrows the
custody risk without removing it: the private key column is granted to the
pepsi-crypto role alone, the stored key is an AEAD blob under a
key-encryption key kept outside the database (so a database copy is not a
password verifier, unlike ProtonMail’s wrapped keys), and S/MIME keys are
generated locally with an optional CSR, so no CA ever sees them
(The private-key custody boundary, Key management). The secure-link portal is
IncaMail’s design with the stored side hardened. A message is sealed under a key
derived from a PIN that is never stored, a salt and a server pepper, so it cannot
be read from the database or the pepper; but the operator handles the plaintext
when it is submitted and when the portal shows it
(What this protects, and what it does not). Pepsi serves no browser crypto code.
Mailbox-based key control exists too: e-mail control commands and an
Autocrypt: header in a user’s own mail register or retire keys, and the
console’s end-user sign-in ([pepsi-admin] ENROL_STAGE/ENROL_URL) is a
one-time link mailed to the address. The per-address TOTP second factor closes
this once enrolled (A second factor for key management; the console link then also needs the code),
but first enrolment is unprotected and enrolment is optional
(Someone holding a user’s mail password).
Users who need protection from the operator can choose client custody
(Client custody (custody = client, the MUA key)): the private key never reaches the server and mail encrypted
to it passes through unopened. Even then the operator can substitute the key
that Pepsi publishes and so read future mail (see
Undetectable key substitution or equivocation by key directories and CAs) unless correspondents verify the
fingerprint out of band. This is the stated design, not an oversight. What
would reduce it further is making client custody easier to adopt and publishing
keys in a transparency log, which nobody yet consumes for e-mail.
96.7.3.6. No forward secrecy for long-term mail encryption keys¶
OpenPGP and S/MIME wrap each message key to the recipient’s long-term public key, so the confidentiality of every message ever sent to it rests on one private key. Suppose an attacker records ciphertext on the wire, at a relay or in a mailbox, and later obtains that key by intrusion, cryptanalysis, passphrase theft or legal compulsion: the attacker then reads all of it. Schneier and Hall described this in 1997 and proposed short-lived encryption keys published in advance and signed by a long-term key, with expired private keys deleted [schneier1997]; Brown, Back and Laurie proposed the same for OpenPGP (short-lived subkeys, secure deletion, one-time reply keys), which was never standardised [brown2001]. Borisov et al. used the gap to motivate OTR, noting that ephemeral key agreement does not fit store-and-forward mail where the first message cannot wait [borisov2004]. Green and Latacora count it among the reasons PGP is beyond repair [green2014] [latacora2019], and academic server-assisted forward-secret mail protocols exist but are undeployed, several earlier ones having been broken [lee2021].
Pepsi: Partly addressed. Impact: low.
By default Pepsi’s identities are long-term keys: [pepsi-crypto]
IDENTITY_VALIDITY_DAYS defaults to 730 days, and at retirement an encryption
key’s private half is deliberately retained, so that in-flight and archived
ciphertext stays readable. Anybody who recorded mail encrypted to such a gateway
key and later obtains both the wrapped key and the key-encryption key in
secrets.d can decrypt everything encrypted to it since its creation.
Because gateway custody delivers plaintext (or re-seals it to a client key) on
arrival, Pepsi needs an old decryption key only for mail still in flight, and
it offers the bound that Brown et al. proposed as an opt-in forward-secrecy profile
(The forward-secrecy profile): ENCRYPTION_ROTATION_DAYS replaces every
gateway-custody encryption key on schedule, publishing the new key over WKD and
revoking the old one, and RETIRED_PRIVATE_GRACE_DAYS (30) later destroys
the retired key’s private half, but only once no message in the queue (parked
or failed ones included) is still encrypted to it; Pepsi judges this from the
recipient identifiers of the stored ciphertext. A later theft then yields
roughly one key period plus the grace window. The costs are the ones that the
proposals named:
archived ciphertext and late mail encrypted to a stale key become unreadable,
and correspondents that cache keys must refresh them, which Autocrypt headers
and WKD let them do but pinned or rarely refreshed keys do not. A user’s own
client key, and the keys that correspondents hold, are outside Pepsi’s reach;
true per-message forward secrecy would need protocol support that OpenPGP and
S/MIME do not have, and their clients cannot use one-time keys. Hops between mail
servers are forward secret where TLS is used, since rustls offers only
ephemeral key exchange.
96.7.3.7. Surreptitious forwarding: signatures not bound to the intended recipient¶
In naive sign-then-encrypt the inner signature covers only the plaintext and says nothing about whom the message was for. Davis showed in 2001 that a recipient can therefore decrypt a signed message and re-encrypt it, signature intact, to a third party, who sees a valid signature from the author and cannot tell it was not addressed to them; PEM, PKCS #7, CMS, S/MIME and OpenPGP all permit secure compositions without requiring them, and S/MIME triple wrapping only superficially resembles the repair [davis2001]. With OpenPGP the attack is cheap, since only the session key needs re-wrapping, and a sign-encrypt-sign construction with matching inner and outer keys was proposed and formally verified [pironti2017]. Surveys list it with identity misbinding and replay as consequences of static keys without destination validation [unger2015] and of signatures not bound to their context [halpin2020]. RFC 9580 finally added an Intended Recipient Fingerprint subpacket, but GnuPG ignores it unless it is marked critical, which then breaks legitimate delivery, so signers rarely emit it; Suter-Dörig used this against the SEPPmail gateway to forward a signed dismissal notice to staff for whom it was never meant (rated high) [doerig2026].
Pepsi: Partly addressed. Impact: low.
On the receiving side Pepsi is better placed than GnuPG: sequoia-openpgp’s
decryptor (2.4.2) rejects a signature whose Intended Recipient Fingerprint
subpackets do not name the key that decrypted the message, and pepsi-crypto
reports such an otherwise genuine signature with its own
code, wrong-recipient (invalid in pepsi-stage-decrypt, routed by
ON_BAD_SIGNATURE), and applies the same check where sequoia accepts a
signature, so the protection does not depend on sequoia’s default. Pepsi’s own
signatures carry the subpacket too: pgp::sign_and_encrypt names each
recipient certificate (Who a signed and encrypted message was for). Mail that Pepsi signs and
encrypts for its users therefore does not verify if one recipient decrypts it
and re-encrypts it to someone else. S/MIME has no standard field for this, so Pepsi
writes a private signed attribute naming the SHA-256 of each recipient
certificate and checks it the same way: a Pepsi-signed
encrypted(signed(body)) that its recipient decrypts and re-encrypts to
another user is wrong-recipient there. Other S/MIME clients ignore the
attribute; for them PROTECT_HEADERS, off by default in
pepsi-stage-encrypt, puts the protected To: and Cc: inside the
signature when turned on.
pepsi-stage-decrypt also compares the headers that a signer
protected with the outer ones (Protected headers against the outer ones). The signed entity
may carry its own From:, in RFC 9788 injected headers (which Pepsi’s
PROTECT_HEADERS writes) or in a signed message/rfc822. When that
From: names another address than the outer From:, the signature is reported
valid-untrusted: no [verified] tag and no state.signature_verified.
That catches the forward that re-labels a signed message as coming from its
forwarder, in either protocol and with or without encryption. A changed, added
or removed Reply-To:, Mail-Reply-To: or Mail-Followup-To: withholds
valid the same way (except a Reply-To: that a mailing list added). A differing protected To: is recorded (protected_mismatch,
X-Pepsi-Crypto) but changes no verdict, by decision: list software and
forwarders change it legitimately; a Subject: that differs by more than
bracketed segments in front is reported, and on a valid signature the
signed subject is shown in place of the outer one.
Gaps remain that need the sender’s cooperation. Most other signers emit no
Intended Recipient subpacket and protect no headers, and the recipient check
needs an encryption context. So an attacker who received a signed message can
still forward the signed content unencrypted under a spoofed From: that names
the author (ingress authentication is fail-open), and the signature is reported
valid because the protected From: (if any) matches the spoofed outer one; the
unsigned Subject:, To: and Date: are the attacker’s, and only a
protected copy of them shows up as a reported difference
(What a security indicator means). An S/MIME signature from any other client names no
recipient, so its encrypted(signed(body)) re-encrypted to another user
still verifies.
96.7.3.8. CMS ForgedAttributes: signed attributes re-presented as content¶
A CMS (RFC 5652) and PKCS #7 signature covers the DER encoding of the
SignedAttributes when they are present and the content itself when they are
absent, and nothing in the signature selects one form. Strenzke showed in 2023
that an attacker holding any message signed with attributes can strip them from
the SignerInfo and present their DER encoding as the content; a verifier
taking the attribute-less path accepts the original signature over content the
signer never signed. OpenSSL and BouncyCastle accepted his proofs of concept
[strenzke2023]. The forged content is a rigid ASN.1 structure (content type, a
digest, a signing time), so meaningful targeted text is impractical, but a
human-readable signing time or a short coincidental string can serve as a
“message”. Sign-then-encrypt hides the signature from outsiders. Suter-Dörig
found the SEPPmail gateway accepting both forms (rated medium) and noted an
analogous, previously unpublished confusion in CMS AuthenticatedData that
S/MIME does not use [doerig2026]. The fixes are a verifier check that refuses
attribute-less content which decodes as a SignedAttributes set with both
mandatory attributes, or simply requiring signed attributes in every S/MIME
signature, which mainstream clients already include.
Pepsi: Addressed. Impact: none.
Pepsi’s S/MIME verifier is its own (verify_one_signer in
pepsi-crypto/src/smime.rs). Followed literally, RFC 5652 section 5.4 checks
a SignerInfo without signedAttrs directly over the content, so an
attacker who had seen any attribute-signed S/MIME message from a correspondent
could re-present its attribute set as the content of an attribute-less one.
Pepsi implements the detection check: an attribute-less signature whose content decodes as a DER
attribute set is refused as a bad signature, since no S/MIME entity is one.
The attribute set itself is checked too: an attribute type that appears twice,
or a contentType, messageDigest or signingTime that does not carry
exactly one value, makes the signature malformed, so a set cannot carry a second
messageDigest that one reader takes and another ignores. Pepsi’s own signer
(build_signed_data) always emits contentType, signingTime and
messageDigest, so signatures that Pepsi makes cannot be re-presented against
verifiers that require attributes. Attribute-less signatures over ordinary
content are still accepted, as the RFC allows; refusing them outright would cost
nothing with mainstream clients but is not needed for this attack.
96.7.3.9. Outer signature stripped and replaced in encrypt-then-sign¶
A signature over a ciphertext proves only who transmitted the ciphertext, not
who wrote the plaintext. Davis pointed out in 2001 that anyone who can intercept
an encrypt-then-sign message can strip the outer signature and add their own,
claiming authorship of content they cannot even read; with RSA, Anderson’s
attack additionally lets the recipient, who knows the factorisation of their own
modulus, pick a public exponent under which the sender’s ciphertext decrypts to
a message of the recipient’s choosing, so the sender’s signature appears to
cover it [davis2001]. The S/MIME version 3 specification states the same
limits of ordering: with encrypt-then-sign nothing links the signer to the
plaintext, with sign-then-encrypt unsigned portions inside the encryption may
have been changed, and EnvelopedData alone detects no modification
[rfc2633]. The repairs are to sign the plaintext (or bind the recipient key)
when signing a ciphertext, to sign inside the encryption, and to use
authenticated encryption.
Pepsi: Addressed. Impact: none.
Pepsi signs inside the encryption: pepsi_crypto::sign_and_encrypt produces
an OpenPGP signature in the encrypted packet stream and, for S/MIME, makes the
SignedData the encrypted content; it emits no outer signature over
ciphertext. On the inbound side pepsi_crypto::decrypt marks every signature
layer with ciphertext beneath it covers_ciphertext, and
pepsi-stage-decrypt (signature_of) takes its verdict only from layers
covering the plaintext. A ciphertext-covering signature is consulted only when
nothing covers the plaintext, and then a good one is clamped to
valid-untrusted, so it never yields [verified] or
state.signature_verified; once a plaintext-covering signature exists, the
outer layers can neither grant nor destroy a verdict (What a security indicator means,
pepsi-stage-decrypt). A pure-CMS opaque wrap is classified from
its DER, so a stranger’s EnvelopedData inside the attacker’s own
SignedData is recognised as ciphertext too. Unsigned content beside signed
content inside a decrypted message is removed by ISOLATE_SIGNED (default
on). The residual malleability of unauthenticated EnvelopedData that
RFC 2633 mentions is a separate issue (EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail,
CBC padding and format oracles against unauthenticated S/MIME).
96.7.3.10. Ciphertext decrypted inside attacker-controlled message context¶
An OpenPGP or S/MIME ciphertext carries no binding to the message it was sent
in. An attacker who captured one can place it into a new MIME structure, next
to parts that exfiltrate or hide the plaintext, or into a new SMTP context
(their own From:, Reply-To: or Bcc:), so that the victim’s client
decrypts it and a reply or reply-all quotes the plaintext to the attacker.
Schwenk et al. (2020) found client mitigations ad hoc, inconsistent and
bypassable: Thunderbird still decrypted S/MIME parts wrapped in
multipart/alternative (CVE-2019-11739, fixed in 68.1), Enigmail failed to
isolate PGP/MIME converted to inline PGP inside a multipart message
(CVE-2019-14664, fixed in 2.0.11), and no client defended against REPLY attacks
that change only the SMTP context; their survey of client reply algorithms
found many further headers steering replies, including clients that put
Bcc into a reply-all. They proposed binding a “decryption context” (a policy
list of headers and the MIME path) into the AEAD associated data, noting that
protected headers cannot help because they are read only after decryption
[schwenk2020]. Müller et al. showed the converse, that a cleartext literal
packet beside an encrypted one produced GnuPG status lines that Thunderbird,
Evolution, Mutt and Outlook displayed as an encrypted message [muller2019].
Pepsi: Partly addressed. Impact: medium.
The MIME half is closed. Before anything is decrypted, pepsi-stage-decrypt
reduces a message that carries ciphertext beside other content to its first
encrypted unit and moves every other part into an inert
application/octet-stream attachment ([stage-decrypt] ISOLATE_ENCRYPTED,
default yes; pepsi_crypto::mime::isolate). It does so whether Pepsi then
decrypts the message or passes it through to the recipient’s client key, and it
re-applies the rule to each recovered plaintext; the decrypted entity replaces
the whole body. Hidden
sibling plaintexts, multipart/alternative wrapping and inline blocks inside
cleartext therefore never reach the reader’s rendered message, as RFC 9787
section 6.2.2 requires of an errant encryption layer, and everything rendered
under [decrypted] came out of the ciphertext. Sequoia enforces the RFC 9580
message grammar, so Müller’s packet composition is malformed. A re-sent
ciphertext that bounces does not return plaintext either: a DSN for mail that
arrived encrypted quotes addressing fields only, whatever RET asks
(EFAIL direct exfiltration: plaintext spliced into attacker content, pepsi-stage-bounce).
The SMTP-context half remains. An attacker who re-sends a captured ciphertext
to its recipient under their own From:, or with an added Reply-To: or
Bcc:, gets it decrypted and delivered, and a reply that quotes it goes where
the attacker’s headers say. A signature inside the ciphertext is always tagged:
one that does not bind the From: the reader sees adds [unverified
signer] beside [decrypted] instead of [verified: …], so a replay does
not read as mail from the signer; an unsigned ciphertext gets [decrypted], which
asserts nothing about the sender (What a security indicator means). The check that Pepsi
makes on the gateway (Protected headers against the outer ones) reaches only as far as the
sender protected headers. A protected From: that names another address, or a
Reply-To: changed, added or removed against the protected one, demotes the
signature to valid-untrusted ([unverified signer]), as does a
Mail-Reply-To: or Mail-Followup-To: so changed, and a differing
protected To: or Subject: is reported. A sender that protected nothing
therefore leaves nothing to compare, and an attacker who keeps such a signer’s
From: and adds only Reply-To: keeps [verified: …]. Fixing the rest
needs Schwenk’s decryption contexts, which no standard or sender implements; it is otherwise up to the
recipient’s client. ISOLATE_ENCRYPTED = no re-opens the MIME variants.
96.7.3.11. Header fields not protected by signature or encryption¶
OpenPGP/MIME (RFC 3156) and S/MIME sign and encrypt only the body, so
Subject, From, To, Reply-To and the other RFC 5322 fields are
neither confidential nor integrity-protected. A path attacker reads the subject
of an encrypted message and can change header fields of a signed one without
invalidating the signature [housley2022] [schwenk2022b]. Pironti
demonstrated the consequence: test reports with an added attacker
Reply-To sent to vendors’ security contacts drew replies to the attacker in
more than half of a small sample, some unsigned [pironti2017]. RFC 9787 lists
further leaks in composition: the subject seen by intermediaries, cleartext
quoted into replies, Bcc recipients revealed by the set of recipient
certificates, and copies sent encrypted to some recipients but in clear to
others [rfc9787]. Where protected copies do exist, unprotected outer copies
must not override them: Delta Chat accepted group-control headers
(Chat-Group-Member-Removed, Secure-Join) in the outer block of an
encrypted message, so a re-sent captured message with an added outer header
removed group members or helped verify an attacker’s key (fixed in Delta Chat
1.44, 2024) [song2024]. The standards’ answers are S/MIME’s wrapped-message
form, RFC 7508 and now RFC 9788 header protection, which few clients implement.
Pepsi: Partly addressed. Impact: low.
Outbound, Pepsi can protect headers: [stage-encrypt] PROTECT_HEADERS copies
From, Sender, To, Cc, Reply-To, Mail-Reply-To,
Mail-Followup-To, Subject, Date, Message-ID, In-Reply-To and
References into the protected part and
replaces the outer subject with ... (pepsi_crypto::mime::Envelope::protect_headers).
It defaults to off, because a client without header-protection support
shows ... as the subject. When it is turned on, the subject of mail that
Pepsi encrypts travels encrypted and the protected From:, To:, Cc: and
reply-steering fields sit inside every signature. Bcc
is never copied, and each recipient gets a
separate copy encrypted to that recipient alone, so recipient certificates do
not reveal Bcc recipients; Autocrypt-Gossip is always moved inside.
Inbound, the outer header block is what the user sees, and the protected
copies are compared with it before mime::entity_headers_only drops
them (Protected headers against the outer ones, pepsi-stage-decrypt/src/protected.rs).
A signature over a plaintext whose protected From: names another address
than the outer one is reported valid-untrusted, so it earns no
[verified] tag and does not set state.signature_verified. A
Reply-To:, Mail-Reply-To: or Mail-Followup-To: that was changed,
added or removed in transit (Pironti’s field and its two relatives) withholds
valid the same way; an outer field that the signer did not protect counts as
a difference. The one exception is a Reply-To: that a mailing list added
(List-Id present, none of the three signed), which keeps valid under
[verified (except reply-to): …]. A protected Subject: that carries a
forged indicator (what the sanitiser for subject tags would remove from an outer
subject, Pepsi’s own tags included) withholds valid too
(withheld=protected-subject), since a client that prefers protected headers
shows it and it cannot be cleaned without breaking the signature. A Subject:
that only gained bracketed segments in front (a list tag, an [external]
marker, Pepsi’s own tags) is no difference. Subjects are compared after RFC 2047
decoding, after normalising whitespace and after stripping forged indicators,
and the signer’s own segments have to survive in order. A larger difference is
reported and, on a valid signature, the signed subject is promoted over
the outer one, so the message stays [verified] under the subject that was
signed and a marker written without brackets is removed. A protected To:
that differs is recorded in state.crypto.in and X-Pepsi-Crypto
(protected-mismatch) without changing the verdict.
Delta Chat’s override bug has no counterpart for the fields that Pepsi itself
acts on: every inbound X-Pepsi-* field is stripped, and gossip found in an outer
block makes pepsi-stage-autocrypt-learn refuse the message’s gossip
altogether.
What remains is decided rather than overlooked. Unless an operator sets
PROTECT_HEADERS = yes for clients that render protected headers, the
subject of mail that Pepsi encrypts travels in clear. Most senders still protect
no headers, and against them there is nothing to compare, so a Reply-To:
added to such a message is not seen. If a client protects some headers but not
Reply-To:, mail from it in which the sender set a Reply-To: loses its
valid, and so does a signed reply whose protected subject quotes an earlier
[verified: …] tag (pepsi-stage-encrypt removes the local tags from its
own users’ subjects before signing, so only other senders’ replies are
affected). And To: is reported only. The remaining exposure of metadata is
Cleartext metadata, headers and lengths of encrypted mail.
96.7.3.12. Keyservers accept and serve unauthenticated key material and revocations¶
The SKS/HKP keyserver network accepted uploads without authentication and never deleted anything, so anyone could publish a key for anyone’s address or append user IDs and signatures to another person’s certificate. Schacht and Kieseberg measured the 2019 SKS dump (5.5 million keys) and found 113,366 keys used as file storage, 23,844 Evil32 keys cloning the strong set with colliding short key IDs, and outdated 1,024-bit and SHA-1 material in wide use [schacht2020]. Lookups were at best protected by the Web PKI, so a mis-issued TLS certificate let an attacker return a substituted key, and servers synchronised in 15 to 30 hours or more, so a revoked key could still be served [yakubov2018]. Mueller showed that OpenPGP has no revocation protocol at all: a revocation is a packet appended to the certificate, which a keyserver can strip or withhold from selected users undetectably, while unverified forged revocations made some clients (Enigmail) treat valid keys as revoked; about 2.8% of keys in the 2021 keyserver data were revoked, with some 13 months of validity left on average. He proposed publishing revocations in Certificate Transparency logs [mueller2022]. In practice the ecosystem moved to verifying key servers (keys.openpgp.org) and the Web Key Directory.
Pepsi: Partly addressed. Impact: low.
pepsi-keydisc never speaks HKP to an unverified keyserver: its @vks
method uses the verifying key server paths only (pepsi-keydisc/src/vks.rs),
where an address-bearing key was confirmed by mail to that address, and the
other methods are authoritative for the domain (WKD, and OPENPGPKEY or
SMIMEA records accepted only with the resolver’s DNSSEC AD bit). Every fetch
is HTTPS with certificate validation, a byte cap and a deadline; returned keys
are parsed as untrusted keyrings, and a key whose User ID does not name the
queried address is discarded (pepsi-keydisc). The trust ladder
ranks VKS below DANE, WKD and LDAP, and a signature checked against a VKS key
can only reach valid-untrusted (Key management). Sequoia evaluates
revocation signatures cryptographically, so a forged revocation is ignored, and
the pepsi-keys-refresh service re-validates cached peer keys whose refresh
time or expiry is near through the method each was learnt from, picking up
revocations that this source publishes; a harvested, gossiped or hand-entered key is
not refreshed over the network. Flooding and short key ID collisions are
treated as separate issues
(Keyserver certificate flooding and keystore poisoning, Short OpenPGP key ID collisions allow key confusion).
What remains is Mueller’s equivocation problem: a VKS or WKD server that
withholds a revocation, or answers different users differently, is not detected,
and Pepsi keeps encrypting to the cached key until it expires or an operator
removes it. With the default MIN_TRUST = any, a key served by a compromised
VKS (or through a mis-issued certificate for it) is also used for encryption to
an address that no better source covers. This is a deliberate trade, since the
alternative is cleartext (Keys of correspondents). Operators can raise
MIN_TRUST or drop vks from SOURCES at the cost of encrypting less;
detecting equivocation needs a transparency log that no key source yet offers.
96.7.3.13. CA compromise, coercion and mis-issuance of certificates¶
The X.509 trust model lets every trusted certificate authority, and every intermediate it has certified, bind any name to any key, and nothing in a certificate distinguishes a mis-issued one from a legitimate one. Someone may obtain the signing capability of one such CA by breaking into it, by abusing an RA workstation as an insider, by fooling its validation, or by legal compulsion of a domestic CA. Whoever does so obtains certificates and even CRLs that are cryptographically valid, may carry the names and serial numbers of genuine ones, and are accepted for any domain or mail address [rfc6818] [clark2013] [khan2023]. The incidents are real: Comodo (2011), DigiNotar (2011, at least 531 fraudulent certificates, a wildcard for google.com used to intercept users in Iran, a breach the CA knew about for over a month without a complete record of what it had issued), TurkTrust and ANSSI [laurie2014]. Combined with a man-in-the-middle position or spoofed DNS, the attacker impersonates TLS services including mail servers, or S/MIME users, without the victim or the domain owner noticing [rfc6394].
The remedies are all partial. RFC 6818 asks for revocation of everything that a compromised CA was certified for and for hardware and procedural protection of CA keys [rfc6818]. Pinning, notaries and multi-path probing were evaluated in 2013 and found not widely deployed [clark2013]. DANE (RFC 6394, later RFC 6698 and RFC 7672 for SMTP) lets a DNSSEC-signed zone state which CA or which key is legitimate for its services [rfc6394]. Certificate Transparency makes mis-issuance visible after the fact rather than preventing it, and CAA records do not stop a CA that ignores them [laurie2014] [khan2023].
Pepsi: Vulnerable. Impact: medium.
Pepsi relies on the Web PKI wherever it authenticates a remote server by
certificate: pepsi-stage-relay-to-internet under an MTA-STS enforce
policy, pepsi-stage-relay-to-smarthost with TLS_VERIFY on, and
pepsi-keydisc for WKD and VKS lookups. The relay stages build their trust
store in pepsi_common::smtp::tls::connector from the operating system’s root
store (rustls_native_certs; for a smarthost, TLS_CA adds to it and
TLS_CA_BUNDLE replaces it), and
pepsi-keydisc does the same unless [pepsi-keydiscovery] TLS_CA_BUNDLE
names a PEM file that replaces the roots for its fetches. A
certificate mis-issued by any of those roots therefore lets an active attacker
read and alter mail on an MTA-STS-protected outbound hop. More seriously for
end-to-end encryption, it lets the attacker substitute a correspondent’s key in a
WKD answer, which ranks above every trust-on-first-use source and maps to a
valid signature verdict (Keys of correspondents, Key management). The
same holds in the other direction: a certificate mis-issued for the
deployment’s own MX or openpgpkey host lets the attacker intercept mail sent
to it by MTA-STS senders and serve false keys for its users. The TLS clients
(relay, key discovery) learn of revocation only from a stapled OCSP response
(Revocation of TLS peers: stapled OCSP only), which the attacker presenting a mis-issued
certificate simply leaves out, so a revoked mis-issued server certificate keeps
working until it expires (Revocation not checked or soft-failed by clients). The one TLS path
that fetches revocation data is the inbound client certificate, which is not a
Web-PKI question (TLS_AUTH_CLIENT_CA names the operator’s own CAs).
Certificate Transparency is checked, but only to warn
(Log equivocation and unenforced Certificate Transparency). This is the posture of every
Web-PKI client and cannot be removed by Pepsi alone; the exposure needs a
compromised or coerced CA plus a network position, hence medium.
The mechanisms that do not depend on a CA are in place. With a validating
resolver, DANE = strict on the relay stages (the default) authenticates
an MX with DNSSEC-signed TLSA records independently of any CA and defers
mail to a peer whose certificate matches none of them, and pepsi-setup
prints 3 1 1 TLSA records for the deployment’s own listeners
(The network adversary, pepsi-stage-relay-to-internet); DANE =
warn only logs a mismatch. A peer without TLSA records is still
authenticated by PKIX alone where MTA-STS asks for it. For S/MIME, Pepsi ships
no anchors at all: an inbound
certificate counts as trusted only if it chains to an anchor that the operator added
with pepsi-keys ca add, POST /api/v1/ca-trust or the console’s
trust-anchor form, and nameConstraints on it are enforced
(Security model, Unconstrained CA signing scope and opaque trust-store control); a compromised anchor still
yields valid signatures for every address it may certify until the operator
disables it. The options are a [pepsi-keydiscovery] MIN_TRUST of dane,
which would exclude Web-PKI-authenticated WKD keys at the cost of most
discovery; a smaller root set, specific to mail, for MTA-STS delivery to
arbitrary MX hosts, as TLS_CA_BUNDLE allows for key discovery and a
smarthost; and a Certificate Transparency check that refuses rather than warns
(Log equivocation and unenforced Certificate Transparency).
96.7.3.14. Unconstrained CA signing scope and opaque trust-store control¶
The attack surface of the Web PKI is the union of every trusted CA’s authority, and almost none of it is scoped. Durumeric et al. scanned the IPv4 HTTPS space in 2012-2013 and found 1,832 browser-trusted CA certificates held by 683 organisations, more than 80 % of them not commercial CAs (universities, governments, companies, museums); only 7 carried name constraints and over 40 % had no path length constraint. A Turktrust certificate issued as a CA by mistake signed a Google wildcard, and about 1,400 signing certificates issued to South Korean organisations were contained only by a grandparent’s path length constraint [durumeric2013]. Kasten et al. counted 1,207 CAs able to sign for any name although 89 % had signed for fewer than ten TLDs. They proposed CAge, which restricts each CA to the TLDs that it has used and which cut the measured surface by 89 % [kasten2013].
Control over trust anchors is also opaque. Vendors and software ship their own roots into device trust stores, which makes the client accept certificates of their choosing [khan2023]. Ma et al. (2021) showed that the organisation named in a CA certificate is often not the one operating its key: CA certificates live for decades and are sold, merged or white-labelled, 20 % of trusted issuers were missing from Mozilla’s CCADB, and they corrected or added the operator of 892 CA certificates; a CA facing distrust can keep issuing under another name, as WoSign could through StartCom [ma2021]. The proposed fixes are name and path length constraints on delegated CAs, CA scoping, and structured disclosure of operational control.
Pepsi: Partly addressed. Impact: medium.
For S/MIME, the issue is addressed. pepsi.ca_trust starts empty and only
anchors that the operator adds count; a certificate collected from mail or discovery
never becomes one (Key management). pepsi-crypto::trust enforces
basicConstraints including pathLenConstraint, keyUsage and
extendedKeyUsage = emailProtection on the chain, and runs RFC 5280 section
6.1’s nameConstraints and policy constraints down every path, including the
anchor’s own (RFC 5937), so a partner CA can be anchored for its namespace only;
an unprocessable constraint is refused rather than ignored, and NIST PKITS runs
in the test suite (Security model, X.509 name constraints not enforced or bypassed).
An anchor that carries no constraints of its own can be scoped by the
operator: pepsi-keys ca scope (or the console and admin API) stores the
mail domains for which it is trusted. The same path validation applies them as
trust-anchor constraints (RFC 5937) to every mailbox under the anchor, to the
From: address and to the revocation lists verified through the anchor’s
chain; each domain becomes an rfc822Name permitted subtree, intersected with
the certificate’s own. Through an anchor that is left unscoped and
unconstrained, Pepsi still trusts its CA for every address; pepsi-keys ca list, pepsi-status and
pepsi-setup check report each such anchor. The CAs
that may authenticate submitting clients ([pepsi-ingress-listener-*]
TLS_AUTH_CLIENT_CA) are scoped twice: the same validator enforces the path
constraints of the presented chain, the anchor’s own included, and the CA
authenticates nothing beyond the addresses to which [pepsi-ingress]
SENDER_MAP binds it, with a leaf that names a mailbox confined to that mailbox; a CA given by
hash alone in TLS_AUTH_CLIENT authorises nothing, since a bare key carries
no checkable constraints.
For outbound TLS, the relay stages inherit the operating system’s unconstrained root
store through rustls_native_certs in pepsi_common::smtp::tls (MTA-STS
delivery, smarthost with TLS_VERIFY), so any of its roots, or a root added
by the host’s administrator or a package, can authenticate a peer MX
(CA compromise, coercion and mis-issuance of certificates). A smarthost, being one known host, can
be confined to its own CA: an entry’s TLS_CA_BUNDLE names a PEM file that
replaces the system roots for that hop, and a bundle that cannot be read or
holds no certificate makes the worker refuse to start; TLS_CA is the
additive form. The
WKD and VKS fetches of pepsi-keydisc use the system store by default, and
[pepsi-keydiscovery] TLS_CA_BUNDLE replaces it the same way, so an operator
can confine key discovery to the CAs that the relevant hosts use
(Security model).
Relay to arbitrary MX hosts keeps the whole system store, since any public CA
may have issued a receiving domain’s certificate; DANE = strict, the
default, sidesteps the CA set for peers that publish TLSA.
96.7.3.15. CA domain validation subverted via BGP and DNS attacks¶
Domain-validated issuance proves control of a name by reaching the domain
through the network and DNS as the CA sees them, so whoever can redirect the
CA’s view passes the challenge. Birge-Lee et al. (2018) hijacked the routes to
their own servers with sub-prefix, equally-specific-prefix and AS-path-poisoning
announcements and obtained certificates from Let’s Encrypt, GoDaddy, Comodo,
Symantec and GlobalSign, all via HTTP or e-mail validation, in as little as 35
seconds; 72 % of 1.8 million CT-logged domains were exposed to sub-prefix attacks
from any AS [birgelee2018]. Brandt et al. (2018) did the same off-path by
poisoning CA resolvers through IP fragmentation, forging the second fragment of
a response so the CA sent the validation mail or checked the challenge at an
attacker host; seven CAs were vulnerable [brandt2018]. Dangling DNS records,
spoofed records and a “vantage point downgrade” of multi-perspective
validation are further variants [khan2023], and RFC 8555 lists writable
.well-known paths, malicious hosting providers and catch-all redirects
[rfc8555]. The attacker obtains a trusted certificate for a domain it does
not control and can impersonate its web and mail servers.
The fixes are validation from several network vantage points (deployed by
Let’s Encrypt after the BGP work, and DV++ [brandt2018] [birgelee2018]),
DNSSEC-validating CA resolvers, and CAA records restricting which CA may issue.
Tehrani et al. (2024) found CAA rarely protected: only about 7 % of
CAA-enabled domains are DNSSEC-signed, so the record can be spoofed towards a
CA; issuer strings are ambiguous (one is accepted by 21 CAs) and often
malformed; and DANE TLSA records are scarce, a third of them unsigned and
about 30 % not matching the served certificate, often because a full-certificate
pin broke at renewal [tehrani2024].
Pepsi: Partly addressed. Impact: medium.
The issuance itself happens at the CA, but pepsi-setup obtains the
deployment’s certificates with certbot certonly (HTTP-01 by default) for the
ingress host name and the console and WKD hosts (pepsi-setup/src/tls.rs),
so a hijack of the route to the host, or of its DNS, during validation yields a
trusted certificate for the deployment’s MX and openpgpkey host. With it, an
attacker on the path can intercept mail that MTA-STS senders deliver to the
deployment and serve false WKD keys for its users. Pepsi can only reduce this
through what it publishes. pepsi-setup prints MTA-STS, TLSRPT and TLSA
records, and a CAA record with the RFC 8657 accounturi binding that
confines issuance to the deployment’s own ACME account as a commented-out
suggestion (see below). pepsi-setup check reports, for each served domain
and certificate host, the CAA set that a CA would consult (RFC 8659 §3):
none, without accounturi, or not DNSSEC-validated (the Tehrani et al.
case, a record that a spoofed answer can hide), and as an error a set under which
certbot’s own renewal would fail (pepsi-setup/src/caa_check.rs), so the
hijack window is visible on every check even while the record is not
published. The
TLSA records it prints are 3 1 1 (public-key pins), which give
DANE-validating senders a CA-independent check. They do not go stale at
renewal, which caused the mismatches that Tehrani et al. measured: certbot runs
with --reuse-key, pepsi-setup run sets reuse_key = True in the
renewal configuration of every certificate it uses, and pepsi-setup run and
check compare the published TLSA records with the served certificate and
warn on a mismatch or a record that is not DNSSEC-validated
(pepsi-setup/src/tlsa_check.rs, Stale or mismatched TLSA records break SMTP DANE).
For other domains, Pepsi depends on the correspondents’ CAs exactly as in
CA compromise, coercion and mis-issuance of certificates; DANE = strict with a validating
resolver is the CA-independent alternative. Whenever the certificates come from
certbot, pepsi-setup suggests a CAA record that names Let’s Encrypt and,
when the certbot account record is readable, its accounturi. It prints the
record as a commented-out optional block and never applies it: publishing it
restricts every CA used for the domain, so it stays the operator’s decision,
and check keeps reporting the domain as unprotected until that decision is
made.
WKD and VKS trust the full OS root store by default, so a certificate
mis-issued for a correspondent’s openpgpkey host by any of its CAs plants a
WKD key. [pepsi-keydiscovery] TLS_CA_BUNDLE names a PEM
file of CA certificates that replaces that store for the WKD and VKS fetches
(Fetcher::for_keydiscovery in pepsi-keydisc/src/http.rs; an unreadable
or empty file stops the services from starting), so an operator who knows which
CAs the relevant hosts use can exclude the rest, at the cost of losing WKD for
any correspondent whose host uses another CA. The default stays the system
store. The certificate’s SCTs are checked, but only to warn
(Log equivocation and unenforced Certificate Transparency): a certificate mis-issued and
logged passes, and one that was not logged is still used.
Operators should DNSSEC-sign the zone and publish CAA; the route itself is protected only by RPKI on the
operator’s prefixes (BGP hijacking of mail infrastructure lacking ROA/ROV and redundancy).
96.7.3.16. Domain validation challenge not bound to the account key¶
An automated domain validation proves that someone controls the domain, but unless the response also names the account that asked for it, the proof can be redirected. In ACME draft 00, the domain owner signed a CA nonce and published the signature in DNS; because signature schemes allow duplicate signature key selection, an attacker could construct a key pair under which the published signature verified for its own challenge, and obtain a certificate for any domain using the DNS challenge. Jackson et al. (2019) rediscovered this automatically with Tamarin models of such signature behaviours [jackson2019]. More generally, a man in the middle on the ACME channel (a CDN or reverse proxy in front of the CA) can substitute its own order and forward the challenges, so the honest holder provisions the response and the CA authorises the attacker’s account [rfc8555]. The fix, in ACME draft 02 and in RFC 8555, is a key authorisation in every challenge response: the token combined with a thumbprint of the account public key [jackson2019] [rfc8555].
Pepsi: Addressed. Impact: none.
Pepsi does not implement ACME; pepsi-setup obtains certificates by running
certbot certonly (pepsi-setup/src/tls.rs), which speaks RFC 8555 and
answers http-01 (or the configured plug-in’s) challenges with key
authorisations bound to its own account key, and Let’s Encrypt and other
current CAs only accept such responses. Nothing in Pepsi publishes a challenge
response that could be claimed by another account. The residual risks of
domain validation itself are in CA domain validation subverted via BGP and DNS attacks.
96.7.3.17. Log equivocation and unenforced Certificate Transparency¶
Certificate Transparency (CT) makes mis-issuance detectable only if two things hold: clients refuse certificates that carry no proof of logging, and the logs show everyone the same history. Neither is guaranteed. A party that controls a log (or a CA together with a log) can present a “split world”: one signed view containing the malicious certificate to its victims and a clean one to monitors, which log-based schemes catch only if views are gossiped or anchored [khan2023]. And without client enforcement a rogue CA can simply not log: in Friess et al.’s measurement via an advertising network, 70.4 % of clients in 2022 and 31.2 % in 2023 accepted a certificate without Signed Certificate Timestamps (SCTs), although CT monitors noticed logged certificates within a median of 8 minutes (two e-mail notification services never notified) [friess2023]. CT was designed to deliver its proofs in the TLS handshake and relies on domain owners monitoring the logs [laurie2014].
Pepsi: Partly addressed. Impact: low.
Every TLS client connection verified against the public roots checks the
Signed Certificate Timestamps embedded in the server certificate
(pepsi_common::smtp::ct): MTA-STS and verified smarthost delivery, the DANE
stage’s PKIX fallback and the WKD/VKS fetches of pepsi-keydisc. The policy
is Chrome’s: at least two valid SCTs (three for a certificate valid for more
than 180 days) from logs of two different operators, each known to Google’s log
list, which pepsi-keys ct-logs update fetches daily. A certificate that a CA
never logged is therefore reported with a warning. It is not refused
([pepsi] CT_CHECK = warn; there is no mode that refuses): a hard failure
would make mail flow depend on the CT ecosystem and on one company’s log list,
which the design principles put below independence. So the
mis-issuance in CA compromise, coercion and mis-issuance of certificates leaves a trace in the
log but still works, and only where an operator reads it. Only embedded SCTs
are seen (rustls does not expose the TLS extension, and SCTs inside a stapled
OCSP response are not read), which is how every public CA delivers them, and
SCTs are checked for a valid log signature, not for inclusion in the log.
What remains is for operators and the CT ecosystem: monitoring the logs for certificates issued for the deployment’s own domains is the domain owner’s task (a CT monitor subscription), and split-view attacks on the logs themselves, and SCT inclusion checking, have no fix at Pepsi’s level; nothing further is left for Pepsi’s code.
96.7.3.18. Replayed OCSP responses and stale revocation windows¶
Revocation information is only as fresh as the issuer decides. A CRL says “good until expiry unless you hear otherwise” and the relying party learns of a revocation only when the next scheduled list appears; Rivest argued in 1998 that the acceptor, not the issuer, should set the recency it needs, that signers should supply fresh positive evidence, and that key compromise should be handled separately [rivest1998]. OCSP did not change this for precomputed responses: they carry no nonce, so an old “good” response can be replayed until it expires even after revocation, a request does not name the responder, and HTTP caches may serve stale answers [rfc6960]. Friess et al. (2023) measured it end to end. Responses are valid for 4 to 7 days (7 at seven of nine CAs), so an attacker holding a fraudulent certificate can collect a “good” response before revocation and staple it into the handshake without any position on the OCSP path; of clients that check revocation at all, 38 % (2022) and 35 % (2023) accepted a revoked certificate with such a staple, and 87 % and 82 % of all clients accepted a revoked certificate anyway [friess2023]. The proposed remedies are shorter response lifetimes, nonces where freshness matters, and short-lived certificates [rfc6960] [friess2023].
Pepsi: Partly addressed. Impact: low.
Pepsi queries no OCSP responder; the only OCSP it reads is a response that a TLS
server staples (pepsi_common::smtp::ocsp, Revocation of TLS peers: stapled OCSP only). That
response is verified against the certificate’s issuer or a responder that the
issuer authorised and must be inside its thisUpdate/nextUpdate window (a minute
of skew allowed); a revoked answer fails the session wherever the
certificate is validated, while a missing, stale, unverifiable or good
answer leaves the session as it is. Friess et al.’s replay therefore works
here as everywhere: a server holding a fraudulent certificate can staple a
good response collected before the revocation for as long as that
response’s window lasts, or staple nothing at all, and is accepted. For S/MIME
signatures the revocation window is the
CRL’s: pepsi-keydisc fetches the lists that cached S/MIME peer certificates
name in their http:///https:// distribution points into
pepsi.crl_cache, refetching at each list’s nextUpdate and at least daily,
and pepsi-stage-decrypt checks signer chains against the current lists, so a
signer certificate revoked after a key compromise verifies as bad (revoked)
within that window (the checks a list must pass are listed under
CRL and OCSP data accepted without proper parsing or signature checks). An older list never replaces a newer
one, so a replayed stale list cannot undo a revocation. Where no usable list
exists, the chain is reported as revocation not-checked (never “not
revoked”) and can still be valid (Revocation not checked or soft-failed by clients).
The TLS clients (relay, key discovery) fetch no revocation data: the rustls
verifier in pepsi_common::smtp::tls is built without CRLs, so a TLS server
certificate revoked after a key compromise stays usable until it expires
unless the server itself staples its revoked status. The one TLS path that
fetches lists is the inbound client certificate: pepsi-ingress checks every
certificate of a TLS_AUTH_CLIENT_CA path that names a distribution point
against the lists in pepsi.crl_cache and fails closed (451 at MAIL
FROM until a current list is fetched), so there the window is the CRL’s too,
with no soft-fail. Outbound S/MIME
encryption is covered only where the fetcher could verify the list. The list
must be signed by an enabled ca_trust anchor of the issuer’s name, or by an
intermediate CA certificate that was fetched under CA_ISSUERS_FETCH and
path-validates to such an anchor (every signature verified, validity, CA flag,
path constraints, cRLSign). Such a list retires the cached peer certificates
that it lists (peer_key.revoked_at), and a retired row is no key for
pepsi-stage-encrypt. A list from an intermediate that was not fetched, or
that does not chain to an enabled anchor, retires nothing, and such a
certificate keeps receiving encrypted mail until the operator removes it
(pepsi-keys peer remove, pepsi-keys ca disable). An intermediate that
the certificate merely names is never trusted without that chain: an on-path
attacker could otherwise serve a list that retires a correspondent’s key and
sends their mail down the ON_NO_KEY route. OpenPGP is different: revocation is
carried in the certificate, pepsi-crypto::trust honours it, and its
freshness is the interval at which pepsi-keydisc re-fetches the key.
Short-lived certificates, which the Web PKI is moving to, shrink the problem for
TLS without Pepsi’s involvement. Because exploitation needs a compromised key
whose certificate has already been revoked, the impact is low.
96.7.3.19. Unsigned OCSP error responses enable revocation denial¶
OCSP error responses such as tryLater and internalError are not signed,
so a network attacker can inject them, and because a responder must sign every
real answer it is also easy to overload with queries. A client that falls back
to accepting the certificate when no status is available turns either into a
silent revocation bypass. RFC 6960 offers no protocol fix and suggests
falling back to CRLs [rfc6960].
Pepsi: Not applicable. Impact: none.
Pepsi queries no OCSP responder and runs none: the outbound TLS clients read
only the response a server staples in the handshake
(pepsi_common::smtp::ocsp), pepsi-crypto::trust reads no OCSP, and the
certificates that pepsi-crypto::keygen creates are self-signed. A stapled
response arrives inside the handshake that the server’s key authenticates, so a
network attacker cannot inject an error response into it; an unsuccessful
responder status is treated like no staple at all, which is the soft failure a
staple affords (no query was skipped). The underlying problem, revocation
that is not checked, does exist in Pepsi: for the outbound TLS clients
(relay, key discovery) wherever no revoked staple arrives (the inbound
client-certificate path checks CRLs and fails closed), and as a CRL soft-fail
for S/MIME, assessed in Revocation not checked or soft-failed by clients and
Replayed OCSP responses and stale revocation windows.
96.7.3.20. MITM downgrade of OCSP response signature algorithm¶
An OCSP client may list the signature algorithms it prefers for the response, but that list is not protected, so a man in the middle can rewrite it to ask for a weak or unsupported algorithm and obtain either a weakly signed response or a failure. RFC 6960 therefore requires responders never to sign with an algorithm they consider insecure, whatever is requested, and clients to reject responses that do not meet their own criteria [rfc6960].
Pepsi: Not applicable. Impact: none.
Pepsi serves no OCSP responses and sends no OCSP request of its own; it reads
only what a TLS server staples (see Unsigned OCSP error responses enable revocation denial), so there is
no preference list to tamper with, and pepsi_common::smtp::ocsp accepts a
stapled response only under a fixed local set of signature algorithms (RSA of
2048 bits or more with SHA-2, ECDSA P-256/P-384, Ed25519). Pepsi also accepts
other signed revocation data: the CRLs that pepsi_crypto::trust checks for
signer chains, and those that pepsi_crypto::crl verifies before cached
certificates are retired. Their signature is verified under the same
CryptoPolicy as certificate signatures, which fixes the acceptable
algorithms locally rather than negotiating them.
96.7.3.21. Revoked status for predictable not-yet-issued serial numbers¶
An OCSP responder that answers “revoked” for serial numbers it has not issued
lets anyone who can predict a future serial number obtain a signed revocation
for a certificate before it exists; with sequential serials, the prediction is
easy. The future certificate then appears revoked from the moment it is issued. RFC 6960
has such responses use the certificateHold reason, which does not revoke
permanently, and notes that CAs avoid the problem altogether with
high-entropy random serial numbers [rfc6960].
Pepsi: Not applicable. Impact: none.
Pepsi runs no OCSP responder and is not a CA for others. The only certificates
it issues are the self-signed S/MIME certificates of pepsi-crypto::keygen
(or certificate signing requests for an external CA), and their serial number
is a random positive 20-octet value (random_serial), as RFC 5280 section
4.1.2.2 allows, so it cannot be predicted even where a responder existed.
96.7.3.22. Non-repudiable signatures and lack of deniability¶
OpenPGP and S/MIME authenticate the sender with a digital signature made by a long-term key, and such a signature is transferable proof of authorship to anyone, not only to the intended recipient. Borisov, Goldberg and Brewer argued in 2004 that this is the wrong property for private conversation. Whoever later holds the messages holds cryptographic evidence that the sender wrote them, whether that is an attacker with the recipient’s mailbox, the recipient or a court. OTR instead authenticates with shared-secret MACs, publishes old MAC keys and uses malleable encryption, and for e-mail they suggested ring signatures over sender and recipient [borisov2004]. Unger and Goldberg (2015) formalised the judges involved: an OpenPGP-signed mail offers participation repudiation (the signature does not name the recipient) but no message repudiation, and even triple-Diffie-Hellman messaging is deniable only to offline judges, not to an online judge directing an informant. They proposed deniable authenticated key exchanges, among them the non-interactive Spawn suited to asynchronous messaging [unger2015a]. Neither proposal has reached the mail standards.
Pepsi: Vulnerable. Impact: low.
Pepsi produces transferable signatures on behalf of its users in two places.
pepsi-stage-encrypt signs with the author’s long-term key: by default
(ENABLE_PEP makes SIGN = encrypted-only) every message it encrypts is
signed inside the ciphertext, so any recipient, or anyone who later obtains the
recipient’s key and mailbox, can prove authorship to a third party
(pepsi-stage-encrypt). And pepsi-stage-dkim-sign signs every
outgoing message with the domain’s DKIM key, which is long-lived unless the
operator turns on rotation. Each DKIM signature
carries an x= expiration seven days after signing by default
([stage-dkim-sign] SIGNATURE_EXPIRATION_DAYS), so a verifier that honours it
stops accepting the signature after a week, but the signature itself stays
checkable against the published key by anyone who ignores x=, so a stolen
mailbox still proves that the domain sent a message long after delivery. This is inherited
from OpenPGP, S/MIME and DKIM, which define no deniable mode, and is what most
users of a signing gateway expect; it matters for users whose mail may be used
against them.
An operator can set SIGN = no (encryption without signatures), at the cost
of the recipient’s ability to authenticate the message end to end and of
Pepsi’s [verified] indicator for it. For the DKIM part the operator can turn
on the known practice of rotating selectors and publishing old private keys
after delivery has had time to complete: [pepsi-dkim] ROTATION_DAYS rotates
the keys on a schedule and PUBLISH_RETIRED_KEYS publishes each retired
private key under /.well-known/pepsi-dkim-retired/
(DKIM signatures make stolen mail verifiably attributable, Rotating DKIM keys). Both are off by
default, and mail signed in the current period stays attributable until its key
retires. Deniable end-to-end authentication for mail needs a standard first.
96.7.3.23. Flaws in the original X.509 authentication protocols¶
I’Anson and Mitchell (1990) listed defects of the 1988 CCITT X.509 directory
authentication framework, which the 1988 X.400 secure messaging also used
[ianson1990]. Its token signed the encrypted confidential parameters, so the
signature bound the sender only to a ciphertext: an attacker who intercepted an
X.400 message protected this way could strip the sender’s signature, re-sign the
unchanged ciphertext under its own key, and, if the recipient answered the
apparent sender with a reply reflecting the content, learn the plaintext
without decrypting it. The fix is to sign the plaintext parameters and then
encrypt. The three-way authentication protocol, in a defect first found by
Burrows, Abadi and Needham, omitted the responder’s name from the final signed
message, so a parallel session let an attacker be accepted as someone else;
the fix names the responder, A{rB, B}. The paper also faulted the
signature definition, which assumed one RSA key used for both encryption and
“decrypting” signatures, so it excluded other algorithms and encouraged key
reuse across purposes; it recommended algorithm identifiers or separate key
pairs [ianson1990].
Pepsi: Addressed. Impact: none.
Pepsi implements no X.509 authentication exchange, so the three-way protocol
flaw has no counterpart. The other two have analogues in mail, and Pepsi avoids
both. pepsi-stage-encrypt signs first and encrypts the signed entity, so
the signature covers the plaintext and sits inside the ciphertext. On the
inbound side, pepsi_crypto::decrypt marks every signature layer that has
ciphertext beneath it with covers_ciphertext, and pepsi-stage-decrypt
takes its verdict from layers covering the plaintext; one that covers only a
ciphertext is clamped to valid-untrusted and never sets
state.signature_verified or the [verified] tag, because anyone can
re-sign a captured ciphertext (pepsi-stage-decrypt,
Outer signature stripped and replaced in encrypt-then-sign). Pepsi’s automatic replies do not
quote the subject or content of mail that arrived encrypted (Security model).
Keys are separated by purpose: pepsi-crypto::keygen gives OpenPGP
identities a separate signing and encryption subkey and S/MIME identities two
certificates with disjoint keyUsage, unless the operator opts into
CRYPTO_SMIME_SHARED_KEY (refused for elliptic-curve keys), and every
algorithm is named by its identifier and checked against the CryptoPolicy.
96.7.3.24. Colluding introducer forwards an attacker key in trusted introductions¶
Gloor and Perrig (2023) proposed “trusted introductions” for Signal-style messengers: a user who has verified two contacts in person forwards to each the safety number that the other should see, so the two can detect a key substituted by a compromised server without meeting. The mechanism moves trust onto the introducer, and the paper states its residual weakness: an introducer who colludes with the attacker can forward the attacker’s key as the introducee’s; if the forwarding path itself was only introduced, a collusion at that earlier step lets the attacker alter even an honest introduction; chained introductions would let one colluder spread a fake key without bound; and a lying introducer can sow mistrust. Their mitigations are to allow only directly verified contacts to be introduced, to let the recipient weigh several introductions for the same contact (one honest introducer exposes the attack), and to invalidate introductions when the introducee’s key changes [gloor2023].
Pepsi: Partly addressed. Impact: low.
Pepsi’s analogue is Autocrypt gossip: pepsi-stage-autocrypt-learn
(LEARN_GOSSIP, default on) stores the Autocrypt-Gossip: keys that a
correspondent put inside an encrypted message for the other To: and Cc:
recipients, and pepsi-stage-encrypt will encrypt to such a key under the
default MIN_TRUST = any. A colluding correspondent can thus introduce an
attacker’s key for a third party, and mail from the deployment’s users to that
party is then encrypted to the attacker, who still has to intercept it. The
design limits this in the ways that the paper recommends, where mail allows it
(pepsi-stage-autocrypt-learn, A gossiped key its owner confirms is promoted): gossip
is the bottom rung of the trust ladder and never displaces a key that the owner
advertised or that discovery found; it is accepted only from a message that
arrived encrypted, only for addresses in its To:/Cc:/Reply-To:,
never for the sender itself or for a user the deployment serves; introductions
are not
chained; a key checked against it can never make a signature valid; and a
gossiped key that the owner later advertises is promoted, while a different key from
the owner replaces it.
What remains is that a single introducer suffices: there is no corroboration
by several introducers, and a later gossip of a different key replaces an
earlier one (newest wins, with an audit row and a notice to the local
recipients, A rotation is never silent). Without gossip the alternative would be
cleartext, which the same interceptor reads, so the loss is mainly a false
impression of protection. An operator who prefers not to encrypt to
introductions sets [pepsi-keydiscovery] MIN_TRUST = harvested (gossip is
still stored but not used) or LEARN_GOSSIP = no. See also
Autocrypt and in-band key exchange open to key injection and MITM.
96.7.3.25. Request theft in WS-Security signature confirmation¶
In the OASIS WS-Security 1.1 X.509 mutual-authentication scenario, the responder proves it saw the request by signing the request’s signature (“signature confirmation”). Jackson et al. (2019) showed that this relies on a property that signature schemes do not have: a signature does not bind its signer’s key, and for RSA, DSA and ECDSA an attacker can generate a key pair under which an honest client’s signature also verifies (duplicate signature key selection). Replacing the client’s certificate with one for such a key makes the server accept the honest request as the attacker’s and send the response, for example a session cookie, to the attacker. The scenario had been “verified” with ProVerif under the usual idealised signature model. The fix is to sign the message and the original public key directly rather than a signature, which the authors verified in Tamarin [jackson2019].
Pepsi: Not applicable. Impact: none.
Pepsi implements no WS-Security and no protocol that signs or confirms another
party’s signature. Where Pepsi uses signatures, it binds keys to identities by
other means:
an inbound signature counts only through a certificate or OpenPGP user ID that
names the From: address and chains to an anchor or a cached key of known
provenance (Weak binding between signer certificate or key and the From address), so a key manufactured to make an
existing signature verify gains nothing unless it is also certified for that
address; and Pepsi’s own signatures are made over the message content, never
over a signature.
96.7.3.26. Encrypted unsolicited mail evades content filters¶
Spam and phishing filters analyse plaintext; an encrypted message hides it, so a recipient who accepts unsolicited encrypted mail loses content filtering for exactly those messages. The security considerations of RFC 5083 (AuthEnvelopedData) note this and say that receiving software needs a mechanism for unwanted encrypted traffic, for instance rejecting or discarding encrypted messages unless they claim to come from an allow-listed sender [rfc5083].
Pepsi: Partly addressed. Impact: low.
Most encrypted mail does not evade Pepsi’s filters, because
pepsi-stage-decrypt runs first on the inbound path, and every stage after it
sees the plaintext when the gateway holds the recipient’s key: language
detection and blocking, the milter stages, and the whitelist, secretary and
pay-to-send gates (pepsi-stage-decrypt, The Wizard). The
sender-based gates that Pepsi offers (pepsi-stage-check-whitelist,
pepsi-stage-secretary, pepsi-stage-anti-spam) are the allow-list
mechanism that RFC 5083 asks for and do not depend on content at all.
What remains is mail that Pepsi does not open: a message encrypted to a key held
only in the user’s client (custody = client), and a message that no key here
fits.
These pass the content filters as ciphertext. Pepsi has no dedicated option to
refuse undecryptable mail from senders outside a whitelist; the manual page of
pepsi-stage-if gives a tested recipe that holds, at a quarantine or discard
stage, mail that no key here could open (state.crypto.in.failure =
no-decryption-key) from senders that pepsi-stage-check-whitelist did not
pass.
It branches only on “no key here”, never on a failed decryption, and never
routes to a bounce, since a decision that depends on whether a modified
ciphertext decrypts would be a padding oracle
(CBC padding and format oracles against unauthenticated S/MIME). Mail for the user’s own client key is
not held by it. The operator has to wire it, or rely on the sender-based
gates. A spam or phishing message hidden this way still needs the user to open
it in a client that decrypts it, so the impact is low.
96.7.3.27. EFAIL direct exfiltration: plaintext spliced into attacker content¶
The key cause is missing isolation between parts of a message with different security properties. A client decrypts an encrypted MIME entity wherever it appears in the tree, inserts the plaintext in place, and hands the combined parts to an HTML renderer that ignores MIME boundaries. An attacker who has captured a ciphertext wraps it between two parts of their own that open and close an external URL, such as an unterminated image source, so the plaintext becomes part of a request to the attacker’s server when the victim opens the mail. No ciphertext is modified, so authenticated encryption does not help. Poddebniak et al. published this as the direct-exfiltration half of EFAIL in 2018: it worked directly in Apple Mail, iOS Mail, Thunderbird and Postbox, and 17 of 48 clients would leak if a gateway inserted the plaintext [poddebniak2018] [schwenk2022c]. Surveys repeat it as a standing weakness of both OpenPGP and S/MIME [ghanta2025]. Vendor fixes were piecemeal and partly incompatible (Thunderbird, for instance, decrypts S/MIME only at the MIME root since 2018); signatures do not help, since an invalid one only warns and the attacker can strip it or add their own [schwenk2022c].
Decrypting gateways reintroduce the attack. Suter-Dörig showed that after the
SEPPmail gateway decrypted a PGP message, Apple Mail no longer saw an encrypted
part and rendered HTML across parts again, and that SEPPmail’s inline-PGP
support decrypted armor found anywhere in a text/* part and spliced the
plaintext into the surrounding attacker HTML, so the leak happened inside one
part where client-side isolation cannot help; if remote content was blocked,
the surrounding text could still lure the user into quoting the plaintext in a
reply. SEPPmail 15.0.1 (January 2026) strips text around inline PGP; the
direct-exfiltration problem was otherwise still open at the end of the embargo
[doerig2026]. RFC 9787 adds the general rule that a protected part must not
have external subresources fetched: doing so tells the referenced server that
and where the message is read, and a signed part’s content can change with what
the server returns [rfc9787]. The systematic fixes are a same-origin policy for
mail (show only the first protected part, turn the rest into attachments) and
binding the decryption to its MIME context, e.g. AEAD over the original
structure [schwenk2022c].
Pepsi: Partly addressed. Impact: low.
pepsi-stage-decrypt applies the gateway countermeasure, the same-origin rule
for mail, before anything is decrypted (Security model,
pepsi-stage-decrypt). An encrypted unit is a PGP/MIME part, an
application/pkcs7-mime part that is or may be ciphertext, or an inline
-----BEGIN PGP MESSAGE----- block in a text/* or
application/octet-stream part. With ISOLATE_ENCRYPTED = yes (the
default), pepsi_crypto::mime::isolate takes every message for a local
recipient that carries such a unit next to anything else, and turns it into the
first encrypted unit under the original header fields. It moves every other part
into an attachment that no client renders inline: application/octet-stream,
disposition attachment, no Content-ID or Content-Location, whatever
the sender labelled it, since common clients show a text/* attachment inline.
An inline block becomes a text/plain part that holds only the armor, and the
text around it becomes an attachment, so the single-part splice has nothing to
land in.
Further ciphertexts are moved too, because an attacker can encrypt the HTML
fragments to the victim’s key, and the reduction is repeated on every plaintext
that the decrypt loop recovers. This is the separation that RFC 9787 section
6.2.2 requires of a client that decrypts an errant encryption layer [rfc9787]. When
Pepsi opens the message it opens up to 16 moved ciphertexts into attachments as
well, which is how files encrypted one by one beside an inline-PGP body arrive;
beside a signed plaintext only those signed by the same key are kept, and
cleartext parts are dropped. Because the reduction happens before key lookup, it
also protects mail delivered still encrypted (no key, a failure, or a key held in
the user’s client), i.e. it shields an EFAIL-vulnerable client: a PGP/MIME or
S/MIME container then goes on alone, at the root, and an inline body keeps its
moved parts as inert attachments. An attached message (message/rfc822,
message/global) is a message that a client opens and decrypts on its own, so
one that carries an encrypted unit beside other content is reduced by the same
rule inside the attachment, which stays an attached message, through three
levels of attached messages; one nested deeper that still carries ciphertext
becomes an inert .eml file whole. Beside a top-level ciphertext the
attached message is moved into an .eml file that holds the reduced form.
It is recorded as isolated=encrypted with demoted=/dropped= and
nested= counts in X-Pepsi-Crypto. The DSN path, a
no-interaction way back to the attacker, quotes no content of mail that arrived
encrypted.
What remains is narrow. A moved ciphertext
that Pepsi opens is delivered as a file, which a quoting reply does not include
but a forward does; an attacker gains nothing by bundling captured ciphertexts
this way that sending each as a message of its own would not give them
(Replies, drafts and mailto turning clients into decryption/signing oracles), and restricting the opening to
inline-PGP bodies would not help, since the attacker can encrypt such a body to
the victim too. Isolation covers only recipients whose path runs through
pepsi-stage-decrypt, and ISOLATE_ENCRYPTED = no reopens the whole attack,
so such a site should also set [pepsi] CRYPTO_INLINE_PGP = reject. The
RFC 9787 concern about external subresources of a protected part is met for
users who turn on pepsi-stage-defang (pepsi-stage-defang,
off by default and wired before re-encryption and local delivery). It removes
every reference that a decrypted HTML part would load by itself, so a part that
does reach a renderer cannot carry the plaintext to a server either, and the
message says so in X-Pepsi-Warning: remote-content-defanged. A part covered
by a signature that the client checks again keeps its references, as
RFC 9787 leaves those to the client. For such parts, and for users who leave
the stage off, protection depends on the client’s remote-content blocking
(Remote content) or on DECRYPTED_MARKUP = text, which
delivers every decrypted plaintext as plain text. What remains is for client vendors and for the operators
of such sites; nothing further is left for Pepsi’s code. Malleability inside one CBC ciphertext is a separate issue
(EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail).
96.7.3.28. Weak binding between signer certificate or key and the From address¶
A signature proves that the holder of a key made it; it says nothing about the
From: line unless the verifier compares the two. Where that comparison is
missing, error-prone or skipped for some certificates, an attacker signs with a
key that is genuinely their own and lets the reader attribute the message to
somebody else. Müller et al. called these ID attacks [muller2019]: some clients
show “signed” without comparing signer and sender at all (Windows 10 Mail), others
compare only the address and leave the display name free, so the attacker writes
the victim’s name and address into it, or they disagree with their plugin about
which of several From: fields, or From: versus Sender:, counts; four
OpenPGP and eight S/MIME clients were affected. The S/MIME standards make this
easier because RFC 5750/8550 neither require an e-mail address in a certificate
nor an explicit emailProtection usage: Outlook accepts a certificate without
an address and shows its free-text common name as the signer, which Microsoft did
not regard as a vulnerability, and every tested configuration of permissive
certificates was accepted by at least one widely used client, while unencrypted
LDAP lookups let a network attacker inject such certificates [ondaro2025].
Gateways repeat the flaw in their own code: SEPPmail split a certificate subject
on whitespace, so a quoted address "x victim@corp.example"@attacker.example
made a certificate valid for the victim (fixed in 15.0.1, January 2026); it
verified PGP signatures against any key in a set that included the recipient’s
own, so a message that the recipient had signed could be reflected back under any
sender; and it decrypted an S/MIME message/rfc822 carried inside another
message and forwarded the inner message after sender authentication had already
run, impersonating internal users (unfixed at disclosure) [doerig2026]. Google
Workspace offers an opt-in “certificate mismatch” setting that deliberately turns
the binding off [google2026].
Two neighbouring problems arise from the same weak binding. Clients that silently
import the certificate from any validly signed S/MIME message replace the stored
key for that address, so an active attacker who obtains a certificate in Bob’s
name from a CA that validates by e-mail redirects all of Alice’s future mail to
Bob to himself; five of 18 clients did so silently (Outlook, Postbox, eM Client,
Thunderbird, MailMate), only Apple Mail and Claws Mail behaved safely
[muller2020]. And nothing in a signature binds it to a time or a delivery, so a
captured signed message can be re-sent later under the same From: and still
verifies [pirouz2014]. The remedies proposed are to display the signer’s address
rather than a name, to follow the S/MIME Baseline Requirements (an address and an
explicit emailProtection usage), to ask before replacing a stored key, and to
protect headers inside the signature.
Pepsi: Partly addressed. Impact: low.
Pepsi binds signer and sender, and several of the gateway bugs cannot occur.
pepsi_crypto::trust::bind_address compares the certificate’s rfc822Name
entries (or, when there are none, the subject’s PKCS#9 emailAddress) or the
OpenPGP User ID addresses as whole normalised addresses with the first mailbox of
From: (mime::sender_address, falling back to Sender: only when there
is no From:), and a mismatch is Failure::IdentityMismatch; an RFC 9598
SmtpUTF8Mailbox is read as well and compared as that RFC says (local part
octet for octet, domain as A-labels, trust::bind_certificate), and
keygen emits one for an identity with a non-ASCII local part. The address is
located the way a mail client reads it, skipping comments and quoted strings
(Ambiguous From headers checked as one address and displayed as another), and pepsi-ingress refuses a
message with two From: fields (550 5.6.0). Splitting a subject on
whitespace does not happen, because each SAN entry is one string. The certificate side is never parsed for an address at all
(trust::bind_certificate): only a bare addr-spec in an rfc822Name or
emailAddress counts, as RFC 5280 section 4.2.1.6 requires, so an
rfc822Name such as a@x.example <victim@y.example> – which a careless CA
might validate by its first address – does not bind the certificate to the
victim but makes it Mismatched; pepsi-keydisc’s import applies the same
rule. Signature
reflection does not apply: the verification trust store holds the claimed
sender’s keys (keydisc::lookup_own_first) plus attached certificates, which
can never give valid; the recipient’s private keys are given to sequoia for
decryption only, and the issuer is matched by fingerprint. Decryption
impersonation does not apply either: the MIME classifier never descends into
message/rfc822, and mime::entity_headers_only drops every
non-Content-* field of a decrypted entity, so the From: that sender
authentication saw is the one that is bound
(pepsi-stage-decrypt).
The ID attack in a gateway’s form is answered where the reader looks
(What [verified] binds the signer to, What a security indicator means). The [verified] tag
names the bound address ([verified: alice@example.org]), so the one field
that every client shows says who signed. pepsi-stage-decrypt grants
valid only for the From: line as the reader sees it. Each of the
following gives valid-untrusted, with the reason in X-Pepsi-Crypto
(withheld=display-name, multiple-from, no-identity,
lookalike-domain): a display name or comment that shows another address
(judged from the field and from the state.auth.display_name_mismatch that
ingress records); a From: that names more than one mailbox; a certificate
that names no mailbox under a ca_trust anchor (Binding::NoIdentity,
which the verifier deliberately does not fail but which the stage consults);
and a signer domain whose look-alike skeleton equals a served domain or the
domain of an address in the key store or the whitelist (the A-label shown as
signer-domain=). None of them therefore sets state.signature_verified
or satisfies a signature_required whitelist row. The nameless case has a
per-anchor opt-in (pepsi-keys ca accept-nameless) for a CA whose issuance
process binds leaves to holders out of band; certificate_facts still
treats an absent EKU or anyExtendedKeyUsage as emailProtection, as
RFC 8550 asks.
What remains is that a correspondent’s stored key can be replaced from mail.
pepsi-stage-autocrypt-learn learns an S/MIME certificate only when it
made a signature over the message (smime::signing_certificates), but the
signer can be anybody holding a self-made certificate in the victim’s name,
and From: is fail-open. The certificate’s rung follows the Autocrypt
rule: from a message that DMARC authenticated (state.auth.dmarc = pass) or
covered by a passing DKIM signature aligned with From: it lands on
inbound-signed, otherwise on inbound, and nothing from the lower rung
replaces it. So this replacement works only against a correspondent whose
mail is not authenticated, or on first contact; within a rung the newest key
wins. Unlike the clients in [muller2020], this is never silent: each replacement
writes a key.peer.rotate audit row and, when RESPONSE_STAGE is set,
mails both fingerprints to the local recipients (A rotation is never silent),
and ACCEPT_ROTATION = expired refuses it. But it needs no CA at all, only
a forged From: (Keys of correspondents, Autocrypt and in-band key exchange open to key injection and MITM).
The optional LDAP method (not in the Debian build) permits anonymous
ldap://, though it requires the returned certificate to name the looked-up
address. A replayed signed message verifies again only within
MAX_SIGNATURE_AGE_DAYS (default 7) of its signing time, measured against
this host’s arrival time; an older one is valid-untrusted
(withheld=old-signature), a signature without a creation time is not
judged, and finer freshness needs the sender to protect its headers
(Signature spoofing via partial signing and MIME/CMS wrapping). And the operator can bind a key
to an address that the key does not name: pepsi-keys peer import only warns on a
mismatch and stores address-less keys and *@domain entries, the analogue
of Google’s setting; POST /api/v1/peers refuses the mismatch.
96.7.4. Missing or incorrect checks¶
A signature, certificate, policy or input that is not checked, or checked wrongly.
96.7.4.1. Revocation not checked or soft-failed by clients¶
X.509 says how to recognise a revoked certificate but not what to do when no status can be obtained, and the CRL distribution point and OCSP pointers are optional, non-critical extensions; relying parties therefore decide for themselves, and almost all of them decide for availability. Measurements spanning a decade agree. In 2014 almost 85% of 66 million HTTPS certificates carried neither a CRL nor an OCSP pointer, and with OCSP blocked by a firewall most browsers opened a site with a revoked certificate without a warning, while Outlook 2010 displayed an e-mail signature as “valid” and only its detail view said “not verifiable” [koschuch2014]. In 2015, after Heartbleed, over 8% of fresh certificates were revoked, yet no desktop browser checked the whole chain with hard-fail, Chrome’s CRLSet covered 0.35% of revocations, several browsers took an OCSP “unknown” as good, and no mobile browser checked anything [liu2015]; later studies found no mobile browser querying OCSP or CRLs and only Firefox detecting 14 of 35 revoked certificates [luo2023], browsers checking only the leaf or nothing at all and all of them soft-failing [berbecaru2023], and at least 82-87% of clients in the wild accepting a revoked certificate even though CAs revoked within a median 3.2 hours; most browsers even cached a soft-fail and kept accepting after the responder became reachable again [friess2023]. TLS interception products fetched no revocation data or soft-failed [wazan2020]. Stapling does not close the gap, because an attacker with a stolen certificate simply does not staple; only OCSP Must-Staple (RFC 7633) does, and almost nobody enforces it [zulfiqar2021] [khan2023] [clark2013].
The consequence is that a certificate revoked after key compromise or
mis-issuance stays usable until it expires: an on-path attacker blocks the status
lookup, or the client never asks. Mail is no exception. openssl smime performs
no revocation checking at all, when encrypting to a recipient certificate or when
verifying a signer [openssl2024], and S/MIME clients are reported to fail
silently on expired, untrusted or revoked certificates, while OpenPGP revocations
depend on the key owner publishing a revocation certificate and on keyservers
propagating it [ghanta2025]. Proposed remedies are hard-fail with stapling and
Must-Staple, short-lived certificates, and pushed revocation sets such as CRLite.
Pepsi: Partly addressed. Impact: low.
Pepsi checks S/MIME certificates against CRLs on both paths, and soft-fails by
decision. pepsi-keydisc fetches the CRLs that the cached S/MIME
peer certificates name in cRLDistributionPoints (http:// and
https:// only) into pepsi.crl_cache, refetching at each list’s
nextUpdate and at least daily (pepsi-keydisc/src/crl.rs), and
pepsi-stage-decrypt hands the current lists to pepsi_crypto::trust. A
list counts for a certificate only if the issuer’s key signed it, it is current,
and its scope covers the certificate (pepsi_crypto::crl::covers refuses a
partition for another distribution point, a delta, an indirect or a
reason-limited list). A listed serial makes the signature bad
(revoked), so neither state.signature_verified nor the [verified]
tag is set; the cache never replaces a list with an older one, so a replayed
pre-revocation list cannot clear a certificate. On the encryption path the
check is made once, where the list is stored. A list signed by an enabled trust
anchor of the issuer’s name, or by a fetched intermediate that path-validates to
one (under CA_ISSUERS_FETCH), retires every cached certificate that it names
(peer_key.validity = revoked, pepsi_keydisc::crl::retire_revoked), and
the shared lookup then hands the row to no stage, so pepsi-stage-encrypt
treats the recipient as one without a key (ON_NO_KEY, reason revoked).
A list that nothing so anchored has signed retires nothing, since a forged list on the
plain-HTTP path to a distribution point would otherwise downgrade a
correspondent to cleartext. One path hard-fails: a submitting client’s certificate under
TLS_AUTH_CLIENT_CA is accepted only when every certificate of its path
that names a distribution point is covered by a current list that its issuer
signed, and pepsi-ingress answers MAIL FROM with 451 until the
list is fetched (pepsi-ingress/src/smtp/clientcert.rs). The outbound TLS
clients (relay, key discovery) fetch no revocation data and act only on a
verified revoked OCSP response that the server staples, which fails the
session wherever the certificate is validated (Revocation of TLS peers: stapled OCSP only,
Replayed OCSP responses and stale revocation windows). An absent staple is the soft-fail
that the literature describes.
What remains is the soft-fail the clients above share, chosen deliberately: an
attacker who blocks or delays the fetch, a CA that publishes no distribution
point, or a list that is unobtainable, stale or out of scope leaves the verdict
at not-checked, and a revoked certificate then still verifies. Pepsi at least
never reports “not looked” as “fine”: the state is recorded as not-checked
and not-revoked only when every certificate in the chain was covered. Pepsi
queries no OCSP responder, so the CA never learns which certificate was checked or when
(OCSP and certificate URL fetches leak activity to third parties); a recipient certificate issued by an
intermediate CA that was not fetched, or that does not chain to an enabled
anchor, is never retired, since pepsi-stage-encrypt validates no X.509
chain and the fetcher trusts a list only through a verified chain to the
anchors that it holds. The gap
is not widened by a signer-chosen validation instant: the chain is validated at
processing time, never at the claimed signingTime
(Signer-chosen signing time used for certificate validation).
OpenPGP is in better shape. Revocation travels inside the certificate and is
honoured whenever the stored copy carries it (trust::key_revocation), keys
from network sources are re-fetched after refresh_after through the method
they were learnt from (pepsi-keys peer refresh), a re-fetched copy is merged
into the stored one (OpenPGP subkey and user ID binding signatures not verified), and Pepsi’s
own identities are revoked through pepsi-keys, which also publishes the
revocation certificate (Key management). Harvested, gossiped and
hand-entered keys are not refreshed over the network, so a revocation of such a
key is learnt about only when its holder sends the revoked certificate again or
discovery finds it for that address.
For a certificate whose CA publishes no usable list the workaround stays
manual: pepsi-keys peer remove or pepsi-keys ca disable. A hard-fail
policy for “revocation unknown” was decided against, because it would make mail
depend on CA endpoints.
96.7.4.2. Missing CA and chain constraint checks (basicConstraints, pathLen, keyUsage)¶
RFC 5280 restricts which certificates may issue others and for what a leaf may be
used: an issuer must assert basicConstraints cA=TRUE and the
keyCertSign key usage, pathLenConstraint bounds how many intermediates may
follow, and a leaf’s keyUsage and extendedKeyUsage limit its purpose.
Implementations repeatedly skipped these checks. With “frankencerts”,
Brubaker et al. found in 2014 that MatrixSSL treated any v1 certificate as a CA and
GnuTLS accepted any v1 intermediate (CVE-2014-1959), that path lengths, CA key
usage and leaf key usage and EKU went unchecked in several libraries, so that a
code-signing or client certificate passed as a TLS server [brubaker2014].
Symbolic execution of small TLS libraries found EKU OIDs compared by the sum of
their bytes (wolfSSL, MatrixSSL), a pathLenConstraint of 0 turned into
“unlimited” by a pointer bug, and pre-v3 certificates assumed to be CAs
[chau2017]. NSS, OpenSSL, GnuTLS and MatrixSSL accepted v1/v2 intermediates as
CAs although RFC 5280 6.1.4(k) forbids it unless they are confirmed out of band
[chen2018a], and GnuTLS and wolfSSL accepted further profile violations such as
an end-entity certificate with name constraints [chen2018]. Barenghi et al.
showed that 1,369 certificates issued by trusted CAs carried keyCertSign
without basicConstraints, and that OpenSSL 1.0.2g and BoringSSL accepted such
a leaf as an intermediate for an arbitrary domain [barenghi2018]. Browsers still
ignored root-imposed path lengths and accepted leaves asserting keyCertSign in
2023 [luo2023], and Botan accepted an end-entity certificate whose DN equalled a
trust anchor’s without further validation (CVE-2026-34580) and once returned
“allowed” for a multi-usage key-usage check if any one usage was allowed
(CVE-2016-6879) [botan2024]. The holder of any v1, constrained, leaf or
other-purpose certificate can then issue certificates that a broken validator
accepts for any name.
Pepsi: Addressed. Impact: none.
S/MIME path validation is Pepsi’s own (pepsi_crypto::trust::validate with the
constraints submodule), over certificates decoded by the RustCrypto
x509-cert crate. find_issuers accepts a candidate issuer, anchors included,
only if basicConstraints says cA=TRUE, its keyUsage permits
keyCertSign, it is valid at the validation instant and its key actually
verifies the subordinate certificate’s signature. A v1 or v2 certificate has no
basicConstraints and so can never issue (stricter than RFC 5280’s out-of-band
allowance), and a leaf that carries keyCertSign without cA=TRUE, as in
the Barenghi proof of concept, is refused as an issuer. pathLenConstraint is
enforced over the finished chain by constraints::check_path, including the
anchor’s own (RFC 5937). For the leaf, check_leaf requires the keyUsage bit
for the operation (digitalSignature/nonRepudiation to verify) and
emailProtection; a keyUsage extension that cannot be decoded grants
nothing rather than everything, and a broken basicConstraints leaves
cA=FALSE. A pinned certificate is matched by its exact DER, never by name, so
the Botan trust-anchor-DN shortcut has no analogue. NIST PKITS section 4.6 (basic
constraints) passes in pepsi-crypto/tests/pkits.rs.
Two remarks do not change the verdict. An absent EKU or anyExtendedKeyUsage
counts as emailProtection, as RFC 8550 allows; what that permits is assessed
under Weak binding between signer certificate or key and the From address. And certificates used for encryption are
not path-validated at all; their provenance on the trust ladder decides. Even
so, pepsi-crypto refuses a recipient certificate without
emailProtection and the matching keyEncipherment/keyAgreement bit
(Keys of correspondents). TLS server chains are validated by rustls and webpki, not
by this code; the client certificates that pepsi-ingress accepts under
TLS_AUTH_CLIENT_CA do run through this validator, with id-kp-clientAuth
and digitalSignature required on the leaf in place of emailProtection.
96.7.4.3. Divergent and non-compliant X.509 path validation across libraries¶
RFC 5280 path building and validation is intricate and leaves many choices open,
so independent implementations disagree on the same input, and every
disagreement means at least one of them is wrong. Differential testing has made
this measurable. Chen et al. reported over 20 discrepancies and 357 triggering
certificates, among them PolarSSL accepting repeated extensions and
mis-parsing multi-valued RDNs [chen2015]; MatrixSSL and mbedTLS compared validity
against local time and MatrixSSL granted a 24-hour grace period on both ends
[chen2018a]; RFCcert-style testing found OpenSSL and NSS accepting v1
certificates with extensions, GnuTLS reading a malformed UTCTime as a date in
1900, and wolfSSL and mbedTLS accepting a certificate whose authority key
identifier or issuer name does not match its issuer [sadt2020]. Zhu et al.
traced 71 differences in five widely used implementations to 17 root causes, such
as chaining through empty names, which of two duplicated extensions counts, and v1
certificates with extensions [zhu2020]; Paracha et al. found GnuTLS accepting
February 31 and leap seconds, OpenSSL and GnuTLS accepting a critical certificate
policies extension with arbitrary content, and OpenSSL accepting addresses with
several @ [paracha2026]. Browsers accept leaves whose CN is missing from the
SAN and ignore basicConstraints errors in leaves [luo2023], interception
products validate the certificates they replace poorly [wazan2020], and formal
work found Chrome not checking an anchor’s validity and OpenSSL treating
notAfter as exclusive [lin2025]. Path building is a separate source of
failure: OpenSSL stops after the first candidate chain fails instead of trying an
alternative, the bug class behind the 2020 expired-root outage [lin2025]. Trail
of Bits’ x509-limbo runs one vector suite against many validators and has found
bugs including a GnuTLS out-of-bounds copy on long chains (CVE-2024-28835) and
fixes in Go and rustls-webpki [trailofbits2023]. Older surveys list NUL bytes and
encoding differences in names, MD5 rogue CAs and libraries used without host-name
checks [meyer2013]. Most divergences are not exploitable on their own, but they
mean that “valid” is not one property, and some of them, such as duplicated
basicConstraints and lax dates, are preconditions for real bypasses.
Pepsi: Partly addressed. Impact: low.
Pepsi’s S/MIME validator is one more implementation, so this issue is about how
far it follows RFC 5280. Most of the listed divergences are closed by design.
Validity is compared in UTC as Unix seconds with no grace period, against dates
decoded by the strict DER decoder of the der crate; an unknown certificate
version cannot be decoded; an issuer is found by subject name and a verifying
signature, so a mismatching authority key identifier or a misleading name cannot
make another certificate the issuer; the outer and inner signature algorithm
identifiers must agree (verify_certificate_signature); the anchor’s own
validity and constraints are checked; and identities are never taken from a
subject CN. The constraints module treats a duplicated constraint extension,
or a duplicated policy OID, as unprocessable. Conformance is pinned by NIST PKITS
4.6 and 4.8-4.13 (pepsi-crypto/tests/pkits.rs), the mutation sweep in
pepsi-crypto/tests/sweep.rs and the cms fuzz target. TLS server chains
are validated by rustls and webpki, which x509-limbo exercises; inbound client
certificates (TLS_AUTH_CLIENT_CA) go through Pepsi’s validator.
x509-cert does not enforce RFC 5280’s “extensions only in v3”, and would let
the last of two duplicate subjectAltName, keyUsage, extendedKeyUsage
or basicConstraints extensions win; certificate_facts therefore reports a
repeated extension OID, extensions in a non-v3 certificate and unique
identifiers in a v1 certificate as a structural_defect, which the trust
module refuses for a leaf and for an issuer. build_path tries every qualifying issuer
depth-first, trust
store first, bounded at 64 attempts, so a dead-end issuer cannot hide a valid
chain (tests in pepsi-crypto/tests/trust.rs). x509-limbo runs on request
against a pinned release, without vendoring it (PEPSI_X509_LIMBO,
pepsi-crypto/tests/limbo.rs, Test Suite): the 929 of its cases that map
onto an S/MIME validator (not the ones that fail only on a DNS or IP peer name,
TLS extended key usage, ML-DSA or the Web PKI’s own profile) all agree with
limbo but two, both a CA certificate in leaf position whose keyUsage is
keyCertSign alone, which an S/MIME leaf may not be; the test pins that list.
The x509 fuzz target builds signed chains with names of every form and
permitted and excluded subtrees, so the name-constraint matchers are searched
directly, and asserts that a name inside an excluded subtree never validates.
The signer does not choose the validation instant: the chain is validated at
processing time (Signer-chosen signing time used for certificate validation). What stays open is what
the literature says of every validator: one more implementation is one more
reading of RFC 5280, and differential suites shrink, not close, the room for
divergence.
96.7.4.4. X.509 name constraints not enforced or bypassed¶
A nameConstraints extension limits the namespace for which a CA may issue
certificates: permitted
and excluded subtrees per name form (rfc822Name, dNSName,
directoryName, iPAddress, URI). It is what makes it safe to trust a
partner’s sub-CA, and a validator that drops or misreads part of it lets a
constrained CA, for example one that is compromised or contractually limited,
issue for anybody. Botan’s history shows how many ways there are to get it wrong
[botan2024]: when both permitted and excluded subtrees were present only the
permitted ones were kept (CVE-2024-39312, fixed in 2.19.5 and 3.5.0), constraints were applied to the subject DN but not to directory names in the
SAN (fixed 2.15.0), a mixed-case CN escaped an excluded DNS constraint in the CN
fallback (CVE-2026-32884), DN decoding lost structure relevant to DN constraints
(CVE-2026-48057), and checking was quadratic in the number of names and
constraints (CVE-2024-34702). RFC 9525 adds a structural trap: constraints apply
only to the name forms they list, so a CA constrained for DNS names is
unconstrained for SRV or URI identifiers that a client also accepts, and an IPv4
literal is also a syntactically valid DNS name, so two components may each assume
the other enforced the rule [rfc9525].
Pepsi: Addressed. Impact: none.
pepsi_crypto::trust::constraints enforces nameConstraints over the whole
chain, the anchor’s own included (RFC 5937), with both permitted and excluded
subtrees and per-CA permitted sets that every name must satisfy. The names
checked are the subject DN, every SAN entry and every PKCS#9 emailAddress in
the subject DN, the last always and not only when the SAN is empty, because
certificate_facts binds a message to that attribute; comparisons are ASCII
case-insensitive, and Pepsi never takes an identity from a CN. A name form Pepsi
does not implement (otherName, ediPartyName, registeredID) is refused
as soon as a certificate below a constraint of that form carries such a name, and
an undecodable or duplicated nameConstraints refuses the path whether or not
it is critical, so a constraint is never silently dropped. MAX_NAME_COMPARISONS
(2^20) bounds the quadratic work. NIST PKITS 4.13 passes in
pepsi-crypto/tests/pkits.rs, and tests/data/nc/ covers what PKITS lacks
(case folding, look-alike names, wildcards, otherName, the anchor’s own
bound). TLS server-name matching is done by webpki, not by this code; the chains
of submitting clients’ certificates (TLS_AUTH_CLIENT_CA) are checked by this
module.
The classification problem of [rfc9525] arises for one S/MIME identity source,
and is closed there. An RFC 9598 SmtpUTF8Mailbox is an otherName, yet it
is bound to From: as an identity (Weak binding between signer certificate or key and the From address), so the
constraint check treats it as the same mailbox namespace as rfc822Name, as
RFC 9598 section 6 requires: it is checked against the rfc822Name subtrees
by its domain, compared as lower-case A-labels octet for octet (whether the
certificate spells the domain with U-labels or A-labels), a bare host exactly
and a leading-dot domain as a suffix. A subtree naming one mailbox has an ASCII
local part that a non-ASCII one never equals, so it admits no
SmtpUTF8Mailbox, while an excluded mailbox subtree excludes its whole
domain for such names; a value with no comparison form is refused under any
rfc822Name constraint, and an otherName subtree still refuses it. A
partner CA anchored with rfc822Name subtrees alone therefore cannot issue
an internationalised mailbox outside them (NameState::allows; the
utf8-* fixtures in tests/data/nc/).
96.7.4.5. Unrecognised or malformed critical extensions accepted¶
RFC 5280 section 4.2 requires a relying party to reject a certificate carrying a
critical extension it does not recognise, or a critical extension whose content it
cannot process: criticality is how an issuer says “honour this restriction or do
not use the certificate”. Libraries routinely ignore it. Debnath et al. found
GnuTLS accepting random bytes as the value of any extension, even a critical one,
and OpenSSL doing so for certificate policies and authority information access,
alongside acceptance of undefined version 4, v1 certificates with extensions,
zero serial numbers, empty names and 1024-bit RSA keys [debnath2021]; a follow-up
across more libraries found OpenSSL, GnuTLS and wolfSSL accepting a critical
certificate policies extension filled with random bytes, MatrixSSL and the Java
provider doing likewise, and weak version checks in Go and certvalidator
[debnath2024]. Chen et al. show the parser-side cause: ZCrypto read a critical
nameConstraints as non-critical and did not parse criticality of key usage,
basic constraints or policies, and Go did not parse the outer
signatureAlgorithm and so could not see a mismatch with the inner one (fixed in
Go 1.16) [chen2023]. When the critical flag is lost, a rejection the issuer asked
for becomes acceptance, and a constraint written into an unprocessable extension
constrains nothing.
Pepsi: Addressed. Impact: none.
pepsi_crypto::smime::certificate_facts records every critical extension that
either has no handler or whose value fails to decode, and trust::check_leaf
refuses such a leaf with Failure::PolicyRejected before any path is built;
find_issuers skips an issuer with the same defect and reports
PolicyRejected rather than “unknown issuer” when no other issuer works. The
extensions Pepsi recognises are decoded with x509-cert, which carries the
critical flag (DEFAULT FALSE) as parsed. The constraint extensions –
nameConstraints, policyConstraints, inhibitAnyPolicy – refuse the path
when malformed even if marked non-critical, a malformed certificatePolicies or
policyMappings collapses the policy tree, and a malformed non-critical
keyUsage grants nothing. The outer and inner signature algorithms must match
(verify_certificate_signature), and an undefined certificate version cannot be
decoded. What remains is non-critical and minor: a SAN that fails to decode in a
non-critical extension yields no address, which then reads as “names no address”
(Weak binding between signer certificate or key and the From address). Extensions in a v1 or v2 certificate and a
repeated extension are refused as a structural_defect
(Divergent and non-compliant X.509 path validation across libraries).
96.7.4.6. CRL and OCSP data accepted without proper parsing or signature checks¶
Revocation data is only worth anything if it is authenticated and decoded exactly as RFC 5280 and RFC 6960 prescribe, yet the parsers and validators that consume it have repeatedly been lenient or simply skipped the checks. Chen et al. generated 1,760 mutated CRLs from historical bug reports and RFC rules and differentially tested OpenSSL 3.5.0, GnuTLS 3.8.9, wolfSSL 5.7.6, Go and Python Cryptography in 2025/26: they found 60 discrepancies, 23 confirmed and 16 fixed, among them negative serial numbers in the Authority Key Identifier decoded as other positive values, duplicate AKIs, malformed time fields and impossible flag combinations accepted [chen2026a]. Two findings are directly exploitable: OpenSSL skipped the revocation check altogether for a CRL carrying two AKI extensions, so a revoked certificate stayed usable, and GnuTLS looked up serial numbers in a CRL whose own signature was invalid, so whoever can place a CRL can make a valid certificate appear revoked (a remote denial of service) [chen2026a].
OCSP has the same failure on the other side. The Botan library did not check that a
responder certificate embedded in an OCSP response was authorised by the issuing CA
(CVE-2022-43705, fixed in 2.19.3/3.0.0), so any certificate could vouch for the
status of any other CA’s certificates; from 3.0.0 to 3.11.0 path validation did not
verify the response signature at all (CVE-2026-32883), the ocsp_check tool
accepted unsigned responses, and following a responder redirect gave a blind
server-side request forgery [botan2024]. An attacker who can supply responses (a
network position, or a malicious server stapling them) makes a revoked certificate
look good or a good one look revoked. The fixes are uniform: verify the signature,
issuer and authorisation of every CRL or OCSP response, and its validity window,
before using a single entry from it.
Pepsi: Addressed. Impact: none.
The only OCSP responses that Pepsi consumes are those that a TLS server staples,
and they, like the CRLs that it consumes, are verified before they are acted on. pepsi-keydisc fetches CRLs from the
distribution points of cached S/MIME certificates (pepsi-keydisc/src/crl.rs),
over an unauthenticated channel as RFC 5280 intends, and stores them whether or
not it can verify them; at store time it acts on a list only if an enabled
ca_trust anchor with the issuer’s name and cRLSign signed it and it is
current (pepsi_crypto::crl::verify), retiring the cached certificates that
such a list names, and pepsi-stage-decrypt hands the stored lists to
pepsi-crypto, which opens no sockets. There a
CRL counts as evidence only if crl_usable accepts it: it must be signed (with
the signatureAlgorithm consistency rule of RFC 5280 section 5.1.1.2, in
smime::verify_crl_signature) by the key of the issuing certificate, and that
certificate’s keyUsage must permit cRLSign. The issuing certificate is the
next certificate of the chain or, for a pinned leaf, a supplied anchor or key of
that name. The CRL’s thisUpdate must not lie after the validation time, and
the CRL must carry a nextUpdate that has not passed. Its scope must also cover the certificate (pepsi_crypto::crl::covers):
an issuingDistributionPoint naming another distribution point, an indirect,
reason-limited or delta CRL, or any critical CRL extension that the verifier does
not process makes the list no evidence for that certificate. Anything else is skipped
as no evidence, so neither an unsigned, a stale nor an out-of-scope CRL can make a
chain “not revoked”, and none can revoke a certificate on somebody else’s
authority. The cache refuses to replace a list with an older one, so a replayed
genuine list cannot roll a revocation back. Issuers are still matched by their
string form and the AKI is not consulted, which matters only once a CA rolls its
CRL-signing key: a list signed by the old key then simply fails to verify. On the
outbound TLS side rustls is given no CRLs, and the stapled OCSP response that
it hands over is evaluated by pepsi_common::smtp::ocsp under RFC 6960 section
3.2. The response must be signed by the certificate’s issuer or by a responder
certificate that the issuer signed with id-kp-OCSPSigning (Botan’s missing
authorisation check); its CertID must name the certificate by serial and the
issuer’s name and key hashes; and its thisUpdate/nextUpdate window must
contain the handshake. A response that fails any of these is no evidence, and
only a verified revoked changes anything (Revocation of TLS peers: stapled OCSP only). The
inbound client-certificate path of pepsi-ingress consumes the same cached lists
through pepsi_crypto::crl::verify and covers, under the same rules.
OpenPGP revocations are
signatures inside the certificate and are verified by sequoia like any other
self-signature. Where no usable CRL is at hand revocation soft-fails, assessed
under Revocation not checked or soft-failed by clients and
Certificates without revocation pointers or a validatable chain.
96.7.4.7. OpenPGP subkey and user ID binding signatures not verified¶
An OpenPGP certificate is a bundle of packets, and only its signatures bind them
together: a User ID belongs to the key only if the primary key self-signed it, a
subkey only if the primary key signed a binding signature, and a signing subkey
only if that binding also embeds a “back signature” made by the subkey, because
otherwise anyone can bind somebody else’s public signing subkey to their own
primary key. GnuPG documents both checks and the options that switch them off:
--allow-non-selfsigned-uid lets a key carry a User ID that anyone could have
attached, and --no-require-cross-certification accepts signing subkeys without
a back signature [gnupg2024]. Groves et al. found that GnuPG’s handling of
local trust packets could be abused to attach arbitrary subkeys to a key
[groves2025b].
The same class keeps recurring in libraries whose code paths disagree about a key’s capabilities. In sequoia-openpgp, when a binding lacks a Key Flags subpacket one part of the library infers that the subkey can sign while the check that demands the back signature does not, so an attacker can graft a victim’s signing subkey onto their own certificate and the victim’s genuine signatures then verify under the attacker’s identity (CVE-2026-42784, CVSS 7.4, fixed in distribution packages in September/October 2026; the record names no upstream version) [cve-2026-42784]. Bouncy Castle for Java before 1.86 had the identical flaw (CVE-2026-71887) [cve-2026-71887], and it also attributed a third-party certification or introducer delegation to a certificate’s primary key when it was made by a subkey lacking the certification flag, so a compromised signing-only subkey could certify identities in the name of an offline primary key (CVE-2026-71886) [cve-2026-71886]. The consequence in every case is misattribution: a real signature reported under the wrong identity, or an identity vouched for by a key that had no authority to do so. The fixes are to use one source of truth for key flags, demand back signatures for every signing-capable subkey, and use only User IDs and certifications that carry a valid binding.
Pepsi: Partly addressed. Impact: low.
Pepsi verifies OpenPGP through sequoia-openpgp, locked at 2.4.2. In that
version’s source, the back signature is demanded only when the binding signature’s
own Key Flags say “signing” (cert/bundle.rs, cert/lazysigs.rs), while the
capability test that the verifier applies (ValidKeyAmalgamation::for_signing)
falls back to the primary key’s direct-key signature when the binding has none.
That is the inconsistency that CVE-2026-42784 describes, and a test reproduces it.
In the test, a victim’s signing subkey is grafted onto an attacker’s certificate
with no flags and no back signature in its binding; the attacker’s direct-key
signature makes it signing-capable, and a signature by it verified as Good. No fixed release and no RustSec advisory exist
(October 2026), so Pepsi checks this itself (trust::signing_binding_ok,
called from key_health): a signature by
a subkey is reported as Bad(WrongKeyUsage) unless that subkey’s own binding
signature carries Key Flags with signing and a valid embedded back signature.
User IDs are read through the policy-validated certificate: pgp::user_ids
(used by select_matching in pepsi-keydisc/src/wkd.rs, by harvesting and by
pepsi-keys import) and trust::cert_addresses, which binds a signer to the
From: address, count only User IDs with a valid self-signature that are not
revoked, so a certificate carrying a victim’s key and an unbound User ID of the
attacker’s address does not re-attribute the victim’s signed mail. Third-party
certifications and trust delegations (CVE-2026-71886) are not evaluated anywhere
in Pepsi, and trust packets are ignored by sequoia’s parser and never stored, so
those variants do not apply.
The related import weakness is closed too: a writer that replaced the stored
copy whenever it saw the same fingerprint again would let a forged From:
carrying an older copy of a correspondent’s Autocrypt key roll a revocation back.
Every writer (key discovery, harvesting and so pepsi-stage-autocrypt-learn,
pepsi-keys peer import and the API import) merges the stored and the
incoming copy with Cert::merge_public in one transaction under the upsert’s
lock (pgp::merge_public_material, upsert_peer_key_merging), keeping only
verified self-signatures, so a revocation is never lost and an attacker cannot
grow the stored certificate. A copy from a source ranked below the stored row
is merged too (db::store_merged): its revocations and newer self-signatures
reach the stored key and set its validity to revoked without changing the
row’s source, rank or which key is used, while a weaker source still cannot
replace a different key. What remains is the dependency: update sequoia once a
release fixes CVE-2026-42784, so that the interim check is not the only
defence.
96.7.4.8. Security-critical data taken from unhashed signature subpackets¶
An OpenPGP signature carries two subpacket areas, a hashed one that the signature covers and an unhashed one that anybody can edit without invalidating it, and the standards long did not restrict which subpacket types may appear unhashed. Ralf Senderek showed in 2000 that PGP 5.5.3i and 6.5.1i honoured an “additional decryption key” placed in the unhashed area of a self-signature: an attacker could add his own key to anybody’s public key on a key server, and every sender who fetched it encrypted each session key to the attacker as well, without being told [schwenk2022]. Barenghi et al. described the same pattern for designated revocation keys (letting an attacker revoke a victim’s User ID binding) and for algorithm-preference subpackets (steering senders towards weak algorithms); GnuPG 2.1.18 and Symantec PGP 10.4 were not exploitable, since they ignored or refused the modified signatures, and the authors asked for the specification to require all security-relevant subpackets in the hashed area [barenghi2017a]. The rule that every implementation must follow is to take nothing security-relevant from the unhashed area.
Pepsi: Addressed. Impact: none.
Pepsi reads subpackets only through sequoia-openpgp, whose
SubpacketAreas::subpacket consults the unhashed area for exactly three types,
Issuer, Issuer Fingerprint and Embedded Signature, all of which are verified
cryptographically before they matter, and ignores every other unhashed subpacket.
Key flags, preferences, features (used for the SEIPDv2 negotiation in
trust::supports_seipdv2), expiry and designated revokers therefore come from
the signed area only. Pepsi’s own code never reads a subpacket area directly, and
sequoia implements no additional decryption key. Keys that Pepsi generates
(pepsi-crypto/src/keygen.rs, via sequoia’s CertBuilder) put their
preferences in the hashed area, so a key server cannot narrow them either.
96.7.4.9. WKD submission protocol and server publish keys for unverified addresses¶
The Web Key Directory Update Protocol lets a user publish a key by mailing it to
the provider, which answers with a confirmation request encrypted to the submitted
key; the reply proves that the submitter can read the address’s mail. Breuch analysed
draft version 14 and GnuPG’s reference server in 2022 [breuch2022]. The protocol
rests on the assumption that “a mail provider can securely deliver mail to the
INBOX of a user”, without saying which hops and providers this covers, so an
attacker who can read the confirmation anywhere on its way (an unencrypted SMTP
hop, an outsourced relay, IMAP without TLS) and forge a reply gets a key of their
choosing published for the victim’s address. Worse, gpg-wks-server in GnuPG
2.2.35/2.3.6 (and since 2016) compared neither the address nor the nonce of a
confirmation with the request, built file paths by concatenation (allowing
traversal to another domain), accepted unsigned responses or responses signed by
any key in its own keyring, and could be downgraded to an unsigned message format
[breuch2022]. An ordinary mailbox at a WKD provider was enough to publish a key
for any address in any domain that the server hosts, overwriting existing ones. The
thesis lists the missing checks and asks the specification to define “secure
delivery”; no fix was documented at the time.
Pepsi: Addressed. Impact: low.
Pepsi implements neither side of the Update Protocol, and its own WKD
(pepsi-httpd/src/endpoints/wkd.rs) serves only crypto_identity rows: keys
that Pepsi generated itself, or a user’s own client keys registered by
register_from_message in pepsi-stage-encrypt/src/identity.rs (every
active one, newest first, at most MAX_CLIENT_KEYS = 8, and never the MTA key
beside them). That registration does not trust mail delivery at all. It
requires the submitting connection to speak for the From: address (crypto_state::speaks_for_from:
SASL or peer-credential authentication bound to the address, a client certificate,
or a MYNETWORKS host), registers nothing from an ordinary message once the
address has a TOTP second factor (A second factor for key management), and tells the user when a
further key is added. The residue here is account compromise, covered in
Someone holding a user’s mail password, and the operator’s choice of MYNETWORKS: a loopback
entry, or a network that SENDER_MAP binds with *, can speak for any address,
while every other entry must be bound by SENDER_MAP (pepsi-ingress and
pepsi-setup validate refuse it otherwise) and speaks only for the addresses
bound to it.
The automated confirmation of a key-server upload could repeat the protocol’s
trust assumption: a confirmer that followed every link to the key server in an
authenticated verification mail addressed to an identity whose upload was
pending, and only afterwards asked the key server which key it serves for the
address, would click the request of an attacker who uploaded their own key with
that address and requested verification while the confirmation was pending.
pepsi-stage-vks-confirm therefore acts only on a mail that states the
fingerprint of the key of an identity awaiting confirmation (names_fingerprint,
grouped or unbroken, case-insensitive), and decides this before anything is
fetched; a confirmation for another key under the user’s address is delivered to
the user, not clicked, and a key server whose mail names no fingerprint is never
confirmed automatically, which fails safe. The preconditions were narrow anyway:
uploads are opt-in ([pepsi-keys] VKS_PUBLISH, default off), the stage must be
configured, and the window lasts only until Pepsi’s own confirmation arrives. A
key server that, when re-asked, serves another key for the address is reported
at warn with the address, the server and both fingerprints, and the identity
stays unverified (pepsi-stage-vks-confirm). What remains is the
operator’s: the choice of MYNETWORKS and the protection of the accounts
that can read an address’s mail.
96.7.4.10. WKD lookups follow redirects and accept oversized or polluting keys¶
A Web Key Directory client fetches keys from a URL derived from an address, so the
answer comes from a server that the address’s domain chooses. SektionEins showed in 2018
that GnuPG’s dirmngr, which looked keys up automatically since 2.1.23 (and was
driven by Enigmail as soon as an address was typed), built the URL from an
_openpgpkey._tcp SRV target that it did not validate as a host name, and followed
HTTP redirects to arbitrary URLs [sektioneins2018]. Whoever controls the
recipient’s DNS answer or WKD server could thus make the victim’s client send
requests to any host, port and path, including hosts on the victim’s internal
network (server-side or cross-site request forgery). The same client downloaded the
whole response before checking it, with no size limit, and imported every returned
key whose User ID matched the queried address, whatever else it contained, so a
malicious server could exhaust bandwidth and pollute the keyring. GnuPG 2.2.10
fixed the SRV handling and limited the download size, and 2.2.12 stopped following
redirects; the post gives no fix for the pollution [sektioneins2018].
Pepsi: Addressed. Impact: none.
pepsi-keydisc is the only component that fetches keys, through the hardened
client in pepsi-keydisc/src/http.rs: HTTPS only with certificate validation,
at most one redirect and only to the same host and port, every resolved address
checked by is_public so that loopback, private, link-local, CGNAT and
unique-local destinations are refused, a byte cap enforced while streaming, a
deadline over the whole exchange, and no SRV lookup at all (the URL is built from
the address’s domain or openpgpkey.<domain>). The response is parsed with
parse_untrusted_certs, which refuses compressed, encrypted or literal packets,
and select_matching in pepsi-keydisc/src/wkd.rs keeps a single certificate
whose User ID names the queried address (honouring the domain’s mailbox-only
policy, preferring an unrevoked one), so a response cannot plant keys for other
addresses (pepsi-keydisc). Lookups happen on the gateway when mail
is sent or a key is refreshed, never while a user composes. That User ID match
counts only User IDs with a valid self-signature that are not revoked
(pgp::user_ids, OpenPGP subkey and user ID binding signatures not verified).
96.7.4.11. Mismatched inner and outer certificate signature algorithm accepted¶
An X.509 certificate names its signature algorithm twice: inside the signed
tbsCertificate and in the outer, unsigned signatureAlgorithm field, and RFC
5280 requires the two to be identical. Chen et al. derived test certificates from
the modal rules of RFC 5280 and RFC 6818 and found that Chrome on Ubuntu (and
Internet Explorer, through the platform verifiers of Ubuntu and Windows) accepted a
certificate whose two identifiers differed, while the policy check that forbids weak
algorithms looked only at the inner one [chen2018]. A certificate could thus
declare SHA-256 while really being signed with SHA-1, and an attacker able to forge
such a signature would obtain a certificate that the client accepted, enabling
impersonation. Google fixed it in Chrome 58 (CVE-2017-5066) and Microsoft confirmed
it; the fix is to reject certificates whose identifiers differ [chen2018].
Pepsi: Addressed. Impact: none.
Pepsi’s own X.509 code enforces the rule for both certificates and CRLs:
verify_certificate_signature and verify_crl_signature in
pepsi-crypto/src/smime.rs return Malformed when signatureAlgorithm
differs from the inner field, before any algorithm decision is taken, and the
weak-digest policy (CRYPTO_ALLOW_WEAK_DIGESTS) is applied to the identifier
that was actually used. TLS certificates are validated by rustls-webpki, which
also rejects a signature-algorithm mismatch. The related substitution of algorithm
identifiers inside CMS signatures is assessed under
CMS signature and digest algorithm identifier substitution.
96.7.4.12. Autocrypt gossip key injection via future-dated mail¶
Autocrypt lets a sender “gossip” the keys of the other recipients inside an
encrypted group message, and a receiving client updates its stored key for an
address only from a message whose effective date is newer, where the effective date
is the Date: header capped at the time of receipt. Song, Marekova and Paterson
found in Delta Chat (core 1.132.0) that this cap was missing, and that a
legitimate verified group message promoted to “verified” whichever gossip key was
stored for each member rather than the key in that message [song2024]. Anyone who
knew the target’s public key could send a future-dated mail gossiping an attacker
key for a contact; it stayed in the table because no honest message was “newer”,
and the next legitimate group message marked it verified. This broke the
“guaranteed end-to-end encrypted” chats, allowed eavesdropping and
machine-in-the-middle, and spread the bad key to other group members. The flaw was
reported in February 2024 and fixed in Delta Chat 1.44 by marking as verified only
the gossip keys in the protected payload and capping the message date
[song2024].
Pepsi: Addressed. Impact: none.
Both halves of the flaw are absent. effective_date in
pepsi-keydisc/src/harvest.rs clamps the parsed Date: to the time of
processing (and uses that time when the header is missing or unparseable), and
crypto_peer_key_upsert clamps it again with LEAST(..., now()), so a
future date cannot pin a key ahead of later honest ones. Gossip never verifies
anything: pepsi-stage-autocrypt-learn stores a gossiped key on the lowest rung
of the trust ladder (rank 9, below both harvested rungs, which it can never
displace),
learns it only from mail that arrived encrypted, only for
To:/Cc:/Reply-To: addresses other than the sender, never for
addresses Pepsi serves, and pepsi-keymat maps it to an untrusted source, so
a signature checked against it
cannot reach valid (pepsi-stage-autocrypt-learn). Pepsi has no
verified groups whose status a later message could promote. What remains is the
inherent trust-on-first-use nature of gossip, which can still supply the key used
for an address that no better source knows; that is assessed under
Autocrypt and in-band key exchange open to key injection and MITM.
96.7.4.13. Autocrypt Setup Message forgery via unverified plaintext algorithm¶
The Autocrypt Setup Message moves a user’s secret key between devices, encrypted under a Setup Code that is meant to authenticate it as well. Song, Marekova and Paterson found that rPGP 0.10.2, the OpenPGP library under Delta Chat, accepted symmetric algorithm 0 (“plaintext”) when decrypting session keys and data, although RFC 4880 forbids it, so a substituted message “decrypted” correctly under any Setup Code; Delta Chat also accepted Setup Messages that were not self-addressed [song2024]. A network attacker, or one who could get the target to open a crafted message, made the target import and use a secret key that the attacker knew, and could then read the target’s future mail and impersonate them. rPGP disabled the plaintext algorithm and Delta Chat was advised to accept only self-addressed Setup Messages and to warn about phishing; the fixes shipped in March 2024 [song2024].
Pepsi: Not applicable. Impact: none.
Pepsi never imports a secret key from a message. It neither sends nor processes
Autocrypt Setup Messages, and its OpenPGP decryption helper in
pepsi-crypto/src/pgp.rs ignores password-encrypted session key packets (SKESK)
altogether, so no message can make it decrypt anything under a password. Mail can
only register a user’s public client key (register_from_message, see
WKD submission protocol and server publish keys for unverified addresses); private keys enter the key store only from
pepsi-keys or the administrative API, i.e. from the operator or the authenticated
owner (Key management).
96.7.4.14. Unauthenticated stored encrypt-to-self key replaced to read sent mail¶
Mail clients encrypt every sent message to the sender’s own key as well, so that the sent folder and drafts stay readable. Bruseghini, Paterson and Huigens showed in 2022 that the public key used for this was stored beside the protected private key without being authenticated by it [bruseghini2022]. An attacker with write access to the stored key, for example a FlowCrypt key backup restored from the inbox or a malicious ProtonMail server, replaces it with a key whose private part they hold, and then decrypts intercepted sent mail and drafts (and received mail where it is quoted). Checking one’s own key fingerprint would reveal the tampering, but, as the paper notes, users may not expect to have to check their own keys. After disclosure OpenPGP.js, gopenpgp, RNP, FlowCrypt and ProtonMail were patched; the structural fix is to bind the public parameters to the protected private key, for example as associated data of an AEAD encryption of the private key [bruseghini2022].
Pepsi: Addressed. Impact: none.
Pepsi does not encrypt outbound mail to the sender’s own key, but it stores the
same thing that the paper is about: a public half and fingerprint in the clear beside a
wrapped private key. That public half is not trusted unchecked. Private keys are wrapped under a key-encryption key bound by AEAD to the
row’s address, protocol, purpose and fingerprint (wrap format 2,
pepsi-common/src/keystore/wrap.rs; pepsi-keys wrap rotate re-wraps keys
stored under the older format 1, which binds no fingerprint), so a blob cannot be
moved to a row naming another key. Whenever a private key is opened
(check_public_half in pepsi-keymat) the stored public half and fingerprint
must belong to it, or the identity is refused and the event logged at error;
the Web Key Directory, which holds no key-encryption key, withholds a key whose
public half is not the key that its fingerprint names
(check_public_fingerprint). And restrict_private_key_column in
pepsi-setup/src/lib.rs takes INSERT on crypto_identity from every
ordinary service role and leaves UPDATE only on the flag columns
(is_primary, published, vks_wanted, plus the key-server progress
columns for pepsi), verified against PostgreSQL at setup, so neither the
internet-facing pepsi-httpd nor a pipeline stage can replace a user’s public
key or add a custody = client row; only the key-custody role pepsi-crypto,
which holds the key-encryption key anyway, and the operator can.
What remains is narrow. keydisc::lookup_own_first and
pepsi-stage-reencrypt read the public columns without opening the private half,
so they rely on the grants rather than on a pair check, and a service role keeps
DELETE (denial of service, not substitution) (The private-key custody boundary,
A compromised component).
96.7.4.15. Signer-chosen signing time used for certificate validation¶
A CMS signature may carry a signingTime attribute, but the signer chooses its
value. RFC 5750 warns that an S/MIME agent which uses it as the instant for
certificate validity and revocation checks lets a sender backdate a signature, so
that a signature made with an expired or revoked certificate is accepted, or a stale
CRL is consulted; the time used for validation MUST NOT come from signingTime
unless that is supplied by a trusted agent [rfc5750]. Only a trusted time source,
such as an RFC 3161 timestamp token or the time of receipt, constrains when a
signature was actually made.
Pepsi: Addressed. Impact: none.
pepsi-stage-decrypt validates an S/MIME signer’s certificate chain at the
time it processes the message, never at the claimed signingTime
(verify_one_signer in pepsi-crypto/src/smime.rs passes now_secs() to
trust::validate), so a signer holding the key of a certificate that has
expired cannot state a signingTime inside the old validity window and still
verify as valid. signingTime is reported as information
(signed_at) and is never an input to trust, as RFC 5750 requires. The cost
is the one that the RFC accepts: a signature whose certificate expired while the
message was in transit or queued does not verify as valid. Revocation is
judged at the same instant, against the CRLs current then
(Revocation not checked or soft-failed by clients). OpenPGP verification through sequoia follows the
OpenPGP convention of judging key validity at the signature’s own creation
time, which has the same backdating property for an expired (not a revoked)
key; revocations there are honoured.
96.7.4.16. Acting on signature presence without verification¶
Mail processing that changes behaviour because a message “is signed”, such as filtering rules or display hints, without first verifying the signature and knowing its state, treats a merely signed-looking message as authenticated. RFC 5751 warns against this and adds that cached indicators can go stale; it asks agents to verify the signature before acting on it and to re-check the status behind indicators that are meant to be current [rfc5751].
Pepsi: Partly addressed. Impact: low.
Every decision in Pepsi that depends on a signature uses the verified outcome.
pepsi-stage-decrypt is the only writer of state.signature_verified and sets
it only for a valid verdict from a signature that covers the plaintext
(not one wrapped around a ciphertext, nor one checked against an untrusted key);
pepsi-stage-check-whitelist requires that key to be explicitly true for a
signature_required entry; the subject tags and the X-Pepsi-Crypto header
are derived from the verdict, and the decrypt stage strips any X-Pepsi-* field
and forged subject tags that a sender supplies before adding its own
(What a security indicator means, pepsi-stage-decrypt). The record of
correspondents who usually sign (pepsi.signed_sender, consulted under
ON_MISSING_SIGNATURE) is written only from a valid signature bound to
From: that covers the plaintext, so a signed-looking message can neither
plant nor refresh it. Where Pepsi acts on mere presence it does so restrictively: ISOLATE_SIGNED drops unsigned content
beside signed parts before verification, which removes rather than grants
anything.
The residue is the staleness the RFC mentions. The [verified] tag and
X-Pepsi-Crypto are written into the delivered message and record the verdict at
the time of receipt; a key revoked later does not change them, and a mail client
that does not re-verify keeps showing the old verdict. Pepsi cannot update a stored
message, so the remedy is documentation (the indicators describe the state at
arrival) and, for users, re-verification in their client where the signature is
still present.
96.7.5. Deployment, configuration and credentials¶
Configuration errors, abandoned resources and weak, reused or stolen secrets.
96.7.5.1. CAs issue non-compliant or broken certificates¶
Relying parties are written against RFC 5280 and the CA/Browser Forum requirements, but certificate authorities routinely issue certificates that violate them, which pushes clients towards leniency and opens room for name-matching and chain-building disagreements. Kumar et al. linted about 240 million browser-trusted certificates with ZLint in 2017: only 0.02% had errors, but the low rate is due to a few large CAs, nearly half of the issuing organisations misissued more than 10% of their certificates and seventeen misissued all of them; common errors were a common name not taken from the subjectAltName, missing SANs or authority key identifiers, invalid characters in DNS names and e-mail addresses in server certificates. About 9% of OCSP responders were always offline, and 25 answered “good” for serial numbers that were never issued [kumar2018]. Zhang et al. found 249,300 non-compliant internationalised certificates (0.72%) from 373 issuers, 65% of them publicly trusted, with invalid ASN.1 string types, duplicated attributes, control characters and malformed IDNs [zhang2025b], and a scan of IPv6-reachable HTTPS sites found 249 RFC 5280 violations in 217 of 2,874 certificates, nearly all in CA certificates (missing CRL distribution points, extension errors, bad serial numbers) [zhang2020a]. In the Alexa top million of 2010, only 16% of HTTPS sites presented a certificate that authenticated correctly; name mismatches, self-signed and expired certificates and cheap domain-validated certificates trained users and clients to ignore failures [vratonjic2012]. The proposed remedies are linting before issuance, monitoring and distrusting CAs with poor practices, and making CAs liable.
Pepsi: Partly addressed. Impact: low.
As a relying party Pepsi is strict where it matters. S/MIME certificates are decoded
as DER by the RustCrypto x509-cert crate, path validation in
pepsi-crypto/src/trust.rs enforces basic constraints, key usage, EKU, name
constraints and policy constraints (trust/constraints.rs, checked against NIST
PKITS), refuses a certificate that repeats any extension or
carries extensions without being version 3 (policy-rejected), the signer is
bound to the From: address by rfc822Name and never by the common name,
submitting clients’ certificates (TLS_AUTH_CLIENT_CA) pass the same
validator, and TLS server certificates are validated by rustls-webpki, which
refuses most malformed certificates outright. The OCSP findings are moot
because Pepsi queries no responder and acts only on a verified revoked
answer that a TLS server staples.
Pepsi’s own certificates come from certbot (pepsi-setup) and from
pepsi-crypto/src/keygen.rs for S/MIME identities.
What remains is the leniency that compatibility forces. Pepsi accepts the address from
the subject’s PKCS#9 emailAddress attribute when a certificate has no
rfc822Name SAN, and accepts it encoded as UTF8String as well as the
specified IA5String (a UTF8String only when it is ASCII, the same
octets mis-tagged, and either only when it is a bare local@domain; a
non-ASCII UTF8String binds nothing), because much deployed S/MIME material is issued that way;
a stricter parser would leave such correspondents unverifiable. Conversely, a
non-conforming certificate that rustls-webpki rejects makes an authenticated TLS
delivery (MTA-STS, TLS_VERIFY) fail rather than silently succeed. The quality of
issuance itself is up to the CAs; the related parsing questions are assessed under
Lenient and divergent X.509/DER parsing of certificates and X.509 name parsing confusion (NUL bytes, multiple CNs, string types).
96.7.5.3. Stale certificates and missing revocation after key exposure¶
The PKI is valid by default: a certificate whose key may have been exposed stays valid until it expires unless its owner reissues and revokes it, a manual process, and clients rarely enforce revocation anyway. Zhang et al. used the Heartbleed disclosure of April 2014 as a natural experiment: three weeks later 73.3% of the certificates on vulnerable hosts had not been reissued and over 87% had not been revoked, 60% of reissued certificates were never revoked, and 4.1% of reissues reused the possibly compromised key pair, so a remote attacker who had extracted a key could impersonate the server for months [zhang2014]. Ma et al. generalised this in 2023 to “stale” certificates whose facts no longer hold: after key compromise (over 300 newly affected domains per day), a change of domain registrant (about 1,200 per day) or a departure from a CDN or hosting provider that still holds certificates for the domain (about 7,700 per day), over 9 million abusable instances across 4.5 million domains, usable for impersonation and interception of HTTPS and mail [ma2023]. Because revocation is ineffective, they estimate that 90-day certificates would cut staleness by roughly three quarters, and recommend that owners revoke after any exposure and monitor Certificate Transparency [ma2023].
Pepsi: Partly addressed. Impact: low.
Outbound TLS to an MX, a smarthost or a key-discovery host checks the one
revocation signal that reaches it without a query: a stapled OCSP response
(RFC 6960 over RFC 6066 status_request) is verified against the issuer or
its authorised responder on every session (pepsi-common/src/smtp/ocsp.rs),
and a revoked answer fails the session wherever the certificate is
validated at all (MTA-STS, TLS_VERIFY, TLS_CA_BUNDLE, the DANE
warn fallback), so a receiving domain that revokes an exposed key and
whose server staples stops authenticating here at once
(Revocation of TLS peers: stapled OCSP only). No CRL is fetched and no responder queried for a
TLS peer, by decision: a query names the certificate to the CA and makes
delivery wait on a third party. So a server that staples nothing, which is still
the common case for MX hosts, keeps authenticating with a stale certificate and
key until it expires; DANE (DANE = strict, the default, RFC 7672) ties
such a session to the key that the domain currently publishes, and only if the
domain updates its TLSA records. The inbound client certificate is checked
harder: a submitting client’s chain under
TLS_AUTH_CLIENT_CA is accepted only when the lists that pepsi-keydisc keeps
in pepsi.crl_cache cover it, fail-closed, so a client certificate revoked
after exposure stops authenticating once its CA lists it. S/MIME is checked on
both paths, soft-fail: signer
chains are checked against the CRLs that pepsi-keydisc fetches for cached peer
certificates (Certificates without revocation pointers or a validatable chain), so a signer certificate
revoked after a key compromise stops verifying once its CA lists it, and a list
signed by an enabled ca_trust anchor retires the cached peer certificates
that it names, after which pepsi-stage-encrypt treats their owner as having no
key; under CA_ISSUERS_FETCH so does a list signed by a fetched
intermediate that path-validates to an enabled anchor. A list retires nothing
if the fetcher cannot verify it (because it comes from an intermediate that was
not fetched or does not chain to an enabled anchor) or if it is stale or
unobtainable, so such a revoked certificate keeps receiving encrypted mail until it expires
or is removed (Revocation not checked or soft-failed by clients). OpenPGP is better served:
revocations inside certificates are honoured, the refresh timer re-fetches keys
through the method they were learnt from, and a re-fetched copy is merged into
the stored one, so a replayed older copy cannot undo a revocation
(OpenPGP subkey and user ID binding signatures not verified).
For its own keys Pepsi limits staleness: certbot certificates last 90 days, and
every revocation of an OpenPGP identity whose private half the gateway holds
first signs a revocation certificate, whichever way it is started
(pepsi-keys identity revoke, the retire e-mail command, the console’s or
API’s revoke-identity task). The Web Key Directory then serves that
certificate (the key shown as revoked), and it is uploaded to the key server if
the key had been uploaded there; if the certificate cannot be made, nothing is
revoked (Revocation publishes what it can). The TLS key itself is not renewed: pepsi-setup runs
certbot with --reuse-key and sets reuse_key = True for every certificate
it uses, so that the DANE TLSA record it prints stays valid, and a key exposure
therefore needs the operator to obtain a certificate for a new key, publish a new
TLSA record and revoke the old certificate; Operating Pepsi gives that
rollover step by step, and its After a key exposure section says what to do for
an exposed OpenPGP or S/MIME key, a correspondent’s key, the key-encryption
key and the TLS key, each with its command (After a key exposure).
No revocation can be made for an S/MIME certificate (its issuer revokes it) or
a user’s own MUA key (only their client holds the private half): such a key
stops being used and served, and the reply says that correspondents that cached
it are not told. What remains open is revocation for TLS peers that staple
nothing (no CRL or OCSP query for TLS, by decision), for S/MIME certificates
under intermediates that were not fetched or do not chain to an enabled
anchor, and for those two kinds of own key, which their CA and the user’s
client revoke; all of it is the operator’s choice of anchors and options or
the issuer’s to act on.
96.7.5.4. Certificates without revocation pointers or a validatable chain¶
A certificate can only be revoked effectively if it says where its status is published (a CRL distribution point or an OCSP responder in the Authority Information Access extension), and a recipient can only validate a new partner’s certificate if the chain can be built. Berbecaru and Lioy found in the Alexa top million of 2021 that 0.92% of leaf certificates (4,054) and 59.54% of CA certificates (671) named neither, so a compromised key in them cannot be revoked for relying parties that depend on CRLs or OCSP; about 21% of the CA certificates served were expired and some lacked a critical basic-constraints extension [berbecaru2023]. For S/MIME, Ondaro et al. found in 2025 that 14.36% of certificates carry no valid CRL distribution point or OCSP URI, that the AIA extension is often malformed or missing so that chains cannot be built, and that 28.97% of recent certificates use a signature algorithm that the Baseline Requirements do not allow [ondaro2025]. The remedy is issuance according to the CA/Browser Forum requirements and usable AIA information.
Pepsi: Partly addressed. Impact: low.
Revocation metadata matters to Pepsi: pepsi-keydisc
fetches the CRLs that the http:///https:// distribution points of a
cached S/MIME certificate name, and pepsi-stage-decrypt checks signer chains
against them (with the checks listed under CRL and OCSP data accepted without proper parsing or signature checks).
A certificate that names no distribution point, or only an LDAP or OCSP one,
therefore stays Revocation::NotChecked, as does every intermediate whose
issuer’s list was never fetched, and a chain is not-revoked only when every
certificate in it was covered. The lists fetched are those that the cached peer
certificates name and, under CA_ISSUERS_FETCH, those that the fetched
intermediates name (http:///https:// only, never LDAP), so a chain
through a fetched intermediate can be fully covered; that costs no disclosure
beyond the option’s own, since the intermediate came from the same CA.
Outbound S/MIME encryption refuses a certificate outside its validity window:
pepsi-stage-encrypt sets an expired (or not yet valid) recipient key aside
as no key, so the recipient takes the stage’s ON_NO_KEY route exactly as
for a revoked one and discovery is asked for a renewed certificate, and
build_recipient_info refuses such a certificate for every other caller. A
certificate is otherwise withheld from encryption only once the fetcher
retired it on a list an enabled anchor, or a fetched intermediate chaining to
one, signed (Revocation not checked or soft-failed by clients). Chains are built from the configured anchors,
the certificates that the message carries and, under [pepsi-keydiscovery]
CA_ISSUERS_FETCH (off by default, because each fetch tells a CA whom the site
corresponds with), the intermediates that pepsi-keydisc fetched from the
http:///https:// caIssuers pointers of the cached certificates
through the hardened fetcher (never LDAP, at most three levels up, CA
certificates only). A fetched certificate is never an anchor: a path through it
counts only if every signature verifies up to a ca_trust anchor. Without
the option, or before the fetch, a partner whose signature omits intermediates
gets untrusted, which is safe but costs verifiability. The workaround for a
certificate without a usable list is pepsi-keys peer remove or
pepsi-keys ca disable. The S/MIME certificates that Pepsi generates itself are
self-signed or requested through a CSR, so their revocation information is the
issuing CA’s. OpenPGP is better served: revocation signatures inside
certificates are honoured by sequoia, an expired OpenPGP key is set aside like
an expired certificate, and the refresh timer re-fetches keys from WKD and VKS.
What stays open is the CA’s to fix: a certificate that names no usable
revocation pointer cannot be checked by anyone.
96.7.5.5. Trusted certificates for non-unique internal names¶
A name such as mail, exchange or server.local has no identifiable owner,
so a publicly trusted certificate for it vouches for nothing. Durumeric et al. found
in 110 scans of the IPv4 HTTPS space in 2012-2013 that 4.6% of browser-trusted
certificates named a locally scoped name or private IP address, most of them for
mail servers; 1,218 trusted certificates existed for the name mail alone, issued
to unrelated organisations, and CAs kept issuing them after agreeing to stop
[durumeric2013]. Any organisation could thus obtain a valid certificate for another
organisation’s internal mail server name and impersonate it to clients inside a
network that it can intercept. The remedy, now enforced by the CA/Browser Forum Baseline
Requirements, is to issue certificates only for fully qualified, registered domain
names [durumeric2013].
Pepsi: Addressed. Impact: none.
The certificates Pepsi presents are obtained by certbot for the configured
HOSTNAME and SNI names through ACME HTTP-01 validation, which only works for
public, resolvable names (pepsi-setup). When Pepsi authenticates a
peer (MTA-STS, TLS_VERIFY, the LDAP and HTTPS key sources), rustls checks the
certificate against the configured name, and the publicly trusted CAs stopped issuing
internal-name certificates in 2015, so no such certificate in the system trust store
is still valid. MX names come from the public DNS. The residue is the operator’s: a
smarthost or LDAP server configured under an internal name and verified against a
private CA added to the system trust store is only as unique as that CA keeps it;
over-broad trust anchors are assessed under Unconstrained CA signing scope and opaque trust-store control.
96.7.6. Resource exhaustion and abuse¶
Exhaustion, amplification and the abuse of a service to attack others.
96.7.6.1. Keyserver certificate flooding and keystore poisoning¶
An OpenPGP certificate is a bundle of packets that anyone can add to: a key server merges every packet it receives for a primary key, OpenPGP sets no limit on the number of third-party certifications, and the SKS network was built so that nothing can ever be deleted. Gillmor’s draft on abuse-resistant keystores catalogues the consequences [gillmor2019]. Flooding one certificate with certifications makes it impossible to fetch or process, and a flooded certificate that has been revoked keeps the old key looking unrevoked, because clients cannot fetch the revocation. Flooding a user ID or fingerprint with bogus certificates buries the genuine one, and flooding the whole keystore makes it expensive to run and turns it into a store of toxic material that cannot be removed. The attack had been known for a decade when it was carried out in June 2019 against the certificates of two well-known OpenPGP developers. Each received close to 150,000 signatures (CVE-2019-13050). SKS kept serving them, and GnuPG became unusable for anyone who imported or refreshed them, even when it only had to check a signature made by such a key [hansen2019]. The same three weaknesses also let anyone publish a key for anyone, and they leak social graphs: unauthenticated uploads, non-unique key and user IDs, and an append-only store [halpin2020]. Countermeasures either remove features of SKS or the web of trust or filter what a client downloads [li2021a].
The fixes are now standard practice. Keystores such as keys.openpgp.org verify
user IDs by e-mail and distribute no third-party certifications. Clients use
lookups the domain controls (WKD, DANE OPENPGPKEY) and full fingerprints,
and from GnuPG 2.2.17 they no longer import third-party signatures from key
servers by default. Size limits and the stripping of unhashed or unverifiable
packets complete the picture [gillmor2019] [hansen2019].
Pepsi: Partly addressed. Impact: low.
Pepsi does not speak HKP or use SKS, and it runs no public keystore that accepts
uploads. pepsi-keydisc queries DANE, the two WKD variants, a VKS server
(default https://keys.openpgp.org, which verifies user IDs and strips
third-party certifications) and, optionally, LDAP (pepsi-keydisc).
The hardened fetch in pepsi-keydisc/src/http.rs refuses a response larger than
[pepsi-keydiscovery] MAX_RESPONSE_BYTES (256 KiB by default) as it streams in,
under a deadline (METHOD_TIMEOUT, TIMEOUT). parse_untrusted_certs in
pepsi-crypto/src/pgp.rs refuses compressed or encrypted packets inside key
material, and import::parse_openpgp accepts exactly one certificate per
answer. A returned key whose user ID does not name the queried address is
discarded. A flooded certificate therefore costs Pepsi one capped download and
cannot exhaust a worker, since stages never wait on the network. Keys learnt
from inbound mail are capped too (MAX_AUTOCRYPT_HEADER, MAX_HARVESTED_KEYS,
MAX_GOSSIP_FIELDS, MAX_GOSSIP_KEYDATA in pepsi-keydisc/src/harvest.rs),
and the trust ladder decides which of several keys for one address is used
(Keys of correspondents, Key management). The poisoning of an address with a
forged key is treated in Keyservers accept and serve unauthenticated key material and revocations,
Autocrypt and in-band key exchange open to key injection and MITM and TOFU and key continuity miss first-contact and new-identity attacks.
Every OpenPGP certificate that Pepsi stores, exports or publishes
is reduced to its owner’s self-signatures (pgp::without_third_party_certifications,
applied in export_cert and armor_cert, hence in key discovery’s import,
the WKD/VKS publication of pepsi-keys and the stored form of an imported
identity); third-party revocations of the primary key or a subkey are kept,
because that is how a designated revoker speaks. A flooded certificate that
fits under the cap is therefore stored and passed on at its owner’s size. On
the S/MIME side an RSA modulus above the same 8192 bits is refused when a
certificate’s key is parsed, which a test pins. What remains is availability. A
certificate that grows beyond the cap, whether by flooding on a source that
accepts third-party packets (an LDAP directory, a non-default key server, a WKD
host) or by legitimate growth, is refused before it can be stripped. The refusal
is cached as a lookup error, so mail to that correspondent takes the encrypt
stage’s no-key path (ON_NO_KEY) and a new revocation in that certificate is
not seen. An identity imported with third-party certifications keeps them in
the store, but they are stripped whenever its public key leaves the host (WKD,
the OPENPGPKEY records of pepsi-keys dns and pepsi-setup,
pepsi-keys identity export;
pepsi_keydisc::served::served_material). A remote sender can also add rows to
pepsi.peer_key for addresses of their choosing at the rate ingress admits
mail. Raising MAX_RESPONSE_BYTES trades memory for reach.
96.7.6.2. ACME validation SSRF, denial of service and account correlation¶
The ACME protocol (RFC 8555) makes a certificate authority fetch URLs and resolve names chosen by an unauthenticated applicant before control of a domain has been shown [rfc8555]. A CA that follows redirects and echoes responses back for debugging can be turned into a proxy into its own internal network (server-side request forgery). Validation and issuance are expensive and can be triggered for arbitrary domains, which exhausts the CA or directs traffic at third parties. Predictable resource URLs reveal which domains belong to which account, and an attacker on the ACME channel can use a bogus error to push the client to a weaker signature algorithm. The RFC tells CAs to send validation requests only to the public Internet, to rate-limit accounts, validations and issuance, and to use unpredictable resource URLs.
Pepsi: Not applicable. Impact: none.
Pepsi is never a CA and implements no ACME server. pepsi-setup
(pepsi-setup/src/tls.rs) is only an ACME client: it runs certbot certonly
--standalone for the host names that its TLS listeners need, as root, with
--register-unsafely-without-email (pepsi-setup). The SSRF
and resource-exhaustion attacks are against the CA. That domains issued to one
ACME account can be linked does not reveal anything here, because Certificate
Transparency publishes every certificate and its names anyway. Downgrading the
client’s signature algorithm is a matter for certbot and the CA. Pepsi’s own
outbound fetches with attacker-influenced targets are constrained too: the WKD
and VKS fetches refuse private and loopback addresses and follow at most one
same-host HTTPS redirect (pepsi-keydisc/src/http.rs,
WKD lookups follow redirects and accept oversized or polluting keys), a TLSRPT report POST refuses such
addresses and follows no redirect, and the MTA-STS policy fetch follows no
redirect and needs a certificate valid for mta-sts.<domain> (it does not vet
the address).
The ACME weaknesses that do concern a client are treated in
Domain validation challenge not bound to the account key and CA domain validation subverted via BGP and DNS attacks.
96.7.7. Information leaks and tracking¶
Unintended disclosure of content, metadata or the reader’s activity.
96.7.7.1. Cleartext metadata, headers and lengths of encrypted mail¶
OpenPGP and S/MIME encrypt the body and nothing else. The envelope and the
header fields, with sender, recipients, subject, date and route, stay in clear,
and so does the fact that a message is encrypted at all. A signature outside the
encryption lets any observer test which public key made it, which links
pseudonyms, and it gives every holder transferable proof of authorship
[orman2015]. Inside the container, the cleartext packet or RecipientInfo
headers name the format, the algorithms, the number of recipients and their key
identifiers. The ciphertext is padded only to the cipher block, so its length is
essentially the plaintext length. Nikitin et al. measured how identifying length
alone is: without padding, 83 per cent of 56,000 Ubuntu packages, 87 per cent of
191,000 YouTube videos and 45 per cent of 848,000 user files had a unique size.
They propose formats indistinguishable from random strings, with metadata in an
encrypted header and Padme padding, which leaks O(log log M) bits at no more than
12 per cent overhead [nikitin2019]. Designs that move key material out of band
just move the metadata. In FriendlyMail every protected message causes a post
that names the correspondents, so the social-network provider learns who writes
to whom [pirouz2014]. No deployed mail format hides lengths, and only the
optional header protection of current drafts hides the subject. Hiding who
corresponds with whom takes an anonymity network.
Pepsi: Partly addressed. Impact: low.
Pepsi inherits the formats’ limits except for the length, which it pads. The outer header block
and the SMTP envelope are in clear by design (What Pepsi does not protect), and so is
the sender’s key in the Autocrypt: header that pepsi-stage-encrypt adds
(AUTOCRYPT, default on). [stage-encrypt] PROTECT_HEADERS copies the
RFC 5322 fields into the protected part and replaces the outer Subject with
.... It is off by default (pepsi-stage-encrypt/src/config.rs), since a
client that cannot look inside shows ... as the subject, so the subject is
readable on every hop and in every mailbox unless an operator sets
PROTECT_HEADERS = yes (also per sender through pepsi.settings). The recipient’s key ID is named in the PKESK or RecipientInfo;
Pepsi emits no wildcard (hidden-recipient) key IDs.
Some of the leakage is reduced. pepsi-stage-encrypt splits a message into one
row per recipient before encrypting (split_to_one_per_row), so each ciphertext
names only the key of the recipient whom its envelope already names, and a Bcc
recipient never appears in another copy. Signatures on encrypted mail are made
inside the encryption (sign_and_encrypt_reported). Autocrypt-Gossip fields
are moved into the protected entity (INNER_HEADERS in
pepsi-crypto/src/mime.rs). Every message that pepsi-stage-encrypt
encrypts is padded to a Padmé length ([stage-encrypt] PADDING, default on;
pepsi-crypto/src/padding.rs). Inside a SEIPDv2 container the padding is an
RFC 9580 padding packet after the signature, so it is encrypted but not
signed. SEIPDv1 and S/MIME have no padding that a reader skips, so there the
padding is a Pepsi-Padding: filler header field on the encrypted MIME
entity; readers ignore it, and Pepsi’s own decrypt path drops it with every
other non-Content-* field. An observer then learns the length only to within
the Padmé bucket, at most 12 per cent of overhead. Wildcard key IDs are not
emitted, by decision: they make the recipient try every key it holds, and the
per-recipient split already confines each key ID to the copy whose envelope
names that recipient. The envelope and the fact of encryption cannot be
hidden by any mail format.
96.7.7.2. Keyserver queries and refreshes leak contacts and keyring contents¶
Every lookup on a public key server tells its operator, and anyone who sees the
traffic, which identity the client cares about. A search by e-mail address
reveals likely correspondents [li2021a], and “live” validation reveals each use
of a certificate [gillmor2019]. Refreshing is worse. HKP has no update
operation, so a refresh such as GnuPG’s --refresh-keys, which best-practice
guides recommend running regularly to learn of revocations, downloads every
certificate in the keyring by identifier. The server then learns the complete
set of certificates that the user holds, a set that usually identifies the user, and
learns it again at each refresh. Müller measured that in a 30-day window only
0.062 per cent of about 6 million certificates changed, so almost all of that
disclosure buys nothing [mueller2020]. Users who refresh rarely to protect
themselves miss revocations. The proposed fixes are private set intersection
through a third-party server, so that a client learns only the keys that it
asked for
[li2021a]; a published list of recently changed certificates or
prefix-based k-anonymous fetches [mueller2020]; and encrypted transport,
anonymity networks, randomised refreshes from several key servers and cached
validation results [gillmor2019]. None of these is deployed widely.
Pepsi: Partly addressed. Impact: low.
Pepsi queries key servers itself. SOURCES includes vks by default, and
pepsi-keydisc@vks asks VKS_SERVERS (default https://keys.openpgp.org)
by e-mail address (vks::by_email_url) when an outbound message is addressed
to a correspondent with no cached key, and when an inbound signed message comes
from a sender with no cached key. Cached keys are then re-validated:
pepsi-keys-refresh.timer runs pepsi-keys peer refresh --limit 200 daily,
and refresh_due in pepsi-keydisc/src/lib.rs re-checks every key whose
refresh_after (CACHE_TTL, 24 hours) has passed. It asks only the method the key was learnt from (refresh_plan, with the
selection made in SQL by due_for_refresh): a key from the key server is
re-fetched there, a WKD or DANE key from the correspondent’s own domain, and a
key harvested from mail, gossiped or entered by hand is not refreshed over the
network at all, so the key server is not asked daily about every
correspondent in the cache. One more query exists: when pepsi-stage-encrypt
encrypts to a harvested or gossiped key it asks discovery, through every method
in SOURCES, whether the owner published a key (recheck_harvested), at
most once per NEGATIVE_TTL per address and only while mail is being sent
there, so the key server also learns of correspondents whose key arrived in
mail, at the rate at which the users write to them. Again and again, and from
the deployment’s own IP address, the key server’s operator thus learns the
correspondents whose keys it supplied and those that users write to while a
harvested key stands. This still discloses part of the communication graph. The queries are HTTPS
only, so a network observer sees no
more than the server name. Pepsi has no Tor or proxy support, no private
retrieval, and no randomised spreading across servers beyond the timer’s
one-hour random delay. The price of the restriction is freshness: a revocation
published only on a key server is not seen for a key that came from elsewhere.
Because Pepsi is a gateway, the server sees an organisation’s correspondents
rather than one person’s keyring, which hides individual users among the
deployment’s users. Key management, “Lookup privacy”, states what the
refresh asks and lists the levers: remove vks from SOURCES (which also
stops the refresh asking the key server anything), restrict lookups with
ALLOW_DOMAINS/DENY_DOMAINS, set DISCOVERY = no for particular
senders, raise CACHE_TTL, or mask the refresh timer. Each costs keys found or
revocations seen late, and the default still queries the key server for a
correspondent with no key from any other source. What remains is the
operator’s choice between those levers; retrieval that hides the queried
address from the key server itself is an open problem.
96.7.7.3. Automatic key lookups (WKD, OPENPGPKEY) leak who is being contacted¶
Key discovery by the recipient’s domain (WKD, or DANE OPENPGPKEY in DNS)
replaces third-party key servers, but a lookup still says that someone is about
to write to a given address. RFC 7929 notes that DNS queries are mostly
unencrypted, so an OPENPGPKEY query tells the resolver and any observer on
the path who intends to write to whom and when. It recommends QNAME
minimisation, DNS over TLS to a trusted resolver and caching keys for the
record’s TTL [rfc7929]. The query name is a hash of the local part, which can
be reversed by guessing. Breuch et al. note that the SNI of a WKD lookup
reveals the domain of the address being queried [breuch2022]. The lookup can
also come too early. In 2018 SEC Consult found that Enigmail started a WKD lookup
about two seconds after an address was typed into a draft, or after a
mailto: link was clicked, without any user action. The recipient’s domain
operator learned the sender’s IP address and that a message was being written,
even one that was never sent. The developer kept the default and pointed to a
configuration option [sektioneins2018].
Pepsi: Partly addressed. Impact: low.
The on-compose leak does not exist in Pepsi. A server never sees a draft, and
pepsi-stage-encrypt starts a lookup only when it handles a submitted message
for an address with no cached key (keydisc_park), or with a key learnt only
from mail, where it asks in the background whether the owner published one
(recheck_harvested). The lookup is made at most once per address per
CACHE_TTL or NEGATIVE_TTL/ERROR_TTL, and once for any number of
messages (pepsi-keydisc, Key management).
The lookup comes from the gateway’s address, not the user’s, and the domain that
it goes to receives the message itself seconds later, so a WKD host learns little
that it would not learn anyway. WKD and VKS go over HTTPS only.
What remains is the DNS side and the third parties. A DANE lookup’s query name,
the hashed local part, goes to the configured resolver and, unless that resolver
uses QNAME minimisation and encrypted upstream transport, to every observer
between the resolver and the authoritative servers. Pepsi needs a validating
resolver for DANE and leaves its choice to the operator. Inbound signed mail from
an unknown sender also starts a lookup at the sender’s domain (but not for
content from an unauthenticated S/MIME container, see
pepsi-stage-decrypt), which tells that domain when the message was processed.
The daily refresh repeats each successful lookup, through the method that found
the key only (Keyserver queries and refreshes leak contacts and keyring contents). The
controls are ALLOW_DOMAINS/DENY_DOMAINS, SOURCES and per-sender
DISCOVERY = no. The manual states the residue (What Pepsi does not protect).
Operators who want more should run a local validating resolver that uses QNAME
minimisation and DNS over TLS upstream.
96.7.7.4. OCSP and certificate URL fetches leak activity to third parties¶
Checking whether a certificate is revoked can tell a third party what the checker is doing. With classic OCSP, a client asks the CA’s responder about each certificate it meets, over plain HTTP, so the CA and any observer learn which sites the user visits. A client that gets no stapled response may fall back to asking the responder itself. Stapling, CRLs and pushed revocation lists avoid the per-site query [berbecaru2023]. In mail it is worse, because the certificate comes with the message. RFC 5750 warns that certificates in a message may be made by the attacker: expensive keys or long lists of CRL Distribution Point and Authority Information Access URLs make processing costly, and a receiving agent that fetches those URLs tells the sender that the message was processed, and from where, even when the signature does not verify [rfc5750]. The RFC only advises caution with certificates that have not been validated to a trust anchor.
Pepsi: Partly addressed. Impact: low.
Pepsi never queries an OCSP responder and never dereferences an AIA URL on a
message’s behalf, and the stages fetch nothing: the trust module in pepsi-crypto/src/trust.rs is a pure
function of its arguments and opens no sockets. pepsi-keydisc, though, does fetch the CRL distribution points (http:// and
https://) named by the S/MIME certificates in its peer-key cache, and a
certificate harvested from a message is one the sender made. The fetch is
decoupled from the message: distribution points are collected by an hourly pass
over the cache, de-duplicated across certificates, limited to two per
certificate and fetched at most daily per list (pepsi-keydisc/src/crl.rs),
behind the SSRF check, a deadline, a byte cap and no redirects. So a sender who
names a distribution point of their own learns, within the hour, that the
gateway cached their certificate, which is no more than the key discovery
described below already tells their domain at once. A CA learns that this host
holds some certificate that it issued, never which one or when it was used.
[pepsi-keydiscovery] CRL_FETCH = no turns the fetch off. The caIssuers
URLs of the same certificates are fetched under the same rules only when the
operator sets CA_ISSUERS_FETCH (off by default), weekly, at most two per
certificate and three levels up, never ldap://. The outbound TLS
clients read only the OCSP response that a server staples in the handshake
(pepsi-common/src/smtp/ocsp.rs), which the server fetched on its own
schedule, so no responder learns which peer this host talks to. The
RFC’s other concern, certificates chosen
to be expensive to process, is a matter of availability rather than privacy.
OpenPGP keys above pgp::MAX_RSA_BITS (8192) are refused, and
smime::MAX_RSA_BITS (also 8192) is enforced by Pepsi’s own modulus parser
(smime::rsa_public_from_pkcs1) wherever a certificate’s RSA key is read, so
a larger key is never used (pepsi-crypto/tests/smime.rs pins the ceiling).
Revocation checking itself is treated in Revocation not checked or soft-failed by clients.
The closest analogue is key discovery. An inbound signed message from a sender
whose key is not cached makes pepsi-keydisc ask that sender’s domain (WKD,
DANE) and the VKS server. This tells the sender’s domain when the gateway
handled the message, not whether or when a person read it, and the delivering
SMTP session tells the sender that much already. For content from an
unauthenticated (CBC) S/MIME container no lookup is made, because whether it
happened would reveal whether the ciphertext opened (pepsi-stage-decrypt).
96.7.7.5. Autocrypt gossip reveals communication relationships¶
Autocrypt gossip (Level 1, section 5.3) puts copies of the other recipients’ keys into a message sent to several people, so that they can reply to everyone encrypted. Krekel et al. point out that gossip keeps redistributing third parties’ keys. An observer may infer from it who recently communicated with whom, and automatic administrative messages can be injected, used to impersonate users or used to probe whether a user is online. They propose onion key lookups, which also act as cover traffic, and processing administrative messages only from verified peers, and mark the problem as partly open [krekel2019].
Pepsi: Addressed. Impact: none.
pepsi-stage-encrypt emits gossip only under [stage-encrypt]
AUTOCRYPT_GOSSIP, which is off by default, because gossip passes on third
parties’ keys. When enabled it is restricted in four ways
(pepsi-stage-encrypt/src/gossip.rs). It is OpenPGP encryption only, and the
fields go inside the protected entity, never on the outer header
(INNER_HEADERS), so a network or mailbox observer sees none of it. The
addresses it gossips about come from the parsed To:/Cc: only, and
envelope recipients are used solely to exclude addresses, so a Bcc recipient is
never gossiped and nobody learns a relationship that they cannot already read in
the visible header of their own copy.
It carries no prefer-encrypt and makes no discovery lookup. There is no
gossip above 50 visible recipients. On the receiving side
pepsi-stage-autocrypt-learn stores gossip only from mail that arrived
encrypted and at the lowest trust rung, and a stranger’s introduction never
displaces a better key (A gossiped key its owner confirms is promoted).
Pepsi has no Autocrypt administrative messages (no Setup Message processing, no
SecureJoin). Its e-mail control channels (key commands, pepsi-stage-edit-settings,
the wallet commands of pepsi-stage-auto-pay) act only on
state.local_origin mail, that is mail submitted by an authenticated local
user, so a remote sender can neither inject them nor use them to probe presence.
The out-of-office notice of pepsi-stage-vacation does reveal absence, which
is its purpose, and is subject to the RFC 3834 suppression rules.
96.7.7.6. Tracing of other users’ key updates in key directories¶
Key transparency directories in the style of CONIKS let each user check that the provider serves the same key to everyone, using a Merkle tree in which every user name has a fixed position for the lifetime of the directory. Chase et al. show that this leaks. The membership proof for one’s own entry contains the sibling nodes along its path, which encode the neighbours’ entries. A user who once learned a neighbour’s position, for example by looking up that user’s key, can trace every later key change or deletion of that user just by monitoring their own key, with no further lookups and even after the traced user has stopped sharing their key. The same applies to EthIKS and similar designs. SEEMless avoids the leak with an append-only zero-knowledge set whose proofs reveal nothing beyond a defined leakage function [chase2019].
Pepsi: Not applicable. Impact: none.
Pepsi operates no key transparency log and serves no inclusion proofs. Its own
users’ keys are published, at the user’s or operator’s choice, through WKD
(pepsi-httpd/src/endpoints/wkd.rs), DNS records printed by pepsi-setup,
or an upload to a VKS server (Key management). Each of these returns the
key for the one address asked about and nothing about other addresses. A WKD
query does not show when a neighbouring entry changed. Pepsi’s own peer-key
cache is never exposed to correspondents. The risk that a directory gives
different keys to different people, which transparency logs were designed to
detect, is treated in Undetectable key substitution or equivocation by key directories and CAs.
96.7.7.7. Plaintext digest disclosed in CMS authenticated attributes¶
AuthEnvelopedData (RFC 5083) can carry authenticated attributes, which
are integrity-protected but not encrypted. If the message-digest attribute is
among them, the hash of the plaintext is visible to anyone who sees the message.
That allows content tracking and the confirmation of a guessed plaintext, for
example of a short or templated message. The RFC says authAttrs SHOULD NOT
contain the message-digest attribute [rfc5083].
Pepsi: Addressed. Impact: none.
Pepsi’s own CMS builder in pepsi-crypto/src/smime.rs never emits
authAttrs or unauthAttrs in an AuthEnvelopedData (rule E1 in the
module documentation; auth_attrs: None with an empty AAD). The
AES-256-CBC EnvelopedData it writes to a recipient whose capability record
says cbc (or to everybody under CRYPTO_ALLOW_DOWNGRADE = yes) has no
attribute fields that could carry a digest. A SignedData does carry a
message-digest signed attribute (RFC 5652), but on encrypted mail Pepsi
signs before it encrypts, so that digest is inside the ciphertext. On mail that
is only signed, the content is in clear anyway. The digest of a signed message
that is later encrypted for someone else is the subject of
Surreptitious forwarding: signatures not bound to the intended recipient.
96.7.7.8. Session key exposed to local users via the process table¶
GnuPG’s --override-session-key takes a message’s session key as a command
line argument. On a multi-user machine every local user can read command lines
through the process table (ps, /proc), so the session key, and with it
the message, is exposed to them. GnuPG’s manual warns about this and offers
--override-session-key-fd, which reads the key from a file descriptor
[gnupg2024]. The general rule is that a secret must never be put in an
argument vector. Front ends that drive GnuPG as a subprocess are where this
goes wrong.
Pepsi: Addressed. Impact: none.
Pepsi performs all OpenPGP and CMS operations in-process (sequoia and its own CMS
code in pepsi-crypto) and never spawns gpg, so no session key leaves the
process. Where a secret does cross a process boundary it is passed on stdin. The
secure-link PIN goes to PIN_COMMAND on stdin, with only the recipient address
as an argument (pepsi-stage-secure-link/src/lib.rs, which explains the
/proc exposure). The IMAP password goes to the mailbox scanner with
--imap-password-stdin. Messages go to the setuid helpers on stdin. The only
secret-like value Pepsi accepts on a command line is the TOTP code of
pepsi-keys identity --otp CODE. It is single-use (a replayed step is refused
through last_step), valid for about a minute, and useful only together with
the owning account, so it is not a comparable exposure (A second factor for key management).
96.7.7.9. Device tracking via linkable certificate reissues¶
Chung et al. studied 80 million TLS certificates from three years of IPv4 scans and found that most of them are invalid, mostly self-signed certificates of end-user devices such as routers and cameras. These devices regularly issue themselves new certificates but keep linkable features: the key, the issuer, naming patterns and other fields. That let the authors follow 6.7 million devices across changes of IP address for more than a year, without any cooperation from their owners. The paper proposes no fix [chung2016a].
Pepsi: Not applicable. Impact: none.
Pepsi runs on a server with a public identity. Its TLS listeners use certificates
for the configured host names, obtained by pepsi-setup from an ACME CA or
supplied by the operator (TLS_CERT/TLS_KEY). Their purpose is to name the
host, and Certificate Transparency publishes them anyway. Pepsi does not
generate self-signed TLS certificates on its own, and it runs on no end-user
device whose movements could be followed. The OpenPGP keys and S/MIME
certificates that Pepsi creates for users are meant to be linkable to the user’s
address. Tracking a person by their published key is part of the key-discovery
privacy questions in Keyserver queries and refreshes leak contacts and keyring contents.
96.7.8. Misleading display and user decisions¶
Indicators and displays that mislead, and decisions a user cannot be expected to get right.
96.7.8.1. Signature spoofing via partial signing and MIME/CMS wrapping¶
Neither S/MIME, CMS nor OpenPGP says that a signature must cover the whole
message. Any subtree of the MIME structure may be signed, a SignedData may
carry several SignerInfo objects, signing and encryption nest arbitrarily,
and an invalid signature usually gives only a warning [schwenk2022b]. Showing
such a result correctly is the hard part, and it can be attacked without
breaking any cryptography [schwenk2022c]. In MIME wrapping, an old signed
message of the victim, whose signature is usually easy to obtain, is embedded
and hidden as a sub-part: under many blank lines, in HTML that is not
displayed, behind an unreferenced cid: part of multipart/related, or as
an attachment. The attacker’s unsigned text is then shown next to the victim’s
valid signature indicator. In 2019 Müller et al. found this in, among others,
Thunderbird/Enigmail and Apple Mail/GPG Suite (CVE-2017-17848, CVE-2018-15586,
CVE-2018-15587, CVE-2018-15588) [muller2019]. Thunderbird also failed to
show that only part of a message with an inline OpenPGP block was protected
(CVE-2021-29957, fixed in 78.10.2) [mozilla2021]. In CMS wrapping, a
clear-signed message is turned into an opaque-signed one without breaking the
signature, and some clients then verify the encapsulated content but display
the attacker’s part. Other attacks defeat the match between the From:
address and the signer’s certificate with address-like display names, several
From: fields, or From: and Sender: that disagree [schwenk2022c].
Gateways repeat the client mistakes. In 2026 Suter-Dörig showed that SEPPmail
marked a multipart message as signed if any part carried a valid PGP signature,
so a signed part hidden in an unreferenced multipart/related part lent its
status to arbitrary text. The issue was still unfixed when the embargo ended in
January 2026 [doerig2026]. CipherMail Gateway counted unsigned parts against
detached signatures with an integer counter, so two signatures over one file
cancelled out an unrelated unsigned part. It was fixed in 6.3.3 by tracking the
set of covered parts [ciphermail2026]. Ordinary forwarding has a related
problem. The original author’s signature is lost when a forwarder re-signs, and
the reader may take the forwarder’s valid signature as covering the quoted text
[dubos2022]. The fixes agree: show a message as signed only when its root, or
everything displayed, is covered; bind the signer strictly to the displayed
From:; never put status inside attacker-controlled content; and track
coverage by set rather than by count.
Pepsi: Partly addressed. Impact: low.
pepsi-stage-decrypt reduces a message to what its signatures cover before it
verifies anything. pepsi_crypto::mime::isolate, controlled by
[stage-decrypt] ISOLATE_SIGNED (default on), turns a message that carries
signed content (a multipart/signed, an opaque SignedData, an inline
clearsigned block) beside unsigned content at any depth into the signed units
alone. That includes an unreferenced multipart/related child and text around
a clearsigned block. The attacker’s text never reaches the mailbox. With several
signed units only the first is verified, so the message gets no [verified].
The same reduction is applied to every decrypted plaintext. Opaque S/MIME is
classified from its DER (smime::peek_content_info), so a signed wrapper
around a ciphertext is seen as such (What a security indicator means). The reduction is
recorded as isolated=signed in X-Pepsi-Crypto. Coverage is structural,
not counted, and detached signature files in PGP/INLINE style are not
recognised as signatures at all, so the CipherMail counter bug has no
counterpart. The signer is bound to the first mailbox of From:, read the
way a client reads it. A message with two From: fields is refused at
ingress, and inbound X-Pepsi-* fields and forged subject tags are stripped
(Weak binding between signer certificate or key and the From address, Security status spoofed in-band in message body or headers).
The residue is the following:
Replay within days. A MIME signature does not cover the outer
Subject,ToandDate. A signature made more thanMAX_SIGNATURE_AGE_DAYS(default 7) before the message arrived here, or more than a day after, isvalid-untrusted(withheld=old-signature/future-signature), and the claimed signing time is shown assigned-at=inX-Pepsi-Crypto; the comparison is with this host’s arrival time, never the replayer’sDate:. An old signed entity of the victim re-sent under a new subject therefore loses[verified], but one re-sent within the window, or one whose signature carries no creation time, still verifies asvalidunless the signer protected its headers, in which case the signedSubject:is shown in place of the new one (Header fields not protected by signature or encryption).The display-name and multi-mailbox tricks do not earn the tag: a display name or comment that shows another address, or a
From:that names several mailboxes, withholdsvalid(Weak binding between signer certificate or key and the From address); what they still do to a reader’s eye without any signature is Sender display deception: display names, look-alikes, RTLO and truncation.ISOLATE_SIGNED = no, chosen to keep mailing-list footers, brings the whole wrapping attack back.A forwarder’s re-signature is reported as the forwarder’s, correctly. That a reader takes it to vouch for quoted text is a matter for users and clients (Surreptitious forwarding: signatures not bound to the intended recipient).
What remains for clients and users is to read a [verified] message’s
content as the signer’s, not its outer subject or date, where the signer
protected no headers.
96.7.8.2. Certificate errors reported incompletely, masking severe ones¶
Certificate validation code usually stops at the first problem it finds and reports only that one. Brubaker et al. found that for an expired certificate with an untrusted issuer, NSS, Chrome 30 on Linux and Safari 7 reported only “expired”, and Opera reported “weak key” for a 512-bit key and hid everything else [brubaker2014]. Chen et al. found the same in every library they tested except mbedTLS [chen2018a]. When a user has to decide, this matters. People routinely click through expiry warnings, so an attacker who presents a recently expired, self-signed certificate for an important domain gets a harmless-looking warning, although the server is not authenticated at all. The fixes are to report all errors, as NSS’s verification log does, or at least the most severe one.
Pepsi: Addressed. Impact: none.
Pepsi never asks a person to accept a certificate. For TLS, verification by
rustls succeeds or fails, and the outcome is fixed by the configured policy
(TLS_VERIFY, MTA-STS, DANE) with no override at delivery time. For
S/MIME, trust::validate in pepsi-crypto/src/trust.rs also reports one
failure, checking the leaf in a fixed order: validity dates, critical
extensions, structural defects (a repeated extension, extensions in a pre-v3
certificate), extended key usage, key usage, identity binding and key strength,
then the path. But the verdict errs the safe way. Only UnknownIssuer and
SelfSigned are mapped to the milder valid-untrusted (is_merely_unanchored);
every other failure, including Expired, is a Bad verdict. An expired
self-signed certificate is therefore reported as a bad signature, not as an
untrusted one, and either way the message gets no [verified] tag
(What a security indicator means). The reason given in X-Pepsi-Crypto may name only one
of several defects, but no decision depends on it.
96.7.8.3. Certificates do not convey sender role; look-alike name attacks¶
A valid S/MIME or OpenPGP signature binds a message to a key and a name or address. A recipient usually needs to know something else: that the sender holds a role (“manages grants for this department”) or speaks for someone. A correctly signed message from an unfamiliar or similarly named person conveys no authority, and a signature by a key that the sender supplied himself means nothing. Masone’s user studies included “John Wilson” attacks, in which the attacker’s name resembled that of someone in authority and the request was made in the message body or backed only by a vague attribute. About half of the participants acted on such a message, 6 of 12 with ordinary mail and 13 of 27 with the proposed attribute-assertion system. Signed, delegable attributes shown by the client helped against expired or vague attributes, but the look-alike name attack stayed hard to stop [masone2008].
Pepsi: Partly addressed. Impact: medium.
Pepsi verifies keys and addresses, not roles or names, and cannot do more with
standard formats. The [verified: alice@example.org] tag means that a
signature over the plaintext verified with an anchored key bound to the address
it names, which is the From: address (What a security indicator means). Anchored
includes a WKD key and a DNSSEC-validated DANE key. Homographs are caught.
Pepsi computes a domain’s skeleton by folding it through Unicode’s UTS #39
confusables table, which pepsi_common::indicator also uses for subject tags.
A signer domain whose skeleton equals a served domain or the domain of an
address in the key store or whitelist gets valid-untrusted
(withheld=lookalike-domain, the A-label shown as signer-domain=), and a
display name or comment that shows another address withholds valid too
(Weak binding between signer certificate or key and the From address). Some look-alikes are not homographs, such as
example-corp.org for examplecorp.org, or a similar person’s name. Such
a look-alike is a different address, so an attacker who registers it and
publishes a key there by WKD still gets [verified: …] naming that address,
and the tag may make the message more credible. Users who act on claimed
authority without checking the address in the tag remain exposed.
Fixing the rest would take a role or attribute layer that no deployed client
shows, or heuristics outside cryptography beyond the homograph check above and
the [external] mark that pepsi-ingress puts on unauthenticated mail
claiming a served domain: comparing new senders with known correspondents or domains by
looser similarity. Those are treated in Look-alike and IDN homograph domains, confusable characters and alias addresses and
Sender display deception: display names, look-alikes, RTLO and truncation. An operator who wants [verified] to
mean “a key this organisation vouches for” can raise the trust floor or rely on
anchored S/MIME CAs with nameConstraints for partner namespaces. That still
does not convey a role.
96.8. Cryptographic primitives and libraries¶
The ciphers, paddings, hash functions and signature schemes themselves, and their implementations in cryptographic libraries.
96.8.1. Implementation defects¶
Memory safety, injection, parser differentials and logic errors in a particular implementation.
96.8.1.1. Memory corruption in ASN.1, CMS, certificate and OpenPGP parsers¶
Certificates, CMS/PKCS #7 structures, PEM and Base64 wrappers, OpenPGP armor and
packets all reach a mail system from whoever sends the message, and most of the
libraries that parse them are written in C with hand-written length and type
handling. The result is a long series of memory-safety bugs in exactly the code that
processes hostile input first. OpenSSL alone supplies a catalogue: two harmless bugs
that combine into an out-of-bounds write when a parsed ASN.1 ANY field is
re-encoded (CVE-2016-2108), integer overflows in the Base64 and cipher update
functions on very large inputs (CVE-2016-2105, CVE-2016-2106) and an EBCDIC overread
in X509_NAME_oneline (CVE-2016-2176) [openssl2016]; and in 2023 an X.400
GeneralName type confusion that let an attacker who supplies both a certificate
and an unsigned CRL pass arbitrary pointers to memcmp (CVE-2023-0286, high), a
use-after-free when streaming S/MIME or CMS output (CVE-2023-0215), a double free
after reading an empty PEM payload (CVE-2022-4450), and NULL or invalid pointer
dereferences when loading PKCS #7, checking a DSA public key or verifying PKCS #7
signatures with an unavailable digest (CVE-2023-0216, CVE-2023-0217, CVE-2023-0401)
[openssl2023a]. The same pattern appears elsewhere: Botan’s BER decoder crashed on
an empty BIT STRING, allocated without bound, overflowed lengths on 32-bit platforms,
did quadratic work on indefinite lengths and had a heap overflow in elliptic-curve
point decoding (CVE-2015-5726, CVE-2016-2195 and others) [botan2024]; wolfSSL’s
hostname check read past a buffer that was not NUL-terminated [sun2025]; GnuPG’s
ASCII-armor parser had a memory-corruption bug [groves2025b]; and the GnuPG project
announced a “severe” bug in GnuPG 2.5.13 to 2.5.16 (T8044) and a denial-of-service
bug in Libgcrypt (T8211) [gnupg2025].
What an attacker gains ranges from a crash of the parsing process through memory disclosure to possible code execution for the heap overflows. A crash is the most common case, and in an MTA or gateway it is a denial of service for every queued message. The only precondition is getting the object parsed, which for e-mail means sending a message; certificate bugs that are reached only after chain verification additionally need a CA-signed certificate. Kaminsky et al. make the same point for the other side of the PKI: a CA that parses attacker-supplied PKCS #10 requests with unhardened BER decoders and stores subject strings unvalidated risks memory corruption and SQL injection in the CA itself [kaminsky2010]. A memory-safe language moves the problem into the dependency tree rather than removing it: the 2019 audit of the Rust OpenPGP library rPGP found it depending on a crate with a known memory-corruption advisory [includesec2019]. The fixes are the vendors’ patched releases, hardened or memory-safe parsers, fuzzing, and tracking advisories in the dependencies.
Pepsi: Partly addressed. Impact: low.
Every parser that Pepsi itself applies to hostile cryptographic input is written
in safe Rust. CMS, PKCS #7 and X.509 are decoded with the RustCrypto der,
cms and x509-cert crates and processed by Pepsi’s own code in
pepsi-crypto/src/smime.rs and pepsi-crypto/src/trust. OpenPGP armor is
located by find_armor in pepsi-crypto/src/mime.rs and decoded, like the
packets, by sequoia-openpgp’s Rust parser. TLS certificates go through rustls
and rustls-webpki; a client certificate offered to a submission listener
that sets TLS_AUTH_CLIENT_CA is additionally decoded and path-validated by
the same x509-cert/der code as an S/MIME certificate, inside the ingress
process (pepsi-ingress/src/smtp/clientcert.rs), and the revocation lists
that pepsi-keydisc fetches into pepsi.crl_cache are parsed by the same
crates (pepsi-crypto/src/crl.rs). The only unsafe in pepsi-crypto is
the zeroing of secret buffers (volatile writes, and the mutable byte view of a
passphrase string that they wipe). The release build links no OpenSSL, no GnuPG
and no Libgcrypt. openssl-sys appears in Cargo.lock only for the
optional CRYPTO_BACKEND=crypto-openssl build, and gpg is run only by the
interoperability tests, so none of the advisories above applies as published.
PEM and Base64 are decoded by Rust crates, and recipient-info counts, RSA key
sizes (MAX_RSA_BITS) and nesting depth are bounded. The CMS, OpenPGP, MIME
and classification paths are fuzzed (fuzz/fuzz_targets, plus the stable
mutation sweep in pepsi-crypto/tests/sweep.rs), and so are the DKIM key
records fetched from senders’ DNS (dkimkey) and X.509 path validation
(x509). pepsi-stage-decrypt runs the parse in evaluate_off_thread
and turns a panic into a permanent failure of that one message. A worker that
crashes outright is struck out after three attempts, so a poison message cannot
stall the queue (A remote sender, Security model, Test Suite). Pepsi
is not a CA and accepts no PKCS #10 requests. All database access goes through
parameterised sqlx queries, and cargo deny check (advisories) is one of
the release gates.
What remains is C code below the Rust layer. Two C libraries handle data that an
attacker controls. Nettle (nettle-sys, sequoia’s default backend) performs
the big-number arithmetic on the MPIs of received OpenPGP keys, signatures and
session-key packets. AWS-LC (aws-lc-sys, the crypto provider of rustls and
of the vendored mail-auth) parses the DER of every DKIM public key fetched
from a sender’s DNS, as well as the TLS key-exchange values, and performs every
S/MIME RSA private-key operation, among them the unwrap of the key-transport
ciphertext of inbound S/MIME. Pepsi’s fuzz builds instrument both with
AddressSanitizer: make fuzz builds AWS-LC through aws-lc-sys’s sanitizer
option and, with FUZZ_ASAN_NETTLE=1, the installed Nettle release from
source (fuzz/build-nettle-asan.sh), so the dkimkey target feeds every
input’s DER to an instrumented AWS-LC and pgp drives an instrumented Nettle
(Test Suite). A first bounded run of cms, pgp, dkimkey and
x509 with both libraries instrumented (fifteen minutes, three workers each;
about 82 million executions, 70 million of them dkimkey) found no memory
error, crash or hang. Fuzzing shrinks the risk and does not remove it: both
libraries are mature, and AWS-LC’s BoringSSL-derived DER parser is hardened, but
a bug there would be Pepsi’s exposure until a distribution update arrives. The
risk is inherited from dependencies, so library maintainers are the first line
of defence. A further option on Pepsi’s side is sequoia’s pure-Rust backend once
it is judged mature enough; Pepsi does not offer it as a build option. That
backend would bring the rsa crate and its timing weakness to OpenPGP
decryption (Timing and microarchitectural Bleichenbacher oracles (Marvin and successors)); deny.toml bans that
crate, and every RSA operation of Pepsi’s own runs on AWS-LC. Sequoia’s
pure-Rust backend and the RustCrypto CMS stack are also dependencies with their
own advisory history, which is why cargo deny runs on every release.
96.8.1.2. Buffer overflows in X.509 e-mail name-constraint checking¶
Name constraints (RFC 5280 section 4.2.1.10) restrict the names that a
subordinate CA may certify, and checking them for an rfc822Name or an
internationalised SmtpUTF8Mailbox means comparing e-mail address strings,
including decoding the punycode of internationalised addresses. OpenSSL 3.0’s
implementation of this check had three memory-safety bugs. During punycode
decoding, a crafted address could write four attacker-controlled bytes past a
stack buffer (CVE-2022-3602, reported by Polar Bear). In the same code, a
crafted address could overflow a stack buffer by an arbitrary number of .
characters (CVE-2022-3786, found by Viktor Dukhovni) [openssl2022]. A read
overrun in name-constraint checking could crash the process or, in theory,
disclose memory (CVE-2022-4203, reported by Corey Bonnell) [openssl2023a].
All three are reached only after the chain’s signatures verify, so the attacker needs a certificate issued under a trusted CA, or an application that carries on verifying after path building failed. Given that, a malicious TLS server crashes the clients connecting to it, and a malicious client crashes servers that request client certificates. CVE-2022-3602 was pre-announced as critical and downgraded to high because stack protections make code execution unlikely, and no exploit was known. The fixes are OpenSSL 3.0.7 (the first two) and 3.0.8 (the third).
Pepsi: Addressed. Impact: none.
Pepsi does not use OpenSSL for certificate validation. S/MIME paths are
validated by Pepsi’s own code in pepsi-crypto/src/trust/constraints.rs,
which enforces nameConstraints, policyConstraints and
inhibitAnyPolicy. It is written in safe Rust with no fixed-size buffers.
rfc822_within and dns_within compare lower-cased strings label by label,
and an unsupported name form refuses only the names of that form. The code is
checked against the NIST PKITS name-constraint tests
(pepsi-crypto/tests/pkits.rs) and additional fixtures in
pepsi-crypto/tests/data/nc/. The certificates of TLS servers that Pepsi
connects to, including their name constraints, are validated by
rustls-webpki, which is also Rust. A client certificate offered to a
submission listener that sets TLS_AUTH_CLIENT_CA is the one case where a
remote party reaches Pepsi’s own name-constraint code directly at connection
time: pepsi-ingress validates it with pepsi_crypto::trust::validate
(pepsi-ingress/src/smtp/clientcert.rs), so the rfc822Name constraints of
the configured CA’s path are checked by constraints.rs, in the ingress
process, before the client has authenticated. In either implementation a
malformed name can only produce an error or a refused certificate, never an
out-of-bounds write. A structure-aware fuzz target for the name-constraint
matchers is listed as remaining work in docs/ROADMAP.md. Its absence leaves
logic bugs, not memory corruption, as the residual risk (Security model).
96.8.1.3. Malleable ASN.1 OID encoding accepted by a DER decoder¶
An ASN.1 object identifier names an algorithm, an extension or a policy, and
every security decision about a certificate or a CMS structure depends on
comparing such identifiers exactly. DER requires a single, minimal base-128
encoding of each arc, so that parsed values and the signed bytes correspond one
to one. In 2025 Lin et al. tested their formally verified X.509 parser (Verdict)
differentially against the widely used Rust der crate of the RustCrypto
project. They found that its OID encoding was incorrect and malleable in certain
arc ranges, so that two different identifiers (their example: 1.2.128 and
1.2.0) produced the same bytes [lin2025]. Distinct identifiers that
serialise identically undermine any decision keyed on an OID and the
correspondence between a parsed value and what was signed, although the authors
note that not every reported issue is immediately exploitable. The der
author confirmed the bug and fixed it. The RustCrypto const-oid changelog
records the fixes (“large arc handling”, “bugs in base 128 encoder”) in
const-oid 0.10.0 of February 2025. Verdict’s own parser is proved
non-malleable and prefix-secure.
Pepsi: Partly addressed. Impact: low.
Pepsi’s S/MIME stack (cms 0.2.3, x509-cert 0.2.5, der 0.7.10) still
uses const-oid 0.9.6, which predates the fix. Its base-128 encoder tests n
> 0x80 where n >= 0x80 is meant, so an arc that reaches the value 128 at
any base-128 digit is mis-encoded when an OID is built from its dotted text. The
decoder also accepts a non-minimal arc (a leading 0x80 octet) without
complaint. Neither path lets an attacker make Pepsi confuse two identifiers.
OIDs taken from received certificates and CMS structures are only decoded, never
re-encoded from text, and most decisions compare them as ObjectIdentifier
values, whose equality compares the encoded bytes: a non-minimal encoding never
equals one of Pepsi’s algorithm or extension constants there, and it is refused
as unsupported. Two checks compare the dotted text instead: the extended key
usages of a certificate (certificate_facts in pepsi-crypto/src/smime.rs,
read for id-kp-emailProtection and, in
pepsi-ingress/src/smtp/clientcert.rs, for id-kp-clientAuth) and the RSA
test before a compromised-key lookup (pepsi-crypto/src/badkeys.rs). There a
non-minimal encoding reads as the identifier it spells, where a strict DER
decoder would refuse the certificate; it never reads as a different identifier,
and only the certificate’s signer, an issuer the path already trusts, can put
one there. The OIDs that Pepsi builds from text are its compile-time constants
(ObjectIdentifier::new_unwrap) and the caller-supplied initial policy set of
check_path_with, used by the PKITS tests and the fuzz target. Run-time text
goes through pepsi_crypto::oid::from_dotted, which encodes the arcs with its
own minimal base-128 encoder and hands the octets to const-oid’s decoder,
never to its encoder. A source-scan test refuses ObjectIdentifier::new,
FromStr and parse::<ObjectIdentifier> anywhere else in the workspace,
and a second test checks every new_unwrap literal in the workspace against
that encoder, so a constant with an arc of 128 or more at the wrong digit fails
the tests instead of naming another OID; unit vectors pin arcs 127, 128, 16383
and 16384 against hand-computed DER.
The residue is a known-buggy dependency in the most security-sensitive part of the
tree, kept from doing harm by those two tests, and a decoder that does not insist on
DER for the identifiers it reads. The upgrade path is a cms release
built on the der 0.8 generation, which uses const-oid 0.10. No such release
exists yet: cms 0.2.3 is the latest and pins der 0.7, spki 0.7 and
x509-cert 0.2. Making one is the library maintainers’ work; nothing
further is left for Pepsi’s code until it exists.
96.8.2. Cryptographic weaknesses¶
Weak or broken algorithms, parameters and randomness, oracles, malleable encryption and side channels.
96.8.2.1. Bleichenbacher padding oracle in RSA PKCS #1 v1.5 decryption¶
RSA encryption with PKCS #1 v1.5 padding carries no integrity check, and RSA is multiplicatively homomorphic. An attacker who holds a ciphertext can multiply it by chosen values and submit the results. If the key holder reveals in any way whether each result decrypts to a correctly padded block, the answers narrow the plaintext interval by interval until the plaintext, or one private-key operation such as a signature, is recovered. The revealing signal can be an error message, a different reaction or a timing difference. Bleichenbacher described this “million message” attack in 1998 against SSL 3.0, needing 300,000 to 2 million queries [bleichenbacher1998]. PKCS #1 has recommended OAEP ever since and keeps v1.5 only for compatibility, demanding that all decoding failures be indistinguishable, and warning that a v1.5 oracle on a key also used with OAEP undermines OAEP [rfc2437] [rfc8017]. Shoup used the attack to argue that only chosen-ciphertext-secure encryption behaves like the “secure envelope” that protocols assume [shoup2000]. Bauer et al. showed that one oracle query already distinguishes two candidate plaintexts [bauer2010]. Smart recovered low-entropy EMV PINs with fewer than 30 queries [smart2010].
The attack has been made steadily cheaper, and the oracle has been found in ever
more places. Partial padding checks are no shelter: an oracle that checks only
the separator or skips the 0x02 byte still leaks the plaintext, sometimes
with fewer queries [gao2013]. Refined interval search brought the median for a
1024-bit key down to 14,500 queries and broke PKCS #11 tokens and smartcards
(Aladdin, Gemalto, RSA SecurID, SafeNet, Siemens CardOS, the Estonian eID
through JDigiDoc) in minutes [bardou2012] [focardi2012], and later work cut
the cost of restrictive oracles by a further factor of four [kelesidis2022]. In
TLS the version-number check gave a “bad version” oracle in two thirds of 611
servers [klima2003]. Java’s alerts and timing (CVE-2012-5081) and Cavium
accelerators in F5 and IBM appliances (CVE-2014-0852) leaked new side channels
[meyer2014] [meyer2013] [rfc7457]. ROBOT (2018) found 2.8% of the top million
HTTPS hosts and products from F5, Citrix, Cisco, Radware, Palo Alto, IBM,
wolfSSL and Bouncy Castle still vulnerable, and forged a signature with
facebook.com’s key [bock2018]. Jager et al. broke XML Encryption with direct
error oracles and showed that the usual countermeasure, substituting a random
key on a padding error, fails when the payload is unauthenticated CBC. A real
key gives a stable outcome on repetition and a random one does not, and the
attack recovers even AES-GCM content as long as CBC is accepted [jager2012].
For e-mail the attack targets the session key in S/MIME key transport and in RSA OpenPGP, both of which still use v1.5 [nguyen2004]. A decrypting gateway that bounces, quotes or reacts differently is the oracle. Ising et al. found weak padding checks in GPGSM and showed that relabelling an S/MIME message to RC4 disables NSS’s key-length check. OpenPGP’s additional algorithm, length and checksum checks keep the attack infeasible there [ising2023]. Suter-Dörig showed that because CMS recipient identifiers need not be unique, a receiver that tries every matching recipient info can be fed a batch of candidates per e-mail, cutting the number of messages by more than two orders of magnitude. He also found that OpenSSL’s random-key countermeasure still leaks in a gateway [doerig2026]. MEGA’s legacy chat key exchange had a Bleichenbacher-style oracle on a custom padding [backendal2023]. The fixes are indistinguishable, constant-time handling of every failure (implicit rejection), stopping at the first matching recipient, authenticated content encryption, OAEP or elliptic-curve key agreement instead of v1.5, and never sharing a key between v1.5 and OAEP or between decryption and signing.
Pepsi: Partly addressed. Impact: low.
The TLS variants (Klima, ROBOT, Meyer) do not apply. rustls, the only TLS stack
in Pepsi, has never implemented RSA key exchange. Pepsi has no PKCS #11 tokens
or other key-unwrapping service. Outbound S/MIME uses RSA-OAEP-SHA-256 by
default (KeyTransport::OaepSha256). The exposed path is
pepsi-stage-decrypt applying the deployment’s own RSA keys to key
encapsulations that anyone can send. A newly generated identity is P-256 (the
[pepsi] CRYPTO_SMIME_ALGORITHM default), to which mail arrives as ECDH key
agreement and never reaches that path; the path is reached through the RSA
identities that a deployment holds, whether generated under
CRYPTO_SMIME_ALGORITHM = rsa or imported, and most S/MIME clients still send
v1.5 to such an identity. unwrap_cek in pepsi-crypto/src/smime.rs
performs the RSA operation with AWS-LC (aws-lc-rs), whose padding check and
arithmetic are constant time, and applies RFC 8017 implicit rejection on top:
an unpadding failure, or a recovered key of the wrong length, is replaced by a
substitute key of exactly the length that the content cipher needs, so content
decryption runs in full and fails at the GCM tag or the CBC padding exactly as a
wrong key would. The substitute is not random: it is HMAC-SHA256 over the
ciphertext, keyed with a hash of the private exponent and expanded to the
content-key length (implicit_rejection_cek, as OpenSSL 3.2 does), and it is
computed before the unpad result is looked at, so a resent key encapsulation
always opens the content the same way and the valid-padding oracle that Jager et
al. and Suter-Dörig describe does not exist (test
implicit_rejection_is_deterministic_per_ciphertext). The choice between the
substitute and the recovered key is a constant-time select (select_cek); the
one branch left is on AWS-LC’s unpadding return code, which its API cannot avoid
(Timing and microarchitectural Bleichenbacher oracles (Marvin and successors)). first_cek stops at the first
recipient info naming our certificate, which removes Suter-Dörig’s batching, and
caps recipient infos at 256. Only AES-CBC, AES-GCM and (under
CRYPTO_ALLOW_DOWNGRADE = yes) 3DES are accepted, so the RC4 relabelling has
no target. blur_rsa_timing holds the RSA step to a randomised deadline. The
verdict is reached asynchronously after the SMTP transaction. With the defaults
(ON_DECRYPT_FAILURE = passthrough) nothing that the sender sees depends on
the outcome, no DSN names the failure class (the setting bounce is an alias
for bounce-if-unproblematic, which drops rather than bounces a failed
ciphertext without integrity protection), and DSNs for mail that arrived
encrypted quote only its addressing fields (pepsi-stage-decrypt,
End-to-end encryption: two custody modes). OpenPGP decryption goes through sequoia, whose extra checks
make the attack impractical. Pepsi’s own OpenPGP identities default to Cv25519
rather than RSA.
Two residues remain. Whether a bounce comes at all would be observable where a
stage after decryption judged the plaintext and bounced, and no stage does so
for content from an EnvelopedData container (AES-CBC or 3DES):
ON_BAD_SIGNATURE = bounce, pepsi-stage-reencrypt’s ON_NO_CLIENT_KEY =
bounce, a milter rejection and every give-up drop such a message, and the
language gate delivers it marked (CBC padding and format oracles against unauthenticated S/MIME); what is
left of that channel is processing time. And the
same RSA key accepts both v1.5 and OAEP key transport, so a working v1.5 oracle
would also expose OAEP-wrapped keys, and for an S/MIME identity with
purpose = both it would also yield signatures.
The p256 default keeps RSA key transport away from new identities; it stays
for the RSA identities that a site keeps, and for a site that sets
CRYPTO_SMIME_ALGORITHM = rsa because its correspondents’ clients cannot
encrypt to an EC certificate (docs/ROADMAP.md, Client interoperability).
Refusing inbound v1.5 is not realistic, since the S/MIME standard and the
deployed clients still require it, so Pepsi has no option for it
(RSA key reuse across encryption and signature schemes enables cross-attacks). A failed OAEP decoding takes the same
implicit-rejection path as a failed v1.5 unpadding, so the two paddings fail
alike (Manger chosen-ciphertext attack on distinguishable RSA-OAEP decoding errors), and pepsi-status lists, in its “RSA
decryption keys” section, the identities on which both are accepted, so an
operator can supersede them with P-256 ones.
96.8.2.2. Timing and microarchitectural Bleichenbacher oracles (Marvin and successors)¶
Bleichenbacher’s attack on RSA PKCS #1 v1.5 decryption needs only one bit per
query: did this chosen ciphertext decrypt to a conforming plaintext? Implementations
that return one uniform error still leak that bit if the time or the memory access
pattern of decryption depends on the plaintext. The leak can sit in three places:
the conversion of the RSA result to bytes (a big-number library that drops leading
zero words is faster when the top bytes are zero), the padding check itself, and the
“countermeasure” that replaces a bad plaintext with random bytes only on the failure
branch. Ronen et al. showed that cache (Flush+Reload) and branch-prediction
observations by co-located code break seven of nine patched TLS libraries,
including OpenSSL, NSS, GnuTLS, s2n, mbedTLS, CoreTLS and wolfSSL (CVE-2018-12404,
CVE-2018-16868 to -16870, CVE-2018-19608) [ronen2019]. Kario’s Marvin attack then
showed, with careful statistics, that plain timing differences of microseconds are
measurable over loopback or a local network and still present in exception-raising
wrappers (CVE-2020-25657, CVE-2020-25659), NSS, GnuTLS (CVE-2023-0361) and
OpenSSL’s bignum normalisation even under blinding (CVE-2022-4304)
[kario2023] [openssl2023a]. The RustCrypto rsa crate was found vulnerable in
the same study (RUSTSEC-2023-0071, CVE-2023-49092); the advisory lists the
affected versions and any fixed release [rustsec-2023-0071].
In hybrid formats the signal can be amplified: a receiver that decrypts the payload
only when the key transport was valid lets the attacker choose a large payload, so
the time difference becomes visible across a noisy network, as Jager et al. showed
against Apache Axis2’s XML Encryption [jager2012].
The gain is the same as for the classic oracle: decryption of any captured ciphertext to that key (a TLS RSA key exchange, a CMS content-encryption key) or a signature with the victim’s key, without the key ever leaving the host. The precondition is the ability to submit many chosen ciphertexts and to time them, remotely or from a co-located process. Fixes are constant-time arithmetic for the final unblinding step, implicit rejection that returns a deterministic pseudo-random plaintext instead of an error, uniform work after a failure, and, as the root fix, abandoning RSA PKCS #1 v1.5 encryption in favour of (EC)DH [kario2023] [ronen2019].
Pepsi: Partly addressed. Impact: low.
TLS is not exposed: every Pepsi endpoint uses rustls, which offers only (EC)DHE
key exchange, so a certificate key is never used to decrypt. The exposed path is
pepsi-stage-decrypt unwrapping an S/MIME KeyTransRecipientInfo with the
host’s own RSA key (unwrap_cek in pepsi-crypto/src/smime.rs), which
anyone who can send mail reaches when the identity is RSA. [pepsi]
CRYPTO_SMIME_ALGORITHM defaults to p256, so a newly generated identity
receives ECDH key agreement and never reaches this path; the path is left to the
RSA identities that a site holds, generated under rsa or imported. That
private-key operation, for PKCS #1 v1.5 and OAEP alike, runs on AWS-LC (through
aws-lc-rs, the library that already provides TLS), whose RSA arithmetic is
blinded and constant time. The variable-time arithmetic and the leading-zero
conversion behind RUSTSEC-2023-0071 are not in the build at all: the rsa
crate is no dependency, and deny.toml bans it. AWS-LC accepts RSA keys of
2048 to 8192 bits; an identity outside that range (a smaller one is importable
only under a lowered CRYPTO_MIN_RSA_BITS) is refused with a warning and
cannot decrypt, rather than being decrypted some other way.
Around that operation Pepsi keeps three further layers. The decision is made
asynchronously in the pipeline after the SMTP transaction, so there is no
synchronous response to time. PKCS #1 v1.5 failures get RFC 8017 implicit
rejection. On every call, before the unpadding result is looked at, Pepsi
computes a substitute key of exactly the length that the content cipher needs,
derived from the ciphertext under a secret that only the private-key holder
knows (implicit_rejection_cek, see
Bleichenbacher padding oracle in RSA PKCS #1 v1.5 decryption). The choice between this key and the
recovered key is a constant-time subtle select (select_cek), so the
content decryption that follows costs the same and the payload-size
amplification of [jager2012] has nothing to amplify. And blur_rsa_timing
holds every RSA unwrap, success and failure alike, to a deadline of 5 ms plus a
CSPRNG-drawn jitter of up to 10 ms, so the observable duration does not track
the operation’s own. OAEP failures take the same path: the same derived
substitute and the same select replace a key whose OAEP decoding failed, so the
content decryption runs in full after either padding. The mitigation and its
limits are documented in docs/ROADMAP.md and the regression test
pepsi-crypto/tests/timing.rs.
What remains is one data-dependent branch. AWS-LC checks PKCS #1 v1.5 padding in
constant time but declassifies the verdict into a return code, and aws-lc-rs
offers no raw RSA decryption that would let Pepsi unpad in constant time itself,
so unwrap_cek reads that result once before the constant-time select. This
is the same branch that the rsa crate has, and the OAEP arm reads AWS-LC’s
decoding verdict the same way. The branch could serve a local shell user on the
Pepsi host or a co-tenant VM (A local shell user) who drives chosen ciphertexts
through the key by e-mail and watches the branch predictor; against a remote
attacker, the deadline and the asynchronous pipeline cover it. The cause is a
dependency. The default CRYPTO_SMIME_ALGORITHM = p256 makes inbound S/MIME
to a new identity arrive as ECDH KeyAgreeRecipientInfo and never reach RSA
decryption; a site that sets rsa for correspondents whose clients cannot
encrypt to an EC certificate takes the branch back on purpose
(Key management, Client interoperability). Hosts with untrusted local
users should run the crypto stages elsewhere, keep the default, and supersede
any RSA identity generated earlier with a P-256 one; the “RSA decryption keys”
section of pepsi-status lists the identities that this concerns. S/MIME
signing, key generation, encryption to a correspondent’s RSA key and the
verification of RSA signatures run on AWS-LC as well, and
CRYPTO_GENERATE_RSA_BITS accepts only the four sizes that AWS-LC generates
(2048, 3072, 4096, 8192). The numbers of an RSA key are read from its PKCS #1 or
PKCS #8 encoding with the der crate (pepsi-crypto/src/rsakey.rs).
OpenPGP RSA decryption runs in sequoia’s nettle backend, and the default OpenPGP
identity is Cv25519.
The elliptic-curve identity that the default steers inbound mail to has a timing
question of its own: opening a KeyAgreeRecipientInfo multiplies the sender’s
ephemeral point, which the sender chooses and can resend at will, by our static
private scalar. The RustCrypto p256/p384 0.13 crates compute on
crypto-bigint 0.5, whose subtraction, division and Montgomery multiplication
can take secret-dependent branches, depending on compiler and target CPU
(RUSTSEC-2026-0387, fixed only in the 0.7 generation, which those crates cannot
use while the S/MIME stack is held on der 0.7) [rustsec-2026-0387]. So
every EC private-key operation runs on AWS-LC, whose P-256 and P-384 arithmetic is
constant time: that static-key ECDH, the ephemeral ECDH of outbound key agreement,
ECDSA signatures on CMS messages and on generated certificates and requests, and
key generation (pepsi-crypto/src/eckey.rs). Public points are parsed and
signatures verified on AWS-LC as well, so p256, p384 and crypto-bigint
0.5 are not in the build at all; a source-scan test keeps them out.
96.8.2.3. CBC padding oracles (Vaudenay) recover plaintext from padding errors¶
CBC decryption is malleable: flipping bits in one ciphertext block flips the same bits in the next plaintext block. If the receiver of an unauthenticated CBC ciphertext reveals in any way whether the padding of the decrypted text was valid, the attacker can modify the preceding block until the padding is accepted and learn the intermediate decryption value byte by byte, at about 128 queries per byte. The signal can be an error message, an HTTP status, a bounce, a log entry or a timing difference. Vaudenay described the attack in 2002 for the PKCS #5/#7 padding used by SSL/TLS, IPsec, WTLS and S/MIME [vaudenay2002]. Follow-up work showed it applies to almost every padding scheme: the ISO paddings designed for MACs and hashes, where length-encoding methods give near-optimal attacks [paterson2004], even with secret random IVs [yau2005]; only schemes where every string decrypts to valid padding offer no INVALID answer, and OZ-PAD merely resists the original attack [paterson2008] [kang2016]. The oracle generalises to a format oracle: Jager and Somorovsky decrypted XML Encryption at 14 requests per byte by watching the XML parser fail on the garbled plaintext, defeating XML Signature by wrapping [jager2011].
Rizzo and Duong made the attack practical against web frameworks that encrypt
client-held state (JSF view state, Rails MessageEncryptor, ESAPI, CAPTCHA
tokens) and added CBC-R, which uses the same oracle to encrypt chosen
plaintexts without the key [rizzo2010]; a tutorial reproduction forges an admin
token this way [dimitrova2024]. The same weakness appears in hardware, in the
CBC key-unwrap of PKCS #11 tokens [bardou2012] and in GlobalPlatform’s SCP02
smart-card channel, where encrypt-and-MAC forces the padding check before the
MAC and response timing leaks the outcome [avoine2018]. It also appears in mail
servers: Microsoft Exchange stored the password in an AES-CBC cadata cookie
and redirected to different error pages for bad padding (ProxyOracle,
CVE-2021-31196) [tsai2021]. The gain is plaintext recovery and ciphertext
forgery without the key; the precondition is the ability to submit modified
ciphertexts and observe the reaction. Unified error messages are not enough
(timing and format reactions leak); the fix is authenticated encryption, or a
MAC checked before the padding is examined.
Pepsi: Partly addressed. Impact: low.
Everything Pepsi encrypts for itself uses AES-256-GCM: the key-store wrap under the
KEK (pepsi_common::keystore::wrap, with the row’s address, protocol and purpose
as associated data), secure-link messages and session cookies
(pepsi-secure-link/src/crypto.rs), and configuration archives
(pepsi-config/src/archive.rs). Admin sessions are random tokens stored as
digests, not encrypted state. TLS uses rustls, which implements no CBC suites.
Inbound OpenPGP uses CFB without padding, the MDC or AEAD check is fatal, and
unprotected SED packets are refused (pepsi-crypto/src/pgp.rs). So there is no
Pepsi-specific analogue of the web and token oracles.
The one CBC decryption that Pepsi performs is S/MIME EnvelopedData.
open_enveloped always accepts it inbound, because most of the world’s S/MIME
clients still send it. Pepsi itself emits it only to a correspondent whose
per-peer S/MIME capability record says that their client cannot read AEAD, or to
everybody under CRYPTO_ALLOW_DOWNGRADE = yes (Which S/MIME container a correspondent gets; a
correspondent without a record gets AuthEnvelopedData and, once per
certificate, a plaintext notice about it). With the defaults nothing that the
sender can see depends on the padding outcome: decryption happens after 250
OK, ON_DECRYPT_FAILURE = passthrough delivers both outcomes, DSNs and
automatic replies about a message that arrived encrypted quote only its
addressing fields, bounce-if-unproblematic never bounces a failed CBC
ciphertext, and no key discovery is started for content from an unauthenticated
container (pepsi-stage-decrypt). No setting of the inbound
stages gives the answer back either: bounce-if-unproblematic is the only
bouncing ON_DECRYPT_FAILURE value (bounce is an alias for it), and
ON_BAD_SIGNATURE = bounce and pepsi-stage-reencrypt’s ON_NO_CLIENT_KEY
= bounce drop a message whose content came out of an EnvelopedData rather
than bounce it. The gates after decryption follow the same rule: a milter
rejection, an expired retry and pepsi-failure-bouncer drop such a message,
pepsi-stage-block-language delivers it marked rather than bouncing it, no
signature from it whitelists its sender (which would decide whether pay-to-send
or confirm-to-send answers), and no reply is written in the language detected in
it. What remains is processing time. The details are assessed under
CBC padding and format oracles against unauthenticated S/MIME. The downgrade of GCM mail to CBC under the
same key is assessed under Downgrade from authenticated to unauthenticated encryption under the same key; RFC
9709 key derivation and [stage-decrypt] OPEN_ENVELOPED_DATA = no address it.
96.8.2.4. Manger chosen-ciphertext attack on distinguishable RSA-OAEP decoding errors¶
RSA-OAEP was introduced to replace PKCS #1 v1.5 encryption after Bleichenbacher’s attack, and it is provably secure – as long as decoding fails in one indistinguishable way. Decoding has two stages: converting the RSA result to an octet string, which fails when the leading octet is not zero, and the OAEP integrity check (label hash, padding, separator). Manger showed in 2001 that an implementation which lets an attacker tell the first failure from the second gives an oracle “is the decrypted integer below 2^(8(k-1))?”, and that RSA’s malleability turns it into a binary search: about 1,100 queries recover the plaintext of a 1024-bit ciphertext and 2,200 a 2048-bit one, orders of magnitude fewer than Bleichenbacher needs [manger2001]. He argued the distinction is likely to leak despite the standard’s demand for identical errors – through different error strings or log lines, errors that only the second stage can raise, and timing, notably the hash of attacker-supplied OAEP parameters, which implementations computed only in the second stage and which a long label makes arbitrarily slow. The gain is the plaintext of one ciphertext, typically a session key and hence the message; the precondition is chosen-ciphertext access to the decrypting party and any observable difference. PKCS #1 v2.1 (RFC 3447) answered by specifying that all decoding errors must be indistinguishable by message and by timing, and by advising against using one RSA key in more than one scheme [rfc3447].
Pepsi: Partly addressed. Impact: low.
Pepsi decrypts RSA-OAEP S/MIME key transport (ID_RSAES_OAEP in
unwrap_cek, pepsi-crypto/src/smime.rs) and emits OAEP-SHA-256 by
default. The private-key operation and the decoding are AWS-LC’s (through
aws-lc-rs) rather than the RustCrypto rsa crate’s: the arithmetic and
the integer-to-bytes conversion are constant time, so the conversion time does
not depend on leading zeros and gives Manger’s first-stage distinction nothing
to measure, and the leading-octet, label-hash and separator checks are combined
into one constant-time decision and one error; Pepsi maps every failure to
decryption-failed. The OAEP label is not taken from the attacker’s
parameters (the hash is, and an unsupported one is refused before any
private-key operation, independently of the plaintext), so the slow-parameter
trick does not work. Results reach the sender only asynchronously and, with the
defaults, not at all (ON_DECRYPT_FAILURE = passthrough), and the RSA
operation is held to a randomised deadline by blur_rsa_timing.
Whether the padding was valid at all does not show in the work that follows
either: an OAEP failure gets RFC 8017 implicit rejection like a PKCS #1 v1.5
one. Before the decoding result is looked at, Pepsi computes a key derived from
the ciphertext under a secret that only the private-key holder knows
(implicit_rejection_cek). A constant-time select (select_cek) puts this
key in place of a key whose decoding failed or whose length the content cipher
does not take. The content decryption therefore runs in full and fails at the
GCM tag or the CBC padding: the same class of failure that a wrong key gives,
and the same answer for every resend of one ciphertext. What remains is the one
branch on AWS-LC’s declassified decoding verdict, which aws-lc-rs offers no
way around (Timing and microarchitectural Bleichenbacher oracles (Marvin and successors)); it does not separate
Manger’s two stages, and remotely the deadline covers it. The default [pepsi]
CRYPTO_SMIME_ALGORITHM = p256 keeps RSA decryption away from new identities
altogether. Pepsi keeps OAEP and PKCS #1 v1.5 on the same identity key because
senders choose the padding, which RFC 3447 advises against; that cross-scheme
risk is assessed under RSA key reuse across encryption and signature schemes enables cross-attacks.
96.8.2.5. Non-committing AEAD: one ciphertext decrypts validly under two keys¶
Authenticated encryption guarantees confidentiality and integrity for parties who hold the key; it does not guarantee that a ciphertext opens under only the key that made it. For AES-GCM, ChaCha20-Poly1305 and other schemes whose tag is a Carter-Wegman MAC, anyone who chooses two keys can solve a linear equation for one extra block so that a single ciphertext and tag authenticate under both and decrypt to two different messages [grubbs2017] [gueron2020]; with suitable tooling both plaintexts can be well-formed files (PDF, executables, images) and the computation takes about a second [albertini2022]. The same holds for AES-GCM-SIV, XSalsa20, OCB [bellare2022], nonce-derived XAES-256-GCM [kampanakis2026], the AES-round designs AEGIS (with constant work) and Rocca-S [derbez2024], and, through context-discovery attacks on their MACs, which are not preimage-resistant, for CCM, EAX and SIV; for the original SIV even key commitment falls, at about 2^53 work [menda2023]. Menda et al. also show that popular fixes such as prepending zero blocks commit to the key but not to the associated data.
Only an insider can exploit the weakness: the attacker must know or choose the keys. It matters wherever an application silently assumes that a ciphertext determines one plaintext. Facebook Messenger’s attachment franking let a sender deliver abusive content that an abuse report showed as an innocuous image (“invisible salamanders”) [dodis2018]; the AWS Encryption SDK let a sender wrap different data keys for different recipients of one envelope-encrypted message (CVE-2020-8897), and key rotation in a key-management service could change what an old ciphertext says [albertini2022]; trial decryption under password-derived keys becomes a partitioning oracle (Partitioning oracles test many password guesses per query). Fixes are key- or context-committing constructions: an explicit commitment string checked before decryption, a committing variant such as CAU-C1, HtE, KC-XAES or the AWS SDK’s commitment, or a collision-resistant MAC such as HMAC keyed from the same secret [bellare2022] [kampanakis2026] [gueron2020].
Pepsi: Addressed. Impact: none.
Pepsi uses non-committing AEADs because the standards define no committing
alternative: AES-GCM for S/MIME AuthEnvelopedData, the OCB/GCM of OpenPGP
SEIPDv2, and AES-256-GCM for its own key-store wrapping, secure-link messages
and configuration archives. Nothing in Pepsi relies on commitment, however. It
does no message franking and no deduplication by ciphertext. Its own AEAD keys
are never chosen by an attacker: the key-store KEK lives in secrets.d, and a
secure-link content key is derived by Argon2id from the PIN together with a
server-side pepper, over a ciphertext Pepsi produced itself
(The secure-link fallback portal). In the decrypt stage a message is either opened by Pepsi,
in which case the plaintext replaces the ciphertext so that every later stage
and the recipient’s client see the same text, or, when it is addressed to the
recipient’s own MUA key, passed through unopened (for_client), so Pepsi
never scans one plaintext while the client displays another.
A sender can still wrap different session keys for different recipients of one OpenPGP or CMS message, so that each reads a different authenticated text. This gives the sender nothing that SMTP does not already allow: a sender can send each recipient different bytes, and Pepsi splits per recipient anyway. Should Pepsi ever add abuse reporting on encrypted content, archive encrypted list traffic by ciphertext, or rotate keys over stored ciphertexts, commitment would have to be added explicitly.
96.8.2.6. Partitioning oracles test many password guesses per query¶
A partitioning oracle answers “is the secret key in this chosen set of keys?”. Len, Grubbs and Ristenpart showed in 2021 how non-committing AEAD provides one: an attacker can build a single AES-GCM (or ChaCha20/XSalsa20-Poly1305) ciphertext that decrypts without error under thousands of chosen keys, of length O(k) for k keys. If a system decrypts attacker-supplied ciphertexts under a key derived from a password or PIN and reveals success in any way, each query tests a whole partition of the dictionary, turning online guessing into something close to a binary search. The signal can be an error, a reply, or even forwarding a packet rather than silently dropping it. Against Shadowsocks UDP proxies, 124 queries recovered the password 20% of the time, against about 60,000 for plain online guessing; non-compliant OPAQUE implementations, age and the HPKE draft were affected in principle. Per-query rate limiting does little, since each query covers many passwords. The fixes were ciphertext length limits, entropy requirements and committing AEAD for all password-based encryption [len2021]. Hao and van Oorschot record the older form of the same leak in password-authenticated key exchange: encrypting a structured value (an RSA public key, a Diffie-Hellman element) under a password-derived key lets a wrong guess decrypt to an impossible value, so EKE variants and OKE allowed the password space to be partitioned offline; later designs (PAK, SPAKE2, CPace, OPAQUE) mask group elements instead [hao2022].
Pepsi: Addressed. Impact: none.
Pepsi has two places where a low-entropy secret derives a decryption key, and in
neither can an attacker supply the ciphertext. The secure-link portal derives the
content key with Argon2id from the recipient’s PIN, a per-message salt and a pepper
from secrets.d/pepsi-secure-link.secret, and opens a ciphertext that Pepsi itself
stored in pepsi.secure_message; the visitor submits only PINs, and the session
cookie that later carries the content key is sealed under the high-entropy pepper,
so a forged cookie tests nothing about the PIN (pepsi-secure-link/src/crypto.rs,
The secure-link fallback portal). Without the pepper an attacker cannot even compute candidate
keys to build a multi-collision ciphertext. Configuration archives
(pepsi-config export/import) are Argon2id-plus-AES-GCM files that the
operator imports with a password they hold, not a service that answers strangers.
PIN guessing at the portal remains ordinary online guessing, one guess per Argon2id
derivation and rate limited (pepsi-secure-link/src/limiter.rs); it is assessed
under Online guessing and spraying of passwords and PINs. Pepsi implements no PAKE; submission and console
logins send the password over TLS, and the console checks it against an Argon2id
hash, so neither involves a password-keyed decryption of attacker data.
96.8.2.7. Unauthenticated encryption modes are malleable and forgeable¶
ECB, CBC, CFB, OFB, CTR and Kerberos’s PCBC, the classic modes of operation, provide secrecy against eavesdroppers but no integrity. Every ciphertext of a suitable length decrypts to some plaintext, so an active attacker can splice, reorder, truncate, extend or bit-flip ciphertext and the receiver accepts the result; with ECB or a known keystream the attacker can even encrypt chosen messages. Katz and Yung formalised the missing property as unforgeability, showed that together with chosen-plaintext security it yields chosen-ciphertext security, and named hybrid e-mail encryption such as PGP as a target [katz2001]. Adding an unkeyed hash inside the encryption does not help: in an attack that Vaudenay credits to Wagner, a sender who encrypts a secret followed by attacker-chosen data containing a valid padding and the hash of a guessed secret produces a ciphertext whose truncation the receiver accepts exactly when the guess was right [vaudenay2002]. The same anti-pattern reappears in current products: Hofmann and Truong found that Icedrive and Seafile encrypt files with CBC under fixed IVs, that Seafile and pCloud do not authenticate the chunk list, and that no provider but Tresorit binds names, locations or metadata to content, so a malicious server can tamper with and inject files [hofmann2024]. The gain is undetected modification, and through decryption oracles plaintext recovery (padding oracles, EFAIL). The remedy is an authenticated encryption mode with fresh nonces that also authenticates structure and metadata.
Pepsi: Partly addressed. Impact: low.
Pepsi’s own storage encryption is authenticated and bound to its context:
private keys are AES-256-GCM under the KEK with the row’s address, protocol and
purpose as associated data (pepsi_common::keystore::wrap), and secure-link
messages are AES-256-GCM with the token as associated data. OpenPGP is not
affected either: sequoia enforces the SEIPDv1 MDC or the SEIPDv2 tag, Pepsi
releases no plaintext from a failed check, SED packets without integrity
protection are refused, and the Wagner truncation needs an unkeyed hash that an
attacker can compute, whereas the MDC also covers a random prefix that the
attacker does not know.
S/MIME is where the weakness lives, and it is inherited from compatibility.
open_enveloped always accepts AES-CBC EnvelopedData (and 3DES-CBC under
CRYPTO_ALLOW_DOWNGRADE = yes), and Pepsi emits AES-CBC instead of
AuthEnvelopedData to a correspondent recorded as unable to read the latter,
as Thunderbird 140 is (Client interoperability, Which S/MIME container a correspondent gets); a
correspondent without a record gets AuthEnvelopedData. So an attacker
holding a captured S/MIME message to a Pepsi user can splice its blocks, reuse
its RecipientInfo, and send the result to the same user, and
pepsi-stage-decrypt decrypts it. What the stage delivers differs from what
it delivers for authenticated GCM: unless a valid signature inside the
container covers the plaintext, every part a client would render as markup is
relabelled text/plain (pepsi_crypto::mime::plain_text_only), the subject
tag is [decrypted, unauthenticated] in place of [decrypted], and
X-Pepsi-Crypto and state.crypto.in record the layer as unauthenticated
and sanitised ([stage-decrypt] UNAUTHENTICATED_PLAINTEXT, default text).
The require-signature setting leaves such a message encrypted for the user’s
own client instead, and open restores the markup. A GCM key encapsulation
relabelled as CBC is decrypted under the same key unless its sender bound the
content key to the algorithm by RFC 9709 key derivation, as Pepsi does for a
correspondent whose client advertises it
(Downgrade from authenticated to unauthenticated encryption under the same key), and pepsi-stage-reencrypt
seals stored mail to a recipient’s S/MIME client key under the same CBC rule, so
the stored mail of a user recorded as needing CBC is malleable to whoever holds
the mailbox; an inner signature, where present, still detects the change.
Refusing CBC would make most S/MIME correspondents unreadable and would make Pepsi’s
own mail unreadable in Thunderbird, so the durable fix lies with the clients
(AuthEnvelopedData support); a client that gains it and announces it in the
SMIMECapabilities of its signatures gets AEAD from Pepsi, since the learnt
record is keyed on the certificate (an operator-configured record for the address
still wins, Which S/MIME container a correspondent gets). What remains is the garbled text
itself: a user who replies quoting a [decrypted, unauthenticated] message
returns the plaintext (Chosen-ciphertext attacks via a reply oracle on unauthenticated encryption). Inbound CBC
can be left unopened for the whole site or, through an address: or
domain: overlay of [stage-decrypt] OPEN_ENVELOPED_DATA = no
(pepsi-config), for chosen recipients, such as a user whose correspondents
all send AuthEnvelopedData; it is not offered per correspondent, because the
container’s sender is known only from the outer From:, which a spliced or
relabelled ciphertext lets the attacker write
(Downgrade from authenticated to unauthenticated encryption under the same key, End-to-end encryption: two custody modes).
96.8.2.8. Unauthenticated private-key encryption lets the storage holder maul keys¶
When a private key is stored encrypted but not authenticated, whoever can write the stored copy can change it without knowing the passphrase, and the owner’s software then computes with a corrupted key. Klíma and Rosa showed this for the OpenPGP secret key packet in 2001: the public parameters are in the clear, the private values are CFB-encrypted under a 16-bit checksum, and nothing binds the two, so replacing the DSA group or flipping a bit of the RSA CRT coefficient turns the next signature into one that reveals the private key [klima2002] [schwenk2022]. The packet format was never changed, and Bruseghini, Huigens and Paterson revived the attack in 2022 as “key overwriting”: against five OpenPGP libraries, FlowCrypt and ProtonMail, an attacker with write access to the stored key relabels or re-parameterises it so that the private key follows from one faulty DSA, EdDSA, ECDSA or non-CRT RSA signature, or from the success or failure of decryptions under altered ElGamal or ECDH parameters. Even the key validation added as a fix leaks the secret through whether validation succeeds (KOKV), in fewer than about 7000 queries [bruseghini2022].
The same pattern breaks cloud stores that hold users’ wrapped keys. MEGA wrapped
the RSA key with AES-ECB under one master key and no integrity check; the server
overwrote the CRT parameter u and learnt a bit of a prime from each login
(1023 logins, later six), then spliced other ECB blocks into the key to decrypt
every file key and the signing key, and finally forged files that passed the
client’s checks [backendal2023] [backendal2024]. pCloud stored the private key
under an unauthenticated scheme that let the server make the client use a key
pair of the server’s choosing, and Sync and pCloud let the server substitute
unauthenticated key ciphertexts [hofmann2024]. In every case the remedy is the
same: wrap the whole key, public parameters and algorithm included, with an AEAD
and bind its context as associated data, use separate key-encryption keys per
purpose, and do not rely on validation. The OpenPGP crypto-refresh (RFC 9580)
adopted AEAD protection of secret key packets [bruseghini2022].
Pepsi: Partly addressed. Impact: low.
The wrapping itself is the construction that the papers recommend. A server-held
private key is stored in crypto_identity.private_wrapped as 0x02 || nonce
|| AES-256-GCM(KEK, ...) (pepsi-common/src/keystore/wrap.rs), with the
address, protocol, purpose and key fingerprint as length-prefixed associated
data. The plaintext is the complete OpenPGP transferable secret key or the
complete PKCS#8 structure, so the algorithm and every public parameter are
inside the authentication. A modified or moved blob fails Kek::unwrap before
any private-key operation, and the failure looks the same whatever the cause, so
there is neither a faulty-signature path, nor a decryption oracle, nor a
validation oracle. OpenPGP’s own S2K/CFB secret-key protection is never used.
The key-encryption key is derived per wrap_key_id by a labelled HMAC
extraction, the TOTP secrets use their own wrapping context, and the secure-link
store uses a separate Argon2id-derived per-message key, so no single malleable
mode wraps everything. Only the pepsi-crypto role may read or write the
column, and the KEK lives outside the database in secrets.d
(The private-key custody boundary, Key management).
Three further points were examined; the first two are covered, the third is
inherent to gateway custody. First, the public half must be bound to the private
one: public_material and fingerprint sit beside the blob and are served
over WKD, advertised in Autocrypt: and used as the user’s own key, so if a
service role could write them unchecked, a compromised component could make
correspondents encrypt to a key of its choice, which is the pCloud outcome
reached by another route (Unauthenticated stored encrypt-to-self key replaced to read sent mail). Every unwrap
for use (pepsi_keymat::open) compares the stored public half and fingerprint
with the unwrapped key and refuses the identity on a mismatch; no ordinary
service role (pepsi, pepsi-httpd, pepsi-ingress,
pepsi-telemetry) can insert an identity or update anything but its use flags
and key-server progress columns, which pepsi-setup verifies against
PostgreSQL; and WKD withholds a row whose public half is not the key that its
fingerprint names. Only the key-custody role or the schema owner can still
replace both together, and the identity then stops working at once. Second,
associated data that named the row’s context but not the key’s fingerprint would
let the custody role swap the blobs of two identities with the same address,
protocol and purpose, for example put back a retired key; wrap format 2 binds
the fingerprint too. Format-1 blobs open as well, and can be swapped among
themselves, until pepsi-keys wrap rotate re-wraps them. Third, MEGA’s
framing attack has an analogue that no wrapping can remove: under gateway
custody Pepsi itself signs and decrypts for the user, so the operator or a
compromised stage can obtain signatures on content of its choosing
(Gateway custody (custody = local, the MTA key), A compromised component,
Key escrow, provider-held keys or provider-served crypto code defeat E2EE). Only custody = client avoids that
one, at the cost of the gateway’s convenience.
96.8.2.9. RSA key reuse across encryption and signature schemes enables cross-attacks¶
A security proof for one RSA scheme says nothing once the same key pair is also used by another, weaker scheme. RFC 4055 therefore asks that an OAEP key be used only for OAEP and a PSS key only for PSS, each with fixed parameters, and warns against sharing a key between key transport and signatures [rfc4055]; the 1988 X.509 framework had in effect mandated exactly that sharing [ianson1990]. Jager, Paterson and Somorovsky made the danger concrete in 2013 as “backwards compatibility attacks” [jager2013]. Bleichenbacher’s PKCS #1 v1.5 oracle [bleichenbacher1998] computes the RSA private-key function on any value, so an attacker who relabels an OAEP ciphertext as v1.5 decrypts it through a v1.5 oracle on the same key, and an attacker who feeds a signature’s encoded message to the oracle obtains a valid PKCS #1 v1.5 signature on a message of their choice. They demonstrated both against XML Encryption/Signature and JSON Web Encryption/Signature (Apache WSS4J/CXF, Nimbus-JWT, Ping Identity, Shibboleth), including forged SAML tokens.
In mail the precondition is common: an X.509 certificate does not restrict its
RSA key to one padding, so an S/MIME recipient key is used with whatever
keyEncryptionAlgorithm the unauthenticated RecipientInfo names, and some
S/MIME profiles and clients still use one key for signing and decryption. The
fixes are key separation with the permitted algorithm stated in the certificate
and enforced, refusing PKCS #1 v1.5 where possible, and, above all, decryptors
that expose no padding oracle; vendors responded by disabling PKCS #1 v1.5 by
default (Shibboleth 2.5.0) or for senders (Ping Identity) [jager2013].
Pepsi: Partly addressed. Impact: low.
Pepsi separates keys by default and emits OAEP, but its decryptors accept both
paddings and, in one non-default case (CRYPTO_SMIME_SHARED_KEY), apply a
signing key to attacker-chosen ciphertext. For S/MIME, generate_smime issues
a signing certificate and a separate encryption certificate, Pepsi encrypts with
RSAES-OAEP-SHA-256 (KeyTransport::OaepSha256), and pepsi-stage-decrypt
loads only encrypt/both identities. unwrap_cek in
pepsi-crypto/src/smime.rs still accepts both rsaEncryption and
id-RSAES-OAEP for the same key, chosen by the unauthenticated algorithm
identifier, because Thunderbird, Outlook and OpenSSL’s defaults still send PKCS
#1 v1.5. An OAEP-protected key is therefore only as strong as the v1.5 path,
which runs on AWS-LC’s constant-time RSA, uses implicit rejection (a substitute
key derived from the ciphertext on any padding failure, selected in constant
time) and pads the RSA work to a deadline (blur_rsa_timing). The supported
option [pepsi] CRYPTO_SMIME_SHARED_KEY = yes (RSA only) puts signing and
decryption on one key on purpose; Key management states that this gives
up the separation that stops a decryption oracle from forging signatures. On the
OpenPGP side the DecryptionHelper in pepsi-crypto/src/pgp.rs offers a
PKESK, addressed or anonymous, only to the keys that the certificate binds for
transport or storage encryption under the read policy (test
a_pkesk_for_a_signing_key_is_not_decrypted), so with
CRYPTO_OPENPGP_ALGORITHM = rsa or an imported RSA key the RSA signing key
never sees attacker-chosen PKCS #1 v1.5 ciphertext.
Whether the shared-key case becomes a forgery or a decryption depends on a
working padding oracle, and that is assessed in
Bleichenbacher padding oracle in RSA PKCS #1 v1.5 decryption. With the default
ON_DECRYPT_FAILURE = passthrough nothing that the sender can observe depends
on the outcome, and no bounce names a failure class (a diagnostic that
distinguished no-decryption-key from decryption-failed, which for
OpenPGP still demands a valid session-key checksum, would be an oracle), and the
S/MIME implicit-rejection key is derived deterministically from the ciphertext
(Bleichenbacher padding oracle in RSA PKCS #1 v1.5 decryption). What remains is that both paddings
are accepted on one S/MIME key and that CRYPTO_SMIME_SHARED_KEY = yes shares
a key on purpose, a cost that is latent rather than exploitable today, hence
low. Pepsi offers no option to refuse inbound PKCS #1 v1.5 key transport:
refusing it by default would lock out Thunderbird, Outlook and OpenSSL-default
senders, and an opt-in refusal would help only a site that keeps an RSA identity
and has no v1.5 sender, while the default already removes the exposure:
CRYPTO_SMIME_ALGORITHM = p256 takes RSA decryption away from new identities
altogether (Design principles, principles 2 and 5). What is left is for
operators, and pepsi-status shows it: its “RSA decryption keys” section
lists every active S/MIME identity that decrypts with RSA, marks one whose
signing and decryption share the key, and names the remedy: a new P-256 identity
from pepsi-keys identity generate, with the RSA one kept for old mail.
Operators should leave CRYPTO_SMIME_SHARED_KEY off unless a client
population needs it (it is RSA only, so it needs rsa spelt out).
96.8.2.10. Nonce reuse in GCM and counter-mode authenticated encryption (TLS, CMS)¶
GCM and the other counter-mode AEADs fail badly when a nonce repeats under one
key. The repeated keystream exposes the XOR of the two plaintexts, and because
the GCM tag is a polynomial in the hash key H masked by a nonce-derived value,
two tags under the same nonce cancel the mask and reveal H by a polynomial gcd.
This is Joux’s 2006 “forbidden attack”, which builds on an observation by
Ferguson. With H known, the attacker forges tags for arbitrary ciphertexts and,
given known plaintext, encrypts chosen content [joux2006]. Joux also showed
that NIST’s draft of SP 800-38D derived the counter for non-96-bit IVs without
the IV length, so distinct IVs could collide without any IV repeating; the final
standard fixed that, but never repeating a nonce remains essential. RFC 5083
gives the same warning for CMS AuthEnvelopedData: use a fresh content key per
message, an unpredictable nonce and a good random source [rfc5083].
TLS 1.2 left the 64-bit explicit part of the GCM nonce to the implementation. In
2016 Böck et al. found 184 HTTPS servers that repeated nonces: Radware load
balancers with Cavium hardware, a modified OpenSSL that ignored RAND_bytes
failures, and 23 servers that always sent zero. A further 70 000 servers used
random 64-bit nonces, among them IBM Lotus Domino and devices from Sangfor and
A10, and such nonces collide on long connections. The authors injected content
into the connections of affected sites, including VISA, the Polish banking
association and Deutsche Boerse [bock2016]. The CVEs include CVE-2016-0270,
CVE-2016-10212, CVE-2016-10213 and CVE-2017-5933 [rfc9325]. RFC 9325 now recommends the
record sequence number as the explicit nonce, and TLS 1.3 derives all nonces
deterministically [rfc9325]. The other remedy is nonce-misuse-resistant modes
such as AES-GCM-SIV [bock2016].
Pepsi: Addressed. Impact: none.
Pepsi never reuses a key under counter nonces it manages itself. On TLS, both
servers and the outbound SMTP client use rustls with the aws-lc-rs backend,
which takes the TLS 1.2 explicit nonce from the record sequence number and
derives TLS 1.3 nonces as the protocol prescribes; Pepsi has no nonce code of
its own on that path. For S/MIME, pepsi-crypto/src/smime.rs creates
AuthEnvelopedData with a fresh random 256-bit content key per message
(Secret::random(32)) and a fresh random 12-octet nonce, so even a weak nonce
could never repeat under the same key. On reading, gcm_open refuses any
nonce that is not 12 octets, which also excludes the non-96-bit IV derivation
Joux attacked. OpenPGP SEIPDv2 encryption is sequoia’s, which derives each
chunk nonce from a per-message random salt and key.
Pepsi’s long-lived AES-GCM keys use random 96-bit nonces. These are the
key-encryption key in pepsi-common/src/keystore/wrap.rs, which wraps private
keys and TOTP secrets, and the secure-link session cookie key. The collision
bound for random nonces starts to matter after about 2^32 encryptions under one
key. That is many orders of magnitude above the number of keys that a deployment
wraps or of the sessions that it issues, and the wrapping key can be rotated
(pepsi-keys wrap rotate). Secure-link messages are sealed under a fresh
Argon2id-derived key per message. Inbound ciphertexts whose sender reused a
nonce weaken only that sender’s mail, and no change in Pepsi can repair that.
96.8.2.12. RSA key recovery from partially known primes or CRT exponents¶
A partial leak of an RSA private key is often enough to recover all of it.
Coppersmith’s bivariate lattice method factors the modulus given the high-order
quarter of the bits of one prime [coppersmith1997]. Campagna and Sethi showed
in 2004 that the two CRT exponents dp and dq alone, which a single power
trace of a smart card may reveal, determine the modulus, the primes and an
enumerable public exponent. A short list of about 90 candidates remains, and one
known message/signature pair picks the right one [campagna2004]. These are
amplifiers, not attacks by themselves: they turn a side channel, a
key-generation shortcut or a partial memory disclosure into full key recovery,
and the only remedy is that no part of the key leaks.
Pepsi: Addressed. Impact: none.
Pepsi has no path that exposes part of an RSA key, and it runs on servers, not
on the smart cards and accelerators where single-trace power analysis applies.
Stored private keys are inside the AES-256-GCM blob as complete units
(Unauthenticated private-key encryption lets the storage holder maul keys). Pepsi never writes dp, dq or
a prime to a log, the database or a reply. Primes come from AWS-LC (DKIM and
S/MIME) and nettle (OpenPGP), each with independent random primes, not from a
structured generator (RSA key generation with close primes or leaked factors of phi(n)). These methods
would amplify timing and cache side channels of the RSA libraries; those leaks
are assessed in Timing and branch-prediction attacks on modular exponentiation and
Cache side channels on RSA and ElGamal exponentiation in crypto libraries. Any residue belongs there.
96.8.2.13. Small RSA private exponent (Wiener, Boneh-Durfee)¶
Choosing a small RSA decryption exponent d to speed up private-key operations is fatal. Wiener’s continued-fraction attack recovers d from the public key alone when d < N^(1/4)/3, and Boneh and Durfee’s lattice attack raised the bound to N^0.292 [boneh1999] [overmars2019]. The remedy is to fix a small public exponent such as 65537 and derive d from it, which makes d about as long as the modulus, and to gain speed through CRT instead [boneh1999].
Pepsi: Addressed. Impact: none.
Every RSA key that Pepsi generates fixes e = 65537 and computes d from it:
AWS-LC’s KeyPair::generate (through aws-lc-rs) makes DKIM keys and
S/MIME keys at 2048, 3072, 4096 or 8192 bits, the only sizes that
CRYPTO_GENERATE_RSA_BITS accepts (pepsi-common/src/keys.rs,
pepsi-crypto/src/rsakey.rs), and nettle through sequoia’s CertBuilder
makes OpenPGP RSA keys. d is therefore full length, far above both bounds.
Private-key operations use CRT. A correspondent whose key has a small d
endangers only their own mail, and an imported key with a small d would be the
importer’s choice. Neither is something that a gateway could detect cheaply or
should refuse.
96.8.2.14. RSA signature forgery from weak or unhashed message encodings¶
RSA’s multiplicative structure turns any signature encoding that is not a full, random-looking hash into a forgery opportunity. Signing raw messages allows blinding: a harmless-looking value is signed and the signature on the real message is derived from it [boneh1999]. Signing a message with only fixed-pattern or affine redundancy falls to the Girault-Misarsky attack and its extension by Brier et al., which forges a signature from three chosen ones whenever the fixed pattern is shorter than two thirds of the modulus [brier2001]. Coron, Naccache and Stern combined a smooth-number search with Desmedt and Odlyzko’s method. They forged thousands of signatures under a one-bit variant of ISO 9796-1 and broke ISO 9796-2 with a 64-bit hash cheaply. Against PKCS #1 v2.0, SSL 3.02 and ANSI X9.31 the attack was only theoretical [coron1999]. Weak hash functions specified with a scheme have the same effect: the modular hash in Annex D of the 1988 X.509 recommendation was broken by Coppersmith [ianson1990].
EMSA-PKCS1-v1_5 resists these attacks because it encodes a full hash and the hash identifier. RFC 8017 still recommends a gradual move to RSASSA-PSS as a precaution [rfc8017]. Kakvi’s 2020 systematisation traces the standardised deterministic encodings from their attacks to their later and not always comparable security proofs; the implied rule is to use only encodings with a sound proof [kakvi2020].
Pepsi: Addressed. Impact: none.
No Pepsi signature uses an encoding from this family. S/MIME signatures are
RSASSA-PKCS1-v1_5 over a SHA-2 digest with the DigestInfo, made by AWS-LC
(aws-lc-rs, RSA_PKCS1_SHA256/384/512 in sign_bytes,
pepsi-crypto/src/smime.rs); SHA-1 and MD5 signatures are never made. DKIM
and ARC signatures are rsa-sha256 via aws-lc-rs, and OpenPGP RSA signatures
come from sequoia and nettle. Every one of them hashes the whole input first.
Ed25519 and ECDSA are the defaults for OpenPGP and available for DKIM and S/MIME.
Verification likewise accepts only these hash-then-pad schemes. ISO 9796, X9.31
and raw RSA are not implemented. The remaining risks are elsewhere: a lenient
PKCS #1 v1.5 verifier, assessed in Lenient PKCS #1 v1.5 signature parsing allows e=3 forgery (BERserk),
and weak digests inside a sound encoding, assessed in SHA-1 collisions; weak signature digests still produced or accepted.
96.8.2.15. RSA-CRT fault attack factors the modulus from one faulty signature¶
An RSA signature computed with the Chinese Remainder Theorem is the combination of two half-size exponentiations. If a fault corrupts only the one modulo p, the released signature is still correct modulo q but not modulo p. Lenstra observed in 1996, after the Bellcore fault attack, that anyone holding that signature, the message and the public key then factors the modulus with a single gcd. No correct signature of the same message is needed [lenstra1996]. Faults can be induced in low-assurance devices by voltage, heat or radiation, or occur naturally. A faulty CRT decryption leaks a factor in the same way if its result is disclosed. Without CRT, many faulty signatures recover the exponent bit by bit. The deterministic padding of PKCS #1 v1.5 signatures is what makes the message known to the attacker [boneh1999]. The fix is cheap: verify each signature (or decryption) with the public exponent before releasing it, or compute it twice [lenstra1996].
Pepsi: Addressed. Impact: none.
Every RSA private-key operation that Pepsi performs goes through a library that
checks the result before releasing it. S/MIME signing and decryption, DKIM/ARC
signing and the TLS server keys use aws-lc-rs, which carries BoringSSL’s
verification of the CRT result. OpenPGP RSA operations go through nettle’s
side-channel-silent rsa_*_tr root computation, which also checks its result.
Nettle’s manual states this check for the _tr functions, and its rsa.h
states it for rsa_compute_root_tr; nettle’s source was not checked. Pepsi never returns a raw RSA decryption result to anybody, because
the session key is used internally and only the AEAD or padding check decides.
Inducing a fault in a server process would anyway need physical access or a
Rowhammer-type primitive on the host, which is outside the threat model
(What Pepsi does not protect).
96.8.2.16. Factorable or enumerable keys from low-entropy key generation¶
A key generated from a random number generator that has too little entropy is
either one of a small enumerable set or shares secret material with keys made by
other devices. RSA is especially exposed because it needs two secrets per key:
when entropy arrives between the generation of the two primes, independently made
moduli share one prime, and a batch GCD over a collection of public keys factors
all of them at once [lenstra2012] [heninger2012] [clark2013]. Lenstra et al.
factored 12,934 of 6.4 million collected RSA moduli (X.509 and PGP) and found 4 %
of certificates and PGP keys sharing an entire modulus, often between unrelated
owners [lenstra2012]; Heninger et al. computed the private keys of 0.50 % of TLS
hosts and, from repeated DSA nonces, of 1.03 % of SSH hosts, nearly all headless
devices that generated keys at first boot before the Linux /dev/urandom was
seeded [heninger2012]. Later scans keep finding the same pattern: shared-prime
keys in HTTPS certificates and GitHub SSH keys [barbulescu2016], 2,511 batches of
shared primes in six years of TLS scans, almost 89 % with the OpenSSL
prime-generation fingerprint [janovsky2020], more than 10 million certificates and
14.9 million RSA keys reused across unrelated hosts with 191,236 shared keys
factored [nezhadian2024], and Debian-weak, shared-prime and ROCA keys in an
operational enterprise PKI whose RA never tested submitted keys [kaminski2023].
In S/MIME, 7,983 moduli sharing primes and many other degenerate keys (small
factors, a prime square, zero exponents) were found among 71,214 weak-key
certificates [ondaro2025]. The OpenPGP keyservers turned out to be mostly clean,
with one breakable DSA key and a handful of shared-prime RSA keys [bock2015].
The failing generator can be hardware or software. A failing smart-card RNG made
Oberthur cards emit one fixed prime [svenda2016] and Taiwanese Citizen Digital
Certificate cards emit primes with visible patterns, so that 184 cardholder keys
were factored, 81 of them without any shared prime by predicting primes and using
Coppersmith lattice attacks [bernstein2013]. In software, the Debian OpenSSL
patch of May 2006 (CVE-2008-0166) removed the call that mixed entropy into the
PRNG pool, leaving the process ID as the only seed, so every key made on Debian
and Ubuntu for two years was one of about 32,767 per type and size; precomputed
lists then broke SSH and TLS keys, and weak certificates stayed usable because
revocation was barely checked [ahmad2008]. Botan’s AutoSeeded_RNG could
produce output from a clock value and process ID after clear() on systems
without a system RNG [botan2024]. Anybody holding the public key recovers the
private key offline and can then decrypt mail encrypted to it and forge its
signatures. The fixes are an OS generator that blocks until seeded, generating
keys on first use rather than at first boot, health tests on hardware RNGs, and
on the receiving side testing keys for known weaknesses (Debian lists, shared and
small factors, ROCA) before certifying or using them [kaminski2023]
[bernstein2013].
Pepsi: Addressed. Impact: low.
Pepsi’s own keys are generated from the operating system’s generator. DKIM and
S/MIME RSA keys are generated by AWS-LC (generate_rsa_pem
in pepsi-common/src/keys.rs, generate_pkcs8 in
pepsi-crypto/src/rsakey.rs), whose DRBG is seeded from getrandom(2); the
DKIM Ed25519 key, S/MIME EC keys and the key-wrapping nonces draw from rand_core::OsRng, which calls getrandom(2)
without GRND_NONBLOCK and so blocks until the kernel generator is seeded; OpenPGP identities are generated
by sequoia (Ed25519 by default, RSA via the nettle backend’s OS-seeded
generator). Keys are made when pepsi-setup runs or when an identity is first
needed, never baked into a package or image, and every domain and address gets
its own pair. A deployment that clones a disk image after setup would duplicate
its keys; that is an operator matter (regenerate after cloning).
The residue is on the correspondents’ side. The first strength test applied to a
peer key is the modulus length (CRYPTO_MIN_RSA_BITS, default 2048, checked
in pepsi-crypto/src/trust.rs and when encrypting). The structural part of a
badkeys-style test runs wherever that size floor does
(pepsi-crypto/src/weakrsa.rs): a modulus with a prime factor below 65536,
Fermat-close primes and the ROCA fingerprint are refused like a short key, so
the encrypt stage falls back to its no-key policy and no signature made with
such a key verifies. The parts that need data are covered too. Every key that
the Debian OpenSSL bug could produce is on the known-compromised list and is
refused the same way (Private keys shared across devices or publicly known). That list is
pepsi.compromised_key: the badkeys blocklist, which includes the Debian
OpenSSL and OpenSSH weak keys and which pepsi-keys blocklist update fetches
daily. And pepsi-keys peer screen, run daily, computes a batch GCD
(Bernstein’s product and remainder trees, pepsi-crypto/src/batchgcd.rs) over
every RSA modulus in the peer-key cache and over our own identities’ public
halves: a cached key that shares a prime with another is deleted and its modulus
added to that list, so a re-discovered copy is refused at use and not stored
again; one of our own identities that shares a prime is reported as an error
in the audit log for the operator to revoke. The residue is inherent to the
method: a shared prime with a key that Pepsi has never seen is invisible, and a
key learnt since the last screen is used until the next one (at most a day)
unless it is also on the list (Keys of correspondents, Key management). The
flaw lies with the correspondent’s software or card.
96.8.2.17. ROCA: structured primes from RSALib allow factoring¶
Infineon’s RSALib, used since at least 2012 in FIPS 140-2 and CC EAL 5+
certified smart cards and TPMs, did not choose its primes at random: every prime
has the form k*M + (65537^a mod M) for a primorial M, so the primes come
from a tiny structured subset [nemec2017]. The structure makes the modulus
fingerprintable in microseconds with no observed false positives, and Coppersmith’s
method combined with a search over the exponent factors it from the public key
alone: worst case about 2 CPU hours for 512-bit, 97 CPU days for 1024-bit and 141
CPU years for 2048-bit keys, trivially parallel, while 3072- and 4096-bit keys
stay out of reach (CVE-2017-15361) [nemec2017] [overmars2019]. Affected keys were
found in the Estonian eID, TPMs, YubiKey 4 OpenPGP tokens and 2,892 keys on the
PGP keyservers [nemec2017]; later studies found 4,204 ROCA workstation
certificates in an enterprise PKI whose TPM firmware had never been updated
[kaminski2023] and 62,263 ROCA keys in S/MIME certificates, mostly from D-Trust and
some issued as late as 2023 [ondaro2025]. Whoever factors a key decrypts mail sent
to its owner and forges their signatures. The remedies are firmware updates (not
possible for cards with the library in ROM), generating keys off the device,
avoiding the affected lengths, and detecting and revoking fingerprinted keys.
Pepsi: Addressed. Impact: none.
Pepsi generates its keys in software (AWS-LC through
pepsi-crypto/src/rsakey.rs, which refuses any RSA size but 2048, 3072, 4096
and 8192 bits; sequoia for OpenPGP; see
Factorable or enumerable keys from low-entropy key generation) and supports no hardware token, so its
own identities and DKIM keys cannot be ROCA keys. CRYPTO_MIN_RSA_BITS (default
2048) refuses the cheaply factorable 512- and 1024-bit ROCA keys.
A 2048-bit ROCA key held by a correspondent, such as a YubiKey 4 OpenPGP key or
a D-Trust S/MIME certificate, can be factored for on the order of 70 CPU years,
which is affordable for a funded attacker; accepted without comment, it would be
encrypted to and could yield a valid verdict when the certificate chains to
a ca_trust anchor. Every RSA key that Pepsi encrypts to or verifies with is
tested with the reference detector’s ROCA fingerprint
(pepsi-crypto/src/weakrsa.rs, constants and test vectors from the published
detector) and refused like a key below CRYPTO_MIN_RSA_BITS (weak-key).
This covers OpenPGP keys and the keys of S/MIME leaf, intermediate and recipient
certificates, and the test has no false positives. The affected correspondent
then gets the no-key policy (cleartext, the secure-link portal, or a bounce)
until they replace their key, and their signatures never verify as good.
96.8.2.18. RSA key generation with close primes or leaked factors of phi(n)¶
Two structural mistakes in RSA key generation leak information about the private
key through the public one. If the two primes are close to each other, N is a
difference of two squares near sqrt(N) and Fermat’s method factors it at once;
the primes must be generated independently so that their difference is large
[overmars2019]. GnuPG 1.2.3 chose the public exponent after the primes, trying
41, 257, 65537 and upward until one was coprime with phi(n), so the exponent
reveals small factors of phi(n); a key with e of 65539 or more discloses a
30-bit factor [nguyen2004]. Nguyen found no practical attack from this leak, since
known factoring methods need a much larger known factor, and the fix is to fix the
exponent first and draw primes compatible with it [nguyen2004]. Close primes, by
contrast, give a complete break whenever they occur, which happens only with
broken generators.
Pepsi: Addressed. Impact: none.
Pepsi’s own S/MIME and DKIM RSA keys come from AWS-LC’s KeyPair::generate
(pepsi-crypto/src/rsakey.rs for S/MIME, pepsi-common/src/keys.rs for
DKIM), which fixes e = 65537 before drawing the primes and generates them
independently as FIPS 186-4 prescribes, each at least sqrt(2) * 2^(k-1) and
with a minimum distance between them. Its OpenPGP RSA keys come from sequoia’s
backend generator, which fixes the exponent too. The exponent therefore reveals
nothing about phi(n), and the primes cannot be close enough for Fermat’s method.
The default OpenPGP key type is Ed25519 anyway (CRYPTO_OPENPGP_ALGORITHM).
A correspondent’s key made by a faulty generator with close primes is detected:
fermat_factorable in pepsi-crypto/src/weakrsa.rs runs Fermat’s method
for a bounded number of steps over every RSA modulus that Pepsi encrypts to or
verifies with, wherever the CRYPTO_MIN_RSA_BITS floor applies, and a hit is
refused like a short key (Factorable or enumerable keys from low-entropy key generation). The
exponent leak of GnuPG 1.2.3 is not tested for, since it enables no known
attack; a correspondent’s unusual e is accepted as the key’s owner chose it.
96.8.2.19. Insufficient key length: factoring RSA-768/1024 and brute-forcing DES¶
The strength of a key falls over time as computing gets cheaper. Diffie and Hellman showed in 1977 that the 56-bit DES key could be found by a million-chip machine in about half a day, ciphertext-only when the plaintext is ASCII text such as mail, and predicted the cost per key to fall to about 50 dollars within ten years; they also showed that double encryption with two keys falls to a meet-in-the-middle attack costing about 2^56 operations rather than 2^112, which is why multiple-encryption DES uses three encryptions [diffie1977]. For RSA the decisive figures came from factoring records. The 768-bit RSA challenge was factored in 2009 with almost 2000 single-core years of work, and the authors estimated a 1024-bit modulus at about a thousand times harder, reachable by a similar academic effort within a decade [kleinjung2010]. Bos et al. estimated 1024-bit factoring at about two years on a few million cores, already feasible in principle for a well-resourced party, while 160-bit ECC remained safe [bos2009]. Anyone able to factor a modulus decrypts everything encrypted to it and forges its signatures. The recommended responses are at least 112-bit security (2048-bit RSA or larger curves), phasing out 1024-bit RSA, and replacing DES by ciphers with at least 128-bit keys [kleinjung2010] [bos2009] [diffie1977].
Pepsi: Partly addressed. Impact: low.
Pepsi generates and requires 112-bit security or more. CRYPTO_MIN_RSA_BITS
(default 2048; pepsi-setup refuses values below 1024) is enforced on inbound
S/MIME and OpenPGP verification and on outbound encryption
(pepsi-crypto/src/trust.rs). In an S/MIME chain it applies to every
certificate whose signature the path relies on, not only to the leaf, so a
2048-bit leaf issued by a 1024-bit intermediate is refused as WeakKey; a
configured ca_trust anchor is exempt, because it is the operator’s own
decision. A TLS client certificate offered to a submission listener under
TLS_AUTH_CLIENT_CA is validated by the same code with the compiled-in policy
(CryptoPolicy::default() in pepsi-ingress/src/smtp/clientcert.rs), so
its floor is 2048 bits whatever CRYPTO_MIN_RSA_BITS says.
CRYPTO_GENERATE_RSA_BITS defaults to 2048, may not be below the minimum and
must be 2048, 3072, 4096 or 8192; OpenPGP generation takes 2048, 3072 or 4096
(pepsi-crypto/src/keygen.rs); OpenPGP identities default to Ed25519 and DKIM
keys are RSA ([pepsi-dkim] RSA_BITS, 2048, 3072 or 4096, default 2048) plus
Ed25519. Content encryption emitted by Pepsi is AES-256. content_cipher_name
in pepsi-crypto/src/smime.rs refuses single DES and RC2 under every setting,
so the 56-bit key search does not apply, and no Pepsi construction uses double
encryption. Inbound three-key 3DES is accepted for S/MIME only under
CRYPTO_ALLOW_DOWNGRADE = yes, which no shipped configuration sets, and for
OpenPGP under every value but no (the default negotiate included), and
des3_cbc_open refuses the two-key and one-key forms; three-key 3DES keeps
about 112-bit security against key search, and its other weaknesses are treated
under Legacy, export-grade, 64-bit-block or ECB content encryption in mail.
What remains is inherited. Inbound DKIM accepts 1024-bit RSA keys, as RFC 8301
requires verifiers to, so a domain that still signs with a 1024-bit key can have
its signatures forged by whoever can factor it; this is assessed under
Short, long-lived or shared DKIM RSA keys and rsa-sha1 signatures. An operator can also lower
CRYPTO_MIN_RSA_BITS to 1024 for an old correspondent, re-admitting keys at
the 80-bit level. In S/MIME this applies to signature verification only (SHA-1,
SHA-256 and SHA-512; a SHA-384 signature by such a key is Unsupported),
since AWS-LC neither encrypts to nor signs or decrypts with an RSA key below
2048 bits. pepsi-setup validation warns about that setting, every use of an
RSA key below 2048 bits is then logged as a warning
(trust::warn_if_short_rsa, on OpenPGP and S/MIME verification, encryption
and signing), and pepsi-setup run and check warn about a DKIM RSA key
below 2048 bits in the signing daemon’s status, which [pepsi-dkim] RSA_BITS
(2048 at least) never makes. Both are choices of others or of the operator;
Pepsi’s own defaults need no change, though 2048-bit RSA should be reviewed as
the 2030 horizon of the NIST guidance approaches. Keys that are long enough but
known to be compromised are a separate check
(Private keys shared across devices or publicly known).
96.8.2.20. SHA-1 collisions; weak signature digests still produced or accepted¶
In a hash-then-sign scheme a collision is a forgery: if the signer can be made to sign one of two colliding messages, the signature is valid on the other. Wang’s 2^69 attack on SHA-1 was already reason enough for RFC 4055 to ask for hashes at least twice the desired security level, while still mandating SHA-1 for interoperability [rfc4055]. The first full SHA-1 collision followed in 2017 at about 2^63 SHA-1 computations, two valid PDFs with different content [stevens2017], and in 2019 Leurent and Peyrin brought a chosen-prefix collision, in which the two messages may differ in meaningful fields, down to 2^67 to 2^69 work, then a few million dollars of GPU time [leurent2019]. They also found SHA-1 still widely accepted: SHA-1 certificates on about 700,000 of 4.4 million IMAPS servers, and a mail client that accepted them without warning [leurent2019].
The products that matter for mail kept accepting or even producing such
signatures. GnuPG verifies SHA-1 data signatures without a warning and, unless
told otherwise, signs with SHA-1, against RFC 9580; its
--allow-weak-digest-algos and --allow-weak-key-signatures re-admit weak
digests in message and key signatures [gnupg2024] [doerig2026], and it may fall
back to SHA-1 when checking key signatures [groves2025b]. OpenSSL’s S/MIME code
reports MD5, SHA-1 and 3DES messages as successfully processed and leaves any
restriction to the caller [doerig2026]. Suter-Dörig found the SEPPmail gateway
inheriting all of this: it accepts S/MIME signatures over MD5 and SHA-1, accepts
OpenPGP signatures over SHA-1 and RIPEMD-160, and signs with whatever hash the
recipient’s key prefers, falling back to SHA-1 when none is stated, so an
external attacker who uploads a key preferring SHA-1 obtains gateway signatures
over chosen content and can transfer them to a colliding message [doerig2026].
Gmail offers an administrator option that accepts SHA-1 S/MIME certificates and
signatures for a whole organisation [google2026]. The fix is to refuse MD5,
SHA-1 and RIPEMD-160 for new signatures under every circumstance, as RFC 9580
requires, and to choose the signing digest locally rather than from a
correspondent’s preferences.
Pepsi: Addressed. Impact: none.
The end-to-end layer refuses weak digests. For S/MIME, Digest::refused_by in
pepsi-crypto/src/smime.rs refuses SHA-1 for message signatures, certificate
and CRL signatures, and signing; MD5 and MD2 (id-md5,
md5WithRSAEncryption, id-md2) are refused under every setting as
refused-algorithm, and unknown digests as unsupported. For OpenPGP,
read_policy in pepsi-crypto/src/pgp.rs calls reject_hash for SHA-1
and MD5 in both of sequoia’s hash contexts, so data signatures, self-signatures,
binding signatures and third-party certifications over them are invalid and
there is no downgrade path; sequoia’s standard policy refuses RIPEMD-160 for
signatures made after 2013, and trust::key_health reports a weak-digest
failure for SHA-1 and a refused-algorithm one for MD5
(trust::is_banned_digest). Pepsi signs with SHA-256 (Emission::new in
pgp.rs, SignOptions::default in smime.rs) and never takes the digest
from a recipient’s key, so the SEPPmail signing attack does not apply. The
switch that re-opens verification of SHA-1, [pepsi]
CRYPTO_ALLOW_WEAK_DIGESTS, is off by default, lives in [pepsi] and so is
out of reach of the settings layer and the admin API, and is set by neither the
wizard nor a shipped config.d file (Key management). The TLS client
certificates that a submission listener validates under TLS_AUTH_CLIENT_CA
pass the same gate with the compiled-in policy (CryptoPolicy::default() in
pepsi-ingress/src/smtp/clientcert.rs), which that switch does not reach.
SHA-1 survives only where collision resistance is not relied on: the X9.63 KDF
and OAEP hash on input, the SEIPDv1 MDC, TOTP and WKD local-part hashing.
OpenPGP v4 fingerprints are SHA-1, but sequoia computes all SHA-1, fingerprints
included, with the collision-detecting SHA1CD, which flags the published
chosen-prefix collisions on keys.
DKIM is covered as well: the vendored mail-auth reports an
a=rsa-sha1 DKIM signature, ARC seal or ARC-Message-Signature as a
permerror, as RFC 8301 requires, so it does not count for DMARC or for the
dkim_required gate of pepsi-stage-check-whitelist (details
under Short, long-lived or shared DKIM RSA keys and rsa-sha1 signatures). What is left needs the operator
to opt in: CRYPTO_ALLOW_WEAK_DIGESTS = yes is coarse, re-admitting SHA-1 for
every correspondent of the deployment, while MD5, whose chosen-prefix collisions are
cheap, stays refused under every setting, in S/MIME and OpenPGP alike, for
verification and signing (sign_with and seal in pgp.rs refuse to sign
with it). If SHA-1 must ever be accepted it should be limited to signatures dated
before a cutoff, as sequoia’s own policy does.
96.8.2.21. Hash collisions (MD2, MD5, SHA-1) forge certificates and rogue CAs¶
A certificate signature covers a hash of the to-be-signed certificate, so a collision lets one CA signature serve two certificates. In 2005 Lenstra, Wang and de Weger built two X.509 certificates with identical MD5 hashes that differ only in their RSA keys, so a relying party can no longer be sure that the named subject holds the private key [lenstra2005]. Chosen-prefix MD5 collisions in 2007 allowed the two certificates to carry different names, at about 2^50 work, provided the attacker can predict every field that the CA places before the public key [stevens2007]. In 2009 Stevens et al. turned this into a rogue CA: a commercial CA still signed with MD5, issued automatically and used sequential serial numbers and predictable validity periods, so a legitimately requested end-user certificate collided with a CA certificate whose signature the CA produced unknowingly, and whose key could issue certificates trusted by every relying party [stevens2009]. Short and predictable serial numbers persisted at several large CAs into 2014, and the Flame malware used the same technique against an MD5-signed Microsoft certificate [zulfiqar2021]. MD2 roots pose a related risk: VeriSign’s Class 3 root was self-signed with MD2, and a preimage on MD2 would let an attacker transplant the root’s signature onto an intermediate of their own [kaminsky2010]. In OpenPGP, Leurent and Peyrin built two keys with different user IDs whose SHA-1 certification hashes collide, so one SHA-1 certification of an innocent key also certifies the attacker’s key bearing the victim’s identity (CVE-2019-14855 in GnuPG 2.2) [leurent2020]. The defences are to stop signing with and accepting MD2, MD5 and SHA-1 in certificates and certifications, to put at least 64 bits of CSPRNG output into serial numbers, as the CA/Browser Forum now requires, and to accept weak hashes at most on the trust anchor itself, whose signature is not used [kaminsky2010] [zulfiqar2021].
Pepsi: Addressed. Impact: none.
X.509 path validation in pepsi-crypto applies the digest gate of
SHA-1 collisions; weak signature digests still produced or accepted to every certificate and CRL signature in a chain
(verify_certificate_signature): MD2 and MD5 (md5WithRSAEncryption) are
refused under every setting and SHA-1 unless CRYPTO_ALLOW_WEAK_DIGESTS is
set, so neither a transplanted MD2 signature nor a colliding MD5 or SHA-1
certificate can reach a ca_trust anchor. OpenPGP certifications over SHA-1
or MD5 are invalid under read_policy, so the web-of-trust collision of
Leurent and Peyrin fails, and the trust ladder does not rely on third-party
certifications in the first place (Key management). Pepsi does not run a
CA; the self-signed certificates that it generates are signed with SHA-256 or
stronger and carry a 20-octet random serial number (random_serial in
pepsi-crypto/src/keygen.rs), so even a future collision in the signing hash
would face an unpredictable prefix. The certificates of TLS servers that Pepsi
connects to are verified by rustls and webpki, which support no MD5 or SHA-1
signatures; a TLS client certificate offered to a submission listener under
TLS_AUTH_CLIENT_CA goes through pepsi-crypto’s path validation with the
compiled-in policy, where MD5 and SHA-1 chain signatures are refused whatever
the configuration says. The only way back is an operator setting
CRYPTO_ALLOW_WEAK_DIGESTS = yes, which re-admits SHA-1, never MD5, for chain
signatures; that residue is counted under SHA-1 collisions; weak signature digests still produced or accepted.
96.8.2.22. Cache side channels on RSA and ElGamal exponentiation in crypto libraries¶
The private-key operation of RSA (and of ElGamal) is a modular exponentiation with a secret exponent, and most library implementations let that exponent steer either the sequence of squarings and multiplications or the index of a precomputed table entry. Both are visible to an unprivileged process that shares a CPU cache with the victim. Flush+Reload watches lines of shared code in the last-level cache and recovered 96.7% of the exponent bits of GnuPG 1.4.13’s square-and-multiply from a single decryption (CVE-2013-4242) [yarom2014]; earlier, instruction-cache analysis of the data-dependent “extra reduction” of OpenSSL 0.9.8e’s Montgomery multiplication recovered keys despite base blinding, because the blinding values were reused 32 times (CVE-2007-3108) [acicmez2008]. Prime+Probe needs no shared memory and recovered a 2048-bit Libgcrypt 1.6.2 key from a co-located VM in Amazon EC2 [inci2015]. Left-to-right sliding windows, the countermeasure that GnuPG 2.x relied on, turned out to leak about half of the exponent: Libgcrypt 1.7.6 lost RSA-1024 keys outright and 13% of RSA-2048 keys (CVE-2017-7526) [bernstein2017]. The same leakage hits ElGamal decryption in Go, Crypto++ and gcrypt, and is fatal for short ElGamal exponents [defeo2021]. A survey of a decade of these attacks concludes that only constant-time code addresses the root cause in software [mushtaq2020].
Cryptanalytic follow-up work keeps shrinking what the attacker needs. Noisy square-and-multiply sequences of sliding windows with realistic window sizes suffice [oonishi2020]; knowing only which fixed-window digits are equal breaks 99% of RSA-2048 keys with 4-bit windows at about 2^25 work and 65% with 5-bit windows at about 2^40, so hardening only the table precomputation is not enough [chuengsatiansup2022]; and exponent blinding, Libgcrypt’s answer to the 2017 attack, is broken for 16- to 20-bit masks from single error-free traces, while 64-bit or longer masks (Libgcrypt uses 128) hold [ueno2023]. The weakness also reaches users through the mail client: ten of thirteen Linux MUAs accepted a vulnerable GnuPG 1.4.13 without warning, and a co-resident VM recovered 92% of an RSA-2048 key from one decryption triggered by sending the victim an encrypted mail [kim2020].
The common preconditions are an attacker who runs code on the same physical machine (another account, another VM, an SMT sibling) and many, or for the best attacks a single, private-key operations with the target key. The fixes are constant-time exponentiation whose operation sequence and memory accesses do not depend on the exponent, base blinding with fresh randomness, and exponent blinding with long masks.
Pepsi: Addressed. Impact: none.
OpenPGP private-key operations go through sequoia’s nettle backend (the
release default, CRYPTO_BACKEND ?= crypto-nettle in the Makefile), whose
RSA functions blind and use GMP’s side-channel-silent mpn_sec arithmetic;
Ed25519/Cv25519, the default OpenPGP key type, is constant time. DKIM and ARC
signing (pepsi-common/src/keys.rs, mail-auth with the aws-lc-rs
backend) and TLS (rustls with aws-lc-rs) use aws-lc, which blinds and uses
constant-time exponentiation. ElGamal is not supported at all
(ElGamal short-exponent and small-subgroup attacks in OpenPGP).
For the identities generated under [pepsi] CRYPTO_SMIME_ALGORITHM = rsa (the
default is p256), S/MIME RSA runs entirely on AWS-LC (aws-lc-rs) as
well: the key-transport unwrap in unwrap_cek, applied to the
EnvelopedData that anyone can mail to a local user, CMS signing in
sign_bytes, and the self-signatures of generated certificates and
certificate requests (pepsi-crypto/src/rsakey.rs). The RustCrypto rsa
0.9 crate is not a dependency, and deny.toml bans it; its num-bigint-dig
exponentiation indexes its table directly with the secret window of the CRT
exponents [acicmez2008] [inci2015] [chuengsatiansup2022]. Key generation is
covered under Side channels in RSA key generation (non-constant-time GCD); CRYPTO_GENERATE_RSA_BITS
accepts only the sizes that AWS-LC generates.
No exponentiation with a Pepsi private key is left on a library that is not
constant time. The default CRYPTO_SMIME_ALGORITHM = p256 generates no S/MIME
RSA key at all (Key management), and disabling SMT and page de-duplication on the host
narrows the attacker set for any library.
96.8.2.23. CacheBleed: cache-bank conflicts in scatter-gather RSA exponentiation¶
Scatter-gather was the countermeasure that OpenSSL adopted against cache-line attacks on fixed-window exponentiation: each precomputed multiplier is spread across many cache lines so that every window touches the same lines. Yarom, Genkin and Heninger showed in 2016 that this only hides the line, not the offset within it [yarom2017]. On Intel Sandy Bridge the L1 data cache is split into banks, and concurrent accesses to the same bank from the two hyperthreads of a core conflict measurably; a spy on the sibling hyperthread learns which bank, and so which multiplier, the victim reads. Against OpenSSL 1.0.2f RSA-4096 about 16,000 decryptions yielded 60% of the exponent bits and an adapted Heninger-Shacham search the rest in two CPU hours (CVE-2016-0702); LibreSSL, BoringSSL and NSS shared the code. OpenSSL 1.0.2g fixed it with a gather that reads all data uniformly, which BoringSSL adopted [yarom2017] [mushtaq2020]. The general lessons are that only code with no secret-dependent memory access at all is safe, and that SMT should not be shared between protection domains.
Pepsi: Addressed. Impact: none.
The libraries that Pepsi uses for constant-time RSA are not affected in this
form. aws-lc descends from BoringSSL and carries the uniform-gather fix; it
performs DKIM/ARC signing, TLS and every S/MIME RSA private-key operation: the
key-transport unwrap (the one RSA operation that an attacker can trigger at will
with a chosen input), CMS signing and certificate self-signatures. Nettle’s
side-channel-silent exponentiation selects table entries with
mpn_sec_tabselect, which reads every entry in full. The rsa 0.9 crate is
not in the build (see Cache side channels on RSA and ElGamal exponentiation in crypto libraries); it indexes
its table directly with the secret window and so leaks at the coarser cache-line
level that scatter-gather was introduced to hide. CRYPTO_GENERATE_RSA_BITS
is refused at configuration time unless AWS-LC generates that size. Disabling
SMT on multi-tenant hosts remains good practice.
96.8.2.24. Timing and branch-prediction attacks on modular exponentiation¶
Kocher’s 1996 paper started the field: square-and-multiply exponentiation and modular reduction take input- and key-dependent time, so an attacker who knows the inputs and measures total operation times can test hypotheses about the exponent bit by bit and recover RSA, Diffie-Hellman or DSS private keys cheaply; the recommended fix was blinding the input with a fresh random value and, optionally, the exponent with a random multiple of phi(n) [kocher1996]. Boneh’s survey of attacks on RSA lists the same class next to power analysis, the Bellcore fault attack (one faulty CRT signature factors the modulus) and Bleichenbacher’s padding oracle, with constant-time code or blinding, verification of each signature before release and non-revealing padding checks as the answers [boneh1999]. Branch prediction gives a further channel: the conditional final subtraction of Montgomery multiplication shows up in the “branch-misses” performance counter, readable at user privilege, and lets a local attacker recover the exponent of a non-CRT implementation from chosen ciphertexts even when timestamps are fuzzed [bhattacharya2015].
The class keeps recurring in maintained libraries. Botan’s advisories list
non-constant-time PKCS#1 v1.5 decoding (CVE-2015-7827), OAEP decoding
(CVE-2016-8871), ECDSA nonce inversion (CVE-2016-2849, CVE-2018-12435),
Montgomery exponentiation table lookups (CVE-2017-14737), and base64/hex
decoding tables that leaked PEM-encoded private keys (CVE-2021-24115)
[botan2024]; the remote RSA timing leak of the Rust rsa crate is
RUSTSEC-2023-0071 (“Marvin”). The fixes are constant-time code and blinding.
Pepsi: Partly addressed. Impact: low.
aws-lc and nettle blind and are constant time, and both verify CRT results, so a
fault cannot leak a factor through a released signature. aws-lc performs
DKIM/ARC, TLS and every S/MIME RSA private-key operation (the key-transport
unwrap in unwrap_cek, signing and certificate self-signatures), and likewise
every S/MIME P-256/P-384 ECDH, ECDSA signature and key generation (see
Timing and microarchitectural Bleichenbacher oracles (Marvin and successors)); nettle performs those of OpenPGP. PEM
and DER private keys are decoded by RustCrypto’s base64ct and der, which
are written to be constant time, and the S/MIME PKCS#1 v1.5 unwrap uses implicit
rejection with a constant-time selection of the key, so padding failures cause
no different work (Bleichenbacher oracle on S/MIME RSA key transport via gateway bounces). Performance
counters are not available to other users on a Debian kernel with its default
kernel.perf_event_paranoid.
What remains is on the decryption path: one branch on AWS-LC’s verdict on the
PKCS #1 v1.5 unpadding (or on the OAEP decoding). Its API returns this verdict
as a result code and offers no raw RSA decryption that would avoid it (the
rsa crate has the same branch). Against a remote sender, two things cover
the branch. blur_rsa_timing in pepsi-crypto/src/smime.rs holds every RSA
unwrap, success or failure, to a deadline of 5 ms plus up to 10 ms of CSPRNG
jitter. And in the asynchronous pipeline the sender can observe only the timing
of whatever is later sent back (a DSN or an automatic reply), with queue
latencies of milliseconds to seconds on top and, for a DSN, a hold drawn at
random up to [pepsi] REFLECTION_HOLD_MAX (30 s by default). S/MIME signing
and key generation run on AWS-LC too (pepsi-crypto/src/rsakey.rs), the
non-constant-time rsa 0.9 exponentiation is not in the build, and a
CRYPTO_GENERATE_RSA_BITS value that AWS-LC cannot generate is refused at
configuration time (Side channels in RSA key generation (non-constant-time GCD)). A local observer is the
stronger attacker and is covered under
Cache side channels on RSA and ElGamal exponentiation in crypto libraries and
Timing and microarchitectural Bleichenbacher oracles (Marvin and successors). The remaining branch is reached only
through an RSA identity; the default CRYPTO_SMIME_ALGORITHM = p256 generates
none (docs/ROADMAP.md). Nothing further is left for Pepsi’s code: the branch
is AWS-LC’s to remove, and an operator avoids it by keeping S/MIME identities on
P-256.
96.8.2.25. Acoustic and electromagnetic key extraction (RSA, ECDH) via chosen ciphertexts¶
Physical emanations of a computer reveal its private-key operations, and e-mail is a convenient way to make the victim perform them on chosen inputs. Genkin, Shamir and Tromer extracted 4096-bit RSA keys from GnuPG 1.x within about an hour by listening to the laptop’s acoustic (or chassis-potential) signal: GnuPG decrypted unblinded, attacker-chosen ciphertexts, crafted so that the multiplication’s behaviour depended on single bits of the secret prime, and Enigmail decrypted incoming PGP/MIME mail automatically to show its notification, so the attacker just sent messages (CVE-2013-4576) [genkin2014]. The same group recovered Libgcrypt 1.6.3 ECDH keys within seconds through a wall with an antenna and software-defined radio, using ciphertext points with a short y-coordinate that made the operand length of point additions reveal the NAF digits (CVE-2015-7511) [genkin2016]. Alam et al. needed no chosen input at all: OpenSSL’s constant-time exponentiation still built each window value by extracting the secret exponent bit by bit, and the EM signal of that extraction gave away the key from a single decryption, unaffected by base blinding [alam2018].
The preconditions are physical proximity during the operation and, for the chosen-ciphertext variants, software that decrypts attacker-supplied input automatically. The fixes are ciphertext (base) blinding or normalisation, scalar randomisation or point blinding for ECDH, fixed-length arithmetic, and reading exponent bits in word-sized groups; GnuPG, Libgcrypt and OpenSSL were patched accordingly.
Pepsi: Partly addressed. Impact: low.
Pepsi is exactly the kind of component that the chosen-ciphertext variants need:
pepsi-stage-decrypt decrypts every inbound encrypted message without user
involvement. OpenPGP decryption runs in nettle, whose RSA is blinded and whose
X25519 uses fixed-length field arithmetic with a Montgomery ladder, so neither
the [genkin2014] ciphertext crafting nor the [genkin2016] operand-length trick
works; S/MIME ECDH runs on AWS-LC, whose P-256 and P-384 arithmetic is
fixed-length and constant time.
For an RSA identity (CRYPTO_SMIME_ALGORITHM = rsa; the default is p256),
the S/MIME decryption runs on AWS-LC (aws-lc-rs in unwrap_cek); this is
the operation that an attacker drives with chosen ciphertexts. AWS-LC blinds the
input and uses fixed-length, constant-time exponentiation, so the structure that
[genkin2014] exploited is absent and the ciphertext does not reach
variable-time arithmetic; S/MIME signing and certificate self-signatures run
there too, as does every other RSA operation. Signing runs on local users’ own
submissions and on no outsider input, so the chosen-ciphertext variants do not
apply there in any case. What has not been examined is the single-trace setting
of [alam2018], which base blinding does not address: whether AWS-LC’s
constant-time exponentiation, during a decryption or a signature, shows its
exponent in EM or acoustic emanations. The attacker must be physically near the
server (or able to probe its power or cable shields), which is unlikely in a
data centre but plausible for a self-hosted machine at home or in an office. The
default CRYPTO_SMIME_ALGORITHM = p256 keeps RSA exponentiation out of S/MIME
altogether for new identities.
96.8.2.26. Side channels in RSA key generation (non-constant-time GCD)¶
Key generation is often assumed to run once, in isolation, and so is less carefully protected than signing or decryption, yet it handles the secret primes directly. OpenSSL selected its constant-time code paths with a runtime flag that RSA key generation forgot to set in three places: the Miller-Rabin test exponentiated the secret prime candidate with sliding windows, the Montgomery setup inverted it, and the coprimality check ran the binary GCD on e and the secret p-1. A Flush+Reload spy that watched the GCD’s control flow during a single key generation, followed by error correction and a lattice attack on the partially known factor, factored the new modulus in about 27% of trials (OpenSSL 1.0.2 to 1.0.2o and 1.1.0 to 1.1.0h, CVE-2018-0737) [aldaya2019]. An attacker who controls the operating system, as assumed for SGX enclaves, records the same GCD branches through page faults in one noiseless trace and factors even an 8192-bit modulus in seconds; the same work found that the blinding values were prepared with an unprotected exponentiation [weiser2018]. OpenSSL replaced the GCD with a constant-time modular inversion and fixed the blinding computation; the authors recommend re-evaluating libraries against single-trace attacks.
Pepsi: Partly addressed. Impact: low.
DKIM and ARC keys are generated by the signing daemon pepsi-dkim
(once per domain, and once per rotation when ROTATION_DAYS is set), and the
default OpenPGP identity is Ed25519/Cv25519, whose generation is a random scalar
with no prime search, as is the default S/MIME identity (P-256). S/MIME
identities under CRYPTO_SMIME_ALGORITHM = rsa are generated on demand by
pepsi-keymat, also automatically inside the crypto stages when
AUTO_CREATE_IDENTITY is on. Both the DKIM RSA key (2048, 3072 or 4096 bits,
[pepsi-dkim] RSA_BITS) and an S/MIME RSA key at 2048, 3072, 4096 or 8192
bits (CRYPTO_GENERATE_RSA_BITS, default 2048) come from AWS-LC
(KeyPair::generate through aws-lc-rs; pepsi-dkim/src/keygen.rs,
pepsi-crypto/src/rsakey.rs), whose BoringSSL-derived key generation uses
constant-time primality testing and modular inversion, i.e. the CVE-2018-0737
fix. Unit tests pin that those sizes go through AWS-LC.
AWS-LC generates only those four sizes, and they are the only values that
CRYPTO_GENERATE_RSA_BITS accepts: any other is refused when the
configuration is read (pepsi-setup, pepsi-keys and the crypto stages
alike), and there is no fallback to rsa::RsaPrivateKey::new, whose
Miller-Rabin runs num-bigint-dig’s non-constant-time modpow on the
secret candidate followed by a non-constant-time mod_inverse, the structure
of CVE-2018-0737. A unit test refuses a 2560-bit request, and deny.toml bans
the rsa crate from the build.
One supported configuration remains unexamined rather than known to be
variable-time, which is why the verdict is not “addressed”: an OpenPGP identity
under CRYPTO_OPENPGP_ALGORITHM = rsa is generated by nettle through sequoia,
on GMP’s general-purpose arithmetic, and whether nettle’s prime search and
inversions are free of the secret-dependent control flow of CVE-2018-0737 has
not been established here; Debian’s libhogweed imports GMP’s mpz_gcd,
mpz_invert and mpz_powm, which are not constant time, so the doubt leans
towards a leak. Its exposure is smaller than in the papers: the generation
happens at a moment that the attacker does not choose and a single trace has to
be caught. The mode of the setuid stage binaries (4750) does not keep a
local user from Flush+Reload here, because nettle, hogweed and GMP are the
system’s shared libraries, which every user can map. The default Ed25519/Cv25519
OpenPGP identity involves no prime search, so a site that keeps the default is
not exposed.
96.8.2.27. ECDSA nonce leakage via timing or power enables lattice key recovery¶
ECDSA is linear in its per-signature nonce and the private key, so every signature whose nonce is partly known gives one equation of a hidden number problem that lattice reduction solves once enough of them are collected. The nonce leaks whenever its handling is not constant time. Power analysis of a smart card’s nonce inversion gave five low-order bits per signature, and lattice-based BKZ reduction (instead of Bleichenbacher’s FFT range reduction, which needs millions of signatures) recovered a 384-bit key from about 4,000 signatures [mulder2014]. Timing alone is enough when scalar multiplication runs longer for longer nonces: the Intel firmware TPM (CVE-2019-11090) and an EAL 4+ certified STMicroelectronics TPM (CVE-2019-16863) lost their 256-bit keys after 1,300 and 40,000 signatures, and a remote VPN client recovered a strongSwan server’s TPM key by timing 45,000 handshakes [moghimi2020]. Libgcrypt 1.8.4, MatrixSSL, SunEC, Crypto++ and a smart card leaked the nonce bit length the same way, often through incomplete addition formulas that short-circuit on the point at infinity; deterministic RFC 6979 nonces do not help against this leak [jancar2020]. The fixes are complete addition formulas with a fixed loop start, padding the nonce to a fixed bit length, scalar randomisation, and constant-time inversion.
Pepsi: Addressed. Impact: none.
Pepsi makes ECDSA signatures only with S/MIME P-256 and P-384 identities
(sign_bytes in pepsi-crypto/src/smime.rs, and the self-signatures of
generated certificates and requests), on AWS-LC (pepsi-crypto/src/eckey.rs),
whose P-256 and P-384 scalar multiplication runs over a fixed number of windows
with constant-time table selection and whose scalar inversion is constant time,
so neither the nonce length nor its low bits influence timing. The RustCrypto
p256/p384 crates, whose scalar arithmetic is variable time in
crypto-bigint 0.5 (RUSTSEC-2026-0387), are not in the build. OpenPGP signing
keys are Ed25519 (EdDSA, which [jancar2020] found unaffected because its nonce
is full length) or RSA; DKIM uses RSA and Ed25519 in aws-lc; TLS ECDSA, if an
operator configures an ECDSA certificate, is aws-lc’s constant-time
implementation. No TPM or smart card is involved. The remaining dependency on
compilers preserving constant-time code is discussed under
Compilers turn constant-time code into secret-dependent branches.
96.8.2.28. Biased, repeated or short signature nonces reveal the signing key¶
DSA-family signatures need a fresh, uniformly random secret nonce for every signature; a repeated nonce gives away the private key from two signatures. A biased nonce, one that is too short or shares a prefix or suffix, gives the key away from a few dozen to a few hundred signatures, by lattice reduction over public data only. Nguyen showed in 2004 that GnuPG 1.0.2 to 1.2.3 chose both the ElGamal signing exponent and the per-signature nonce far shorter than the modulus, so a single signature (such as the self-signature that every type 20 sign+encrypt key carries) yielded the private key in under a second; GnuPG declared those keys compromised and dropped ElGamal signatures [nguyen2004]. Breitner and Heninger found keys used with 64- to 160-bit nonces and with shared prefixes and suffixes across Bitcoin, Ethereum, SSH and HTTPS, recovered about 300 Bitcoin keys, and found hundreds of repeated nonces in SSH and HTTPS signatures, mostly from unidentifiable implementations [breitner2019]. PuTTY 0.68 to 0.80 derived P-521 nonces deterministically from a SHA-512 hash reduced modulo a 521-bit order, so the top nine bits were always zero and about 60 signatures sufficed to recover the key (CVE-2024-31497); every P-521 key ever used with PuTTY had to be replaced [sgtatham2024]. The fix in all cases is deterministic nonce generation as in RFC 6979 (or EdDSA), with a derivation that is uniform over the full group order.
Pepsi: Addressed. Impact: none.
Every signature that Pepsi makes uses a uniform, full-length nonce. S/MIME ECDSA
(P-256, P-384) signs with AWS-LC, which draws the nonce uniformly from [1,
n) by rejection sampling from its OS-seeded DRBG, hedged with a SHA-512 hash
of the private key and the message digest as additional input, so that even a
failed generator repeats a nonce only for the same key and message; Pepsi does
not support P-521 identities. Ed25519 signatures (OpenPGP via nettle, DKIM via
aws-lc) are deterministic by construction per RFC 8032. RSA signatures have
no nonce. ElGamal is refused by sequoia’s nettle and OpenSSL backends, so no
type 20 key can be generated, used or verified, and DSA keys are never generated
(ElGamal short-exponent and small-subgroup attacks in OpenPGP). Biased nonces in a correspondent’s
signatures expose that correspondent’s key, which no recipient can prevent.
96.8.2.29. Compilers turn constant-time code into secret-dependent branches¶
Constant-time cryptographic code is written in languages whose compilers do
not treat timing as observable, so optimisations may legally reintroduce
secret-dependent control flow. Trail of Bits showed in 2022 that LLVM compiles
a branch-free conditional select in Rust into a compare-and-branch on the
secret bit for an ARM Cortex-M0+ unless an optimisation barrier intervenes,
and that the volatile-read barrier of Rust’s subtle crate is best-effort
only (and, in WebAssembly, spills the secret to exported memory)
[trailofbits2022]. The pattern then appeared in real code: LLVM turned the
masked loop of curve25519-dalek’s Scalar29::sub/Scalar52::sub into
a conditional jump, fixed in 4.1.3 with an optimisation barrier
(RUSTSEC-2024-0344) [rustsec-2024-0344]. Systematic studies found
compiler-introduced branches and secret-dependent loads in BearSSL, BoringSSL,
Botan, HACL* (including formally verified P-256 code) and libsodium, on every
architecture, both GCC and LLVM and all optimisation levels, more often on
less common architectures and with newer compilers [schneider2025]; LLVM’s
InstCombine, loop unswitching, vectorisation and x86 cmov conversion, and
GCC’s jump threading and path splitting, are the culprits, and disabling them
by flags removed every violation at 1 to 3% cost [geimer2025].
Exploitation is generally not demonstrated; the effect is that a library’s constant-time claim may not hold for a particular binary. The recommended remedies are binary-level constant-time checking of release builds per target and compiler, compiler flags that disable the offending passes, and, in the long run, secret types in languages and compilers.
Pepsi: Partly addressed. Impact: low.
Pepsi is a Rust program compiled by LLVM, and much of its secret-handling code
is RustCrypto (AES and AES-GCM, subtle comparisons, argon2), whose
constant-time behaviour rests on exactly the best-effort barriers that
[trailofbits2022] describes. The specific known case does not arise:
curve25519-dalek is not in the build. The C libraries do their most
sensitive arithmetic in assembly and are built by their distributors: aws-lc for
TLS, DKIM and the S/MIME RSA and elliptic-curve private-key operations, and
nettle for OpenPGP. Pepsi’s own build (make build) passes no flags that
disable the passes that [geimer2025] names, and nothing checks the shipped
pepsi binaries for secret-dependent branches on x86-64 or the other Debian
architectures.
The residue is a possible, undemonstrated timing leak in a release binary, exploitable only by a local or co-resident observer. A binary-level checker (Microwalk, DATA or a Valgrind-based TIMECOP-style test) over the crypto paths of release builds could only detect such a leak, not remove it, and disabling the LLVM passes for the whole workspace would cost a little performance everywhere and is not expressible per crate. Nothing further is left for Pepsi’s code: the fix lies with the compiler and library maintainers, and constant-time guarantees from an optimising compiler remain an open problem.
96.8.2.30. KyberSlash: secret-dependent division timing in ML-KEM¶
Code that is constant time at the source level can still contain integer
divisions by a constant, and on many CPUs the division instruction’s latency
depends on its operands. The November 2023 Kyber reference implementation, and
many libraries derived from it, divided secret-dependent values by the modulus
q = 3329 whenever the compiler emitted a real division (for example with
gcc -Os or on some 32-bit targets). KyberSlash1, in message decoding during
decapsulation, leaks the secret key directly; KyberSlash2, in ciphertext
compression, is harmless during encapsulation but turns decapsulation’s
re-encryption check into a plaintext-checking oracle. With tens of thousands to
millions of chosen ciphertexts the authors recovered Kyber512 keys on a
Raspberry Pi 2 in hours and Kyber768 keys on a Cortex-M4 in minutes, also with
timing taken by a separate device [bernstein2025]. The reference code replaced
the divisions by multiplications in December 2023, followed by AWS-LC,
liboqs, PQClean, CIRCL, Botan and others; the paper proposes scanning binaries
for variable-time instructions on secret data.
Pepsi: Addressed. Impact: none.
ML-KEM appears in Pepsi only as the X25519MLKEM768 hybrid that rustls offers
with the aws-lc-rs provider in TLS, behind classical groups because Pepsi does
not enable rustls’ prefer-post-quantum feature. aws-lc was among the
libraries patched for KyberSlash, and each TLS handshake uses a fresh
ephemeral key pair, so the many decapsulations under one key that every
KyberSlash attack needs never happen. OpenPGP post-quantum encryption
(ML-KEM-768+X25519) is not supported by sequoia’s nettle backend, which
release builds use, and Pepsi never generates such keys; only a build with the
optional crypto-openssl backend against OpenSSL 3.5 or later decrypts them,
with OpenSSL’s ML-KEM. Should Pepsi adopt long-term ML-KEM keys for OpenPGP
or CMS (RFC 9936), the implementation would have to be one that postdates
the fix.
96.8.2.31. Time-memory tradeoff attacks reduce Argon2i memory hardness¶
Memory-hard functions make offline password guessing expensive on dedicated hardware by forcing each evaluation to hold a lot of memory for a long time. Data-independent ones (iMHFs), such as Argon2i, address memory in an order fixed in advance so that the access pattern cannot leak the password, and that fixed order is what an attacker exploits: blocks can be discarded and recomputed just before they are needed. Argon2’s designers documented attacks reducing the time-area product of 1- and 2-pass Argon2i about fivefold and of t-pass Argon2i (t > 2) about threefold, recommended at least three passes, and introduced the hybrid Argon2id [biryukov2016]. Alwen and Blocki showed that the computation graphs of Argon2i, Catena and Balloon Hashing are not sufficiently depth-robust: keeping only a small depth-reducing set of blocks and recomputing the rest in parallel cuts the amortised cost to about n^1.75 log n for Argon2i instead of n^2, and no data-independent design can reach the ideal bound [alwen2016]. Simulated with realistic hardware limits, the attack still succeeds against Argon2i-B with fewer than about ten passes at practical memory sizes, and the parameter-selection procedure of the IRTF at the time steered towards vulnerable parameters [alwen2017].
The precondition is an offline attacker holding a hash or a password-encrypted object and access to massively parallel hardware; the effect is cheaper guessing than the chosen parameters promise, not a break. The attacks do not apply to data-dependent functions such as Argon2d or scrypt.
Pepsi: Addressed. Impact: none.
Pepsi never uses Argon2i. Every password-hashing site uses Argon2id version 1.3:
console, mailing-list and moderator passwords (pepsi-common/src/password.rs,
64 MiB and three passes; a console password stored with weaker parameters is
re-hashed at its next successful sign-in), the secure-link PIN
(pepsi-secure-link/src/crypto.rs, 19 MiB and two passes, keyed with a
server-side pepper held outside the database) and the passphrase of encrypted
configuration archives (pepsi-config/src/archive.rs, the same 64 MiB and
three passes as passwords). Argon2id addresses data-independently only during
the first half of the first pass and data-dependently afterwards, which is what
defeats the depth-reducing recomputation strategy of [alwen2016] and
[alwen2017]; it is the variant that RFC 9106 recommends. The parameters are
the moderate OWASP and RFC 9106 settings, so a weak administrator password stays
guessable after a database theft, but that is a matter of password strength
(Somebody holding a copy of the database), not of this attack; and a stolen secure-link row is useless
without the pepper (The secure-link fallback portal).
96.8.2.32. Data-dependent memory access in Argon2d leaks the password¶
Argon2d chooses the memory blocks it reads from values derived from the password, which makes it resist time-memory tradeoffs but gives a co-located attacker a cache-timing view of an access pattern that depends on the secret: observing it lets the attacker test candidate passwords far faster than by computing the full function. Argon2d also leaves its memory un-erased, so garbage-collector or memory-leak attacks that read leftover memory after hashing make guessing cheap as well. The designers therefore recommend Argon2d only where side channels are no threat (cryptocurrencies, isolated backend servers) and Argon2i or the hybrid Argon2id for password hashing and key derivation [biryukov2016].
Pepsi: Partly addressed. Impact: low.
Pepsi uses Argon2id, never Argon2d (see Time-memory tradeoff attacks reduce Argon2i memory hardness).
The first half of the first pass is data-independent, so an observer of the
later, data-dependent accesses can only filter password candidates after
computing that half-pass for each, which cuts their cost about sixfold at the
three passes of a stored password (fourfold at the secure-link PIN’s two) rather
than removing the work. Hashing runs in pepsi-httpd (console, list API and
web-account sign-in, secure-link PIN) and in pepsi-stage-list-post (a list’s
moderator password), so a co-resident attacker who can also obtain the salt and
stored hash (a database copy) gains that factor; for the secure-link PIN the
server-side pepper is an input too, so the access pattern is useless without it.
The argon2 crate is built with its zeroize feature, so the derivation’s
memory blocks and initial hash are erased when it finishes and the
garbage-collector attack finds nothing in freed memory (with two or more passes
in version 1.3 the leftover state was not cheaply testable anyway). Switching to
Argon2i to remove the residue would reintroduce the tradeoff attacks above, so
the trade-off that Argon2id makes is accepted, as in RFC 9106. A password
hash without the residue and without the tradeoff attacks is an open research
problem.
96.8.2.33. Non-constant-time hash-to-curve in Dragonfly/SAE (Dragonblood)¶
Password-authenticated key exchange (PAKE) protocols must map the password to a group element. The trial-and-increment hash-to-curve of IEEE 1363.2, used by Dragonfly/SAE in WPA3 and by EC-SPEKE in BlackBerry Messenger, hashes the password with a counter until the result is a valid curve point, so the number of iterations, and hence the time, depends on the password. The “Dragonblood” attacks of 2019/2020 used this timing (and cache) channel to partition the password space and guess offline; SAE also had an earlier small-subgroup flaw. The fix is a constant-time hash-to-curve mapping as later standardised by the IETF, and protocol revisions [hao2022].
Pepsi: Not applicable. Impact: none.
Pepsi implements no PAKE and maps no password to a group element. Its password-derived secrets are administrator passwords, the secure-link PIN and configuration-archive passphrases. They are processed by Argon2id with fixed parameters, whose running time does not depend on the password, and compared in constant time. SASL authentication at submission uses plain or login mechanisms inside TLS (or is delegated to Dovecot), not a PAKE.
96.8.3. Protocol design gaps¶
Weaknesses of the design itself: missing bindings between identities, optional protection that can be stripped, and other design flaws.
96.8.3.1. Signatures lacking exclusive ownership allow key substitution and re-signing¶
Unforgeability (EUF-CMA) only promises that nobody forges a signature under an
honest key. It does not stop an adversary from generating a new key pair
under which an existing signature also verifies (duplicate-signature key
selection, a failure of exclusive ownership), from making one signature valid
for two messages under a maliciously chosen key (no message binding), from
re-signing a message known only through its signature, or from altering a
signature without the key (malleability). RSA PKCS#1 v1.5 and PSS, DSA and
ECDSA allow several of these by design; protocols that treat a signature as
identifying its signer were broken accordingly: ACME draft 00’s DNS challenge
let an attacker take over a domain owner’s published signature with a
substituted key (fixed in draft 02 by binding the account key thumbprint),
WS-Security’s signature confirmation let an attacker steal the response to an
honest client’s request, and DRKey/OPT lost its path guarantee
[jackson2019]. Cremers et al. formalised exclusive ownership, message binding
and non re-signability, showed that several NIST post-quantum candidates lack
them, and gave the “BUFF” transformation (sign a hash of message and public
key) that adds them [cremers2021]. For Ed25519, the original reference
verification accepts S + mL and so is malleable, the original and the
RFC 8032 variants accept small-order keys under which one signature verifies
for any message, and dropping key prefixing would allow key substitution;
libsodium’s checks avoid all three [brendel2021].
These attacks need adversarially generated keys; they never forge under an honest key. They matter only where a protocol assumes that a signature names a unique key or message.
Pepsi: Addressed. Impact: none.
No Pepsi decision assumes that a signature identifies its key. Every verifier
starts from an identity and asks whether a key already bound to it verifies:
DKIM and ARC verify against the key published under d=/s=, and both tags
are inside the signed DKIM-Signature field, so a substituted key would have to
be published in the victim’s DNS. OpenPGP and S/MIME signatures are checked
against keys selected by the From: address on Pepsi’s trust ladder
(Key management), with Pepsi’s own identities pre-empting every cached
key, and a certificate carried in the message can produce a valid verdict only
if it chains to an anchor and names that address. A key-substitution attacker
who re-labels someone else’s signed content as his own gains nothing that he
could not get by signing the plaintext that he already holds. Pepsi never uses
signature bytes as identifiers, replay keys or deduplication keys, so
malleability is harmless, and Pepsi never signs a signature in the WS-Security
manner: the outer signature of an RFC 8551 triple wrap, which covers a signed
and encrypted inner entity, is never allowed to grant a verdict
(covers_ciphertext in pepsi-crypto/src/lib.rs,
pepsi-stage-decrypt; Request theft in WS-Security signature confirmation,
Surreptitious forwarding: signatures not bound to the intended recipient). Ed25519 is standard, key-prefixed
RFC 8032 Ed25519 in nettle and aws-lc, and none of the post-quantum schemes
that [cremers2021] found lacking are used. Pepsi’s certificates are obtained by
certbot over ACME as published in RFC 8555, which carries the draft 02 fix.
96.8.3.4. Key compromise impersonation via the medium-term signed prekey¶
In key compromise impersonation (KCI), an attacker who has stolen a party’s own key uses it to impersonate other parties to that victim. In Signal’s X3DH the initiator’s ephemeral key is not authenticated, and no static-static Diffie-Hellman term enters the handshake. An adversary who learns a responder’s medium-term signed prekey can therefore pick its own ephemeral key and impersonate any initiator to that responder. Kobeissi, Bhargavan and Blanchet identified the attack; Cohn-Gordon et al. show that it also works when the optional one-time prekey is used, exclude it from their model, and propose no fix beyond noting the missing static-static secret [cohngordon2020].
Pepsi: Not applicable. Impact: none.
KCI is possible in Signal because authentication there is implicit in a key
agreement that involves the victim’s own key. Pepsi uses static OpenPGP and
S/MIME keys. It authenticates a sender only by a signature under that sender’s
own key, and the indicators state that encryption alone authenticates nobody
(What a security indicator means). Learning a recipient’s decryption key therefore does not
let an attacker obtain a valid verdict for anyone else. An attacker who
obtains the key-encryption key and the database gets every gateway-held signing
key, which is worse than KCI. That case is the documented exposure of gateway
custody (Gateway custody (custody = local, the MTA key), The private-key custody boundary), not a KCI property.
96.8.3.5. Predictable RNG compromises all session secrets without static-static DH¶
Signal’s key derivation uses no static-static Diffie-Hellman secret, so all session secrets depend only on ephemeral randomness and public values. If a device’s random number generator becomes fully predictable, an adversary who knows the ephemeral values computes every session secret, including those of sessions with future peers [cohngordon2020]. The authors told the developers that NAXOS-style constructions, or adding a static-static secret to the key derivation, would remove this at negligible cost.
Pepsi: Partly addressed. Impact: medium.
OpenPGP and S/MIME have the same property. A session key, and an ephemeral ECDH
key in ECDH key wrapping, depend only on the sender’s randomness, so a
predictable generator at encryption time exposes those messages. This is inherent
to the protocols. Pepsi takes its randomness from the operating system, either
directly (OsRng and getrandom for wrap nonces, OTP secrets, secure-link
salts and keys), through AWS-LC’s OS-seeded DRBG (S/MIME RSA and EC key
generation in pepsi-crypto/src/keygen.rs, and the ephemeral ECDH keys of
S/MIME key agreement) or through rand’s thread-local CSPRNG, which is seeded from the OS (secure-link
PINs). Sequoia uses its backend’s OS-seeded generator. No seeded or
non-cryptographic generator is used outside tests. Where it matters, signatures do
not depend on randomness alone: Ed25519 is deterministic, and AWS-LC’s ECDSA
hedges its nonce with a hash of the key and the message.
The residue is specific to Pepsi: gateway custody concentrates the risk on one
host. Under ENABLE_PEP the server generates every user’s long-term keys, the
key-encryption key, the secure-link pepper and every PIN. An RNG fault on that
host therefore affects all users at once. getrandom blocks until the kernel
pool is seeded, so the realistic cause is a virtual machine that is cloned or
restored from a snapshot together with its RNG state, not early boot. That is
operator practice, and Cloned and restored virtual machines states it: reboot a cloned or
restored instance before it generates keys, and give the virtual machine a VM
generation ID, which the Linux vmgenid driver turns into an immediate kernel
reseed. Pepsi’s udev rule records such a change in
/run/pepsi-vmgenid-changed. When Pepsi generates an OpenPGP or S/MIME key, a
one-time-password secret for an address with pepsi-keys, the key-encryption
key or a new wrapping of the private keys within ten minutes of such a change,
it logs a warning naming what was made (pepsi_crypto::vmgenid), so an
operator can regenerate it. The warning depends on the hypervisor exposing the
generation ID and does not refuse anything. It is not raised for a
one-time-password secret enrolled by e-mail (pepsi-stage-encrypt) or for a
console account, nor for DKIM keys, the secure-link pepper and PINs, or TLS
session keys; a clone that nothing reports, and a process that drew randomness
before the snapshot and keeps using it, remain the operator’s to handle.
96.8.3.6. Insecure KEM combiners that ignore or weakly mix ciphertexts¶
Hybrid encryption, which combines a classical and a post-quantum key encapsulation mechanism (KEM), is meant to stay secure as long as one ingredient is secure. Giacon, Heuer and Poettering show that this depends on the combiner [giacon2018]. If the combined key is the XOR of the ingredient keys, a weak ingredient with a second ciphertext that decapsulates to the same key lets an attacker modify only that component, ask for its decapsulation and obtain the challenge key, even when every other ingredient is CCA secure. Applying a PRF to the XORed keys and the ciphertexts fails for some standard PRFs, because flipping a ciphertext produces a related PRF key. A chained block-cipher construction is also insecure under standard assumptions. The generic failure is a key derivation that leaves out the ciphertexts. Secure combiners hash all keys together with the full ciphertext vector (in the random oracle model), or use the paper’s standard-model split-key PRF combiners. The precondition is an attacker with a decapsulation oracle, such as a recipient that decrypts attacker-supplied messages.
Pepsi: Addressed. Impact: none.
Pepsi does not implement a KEM combiner itself. The only hybrid key exchange it
uses is TLS 1.3’s X25519MLKEM768 group, from the aws-lc-rs provider that
every rustls configuration in Pepsi selects (pepsi-common/src/tls.rs,
pepsi-common/src/smtp/tls.rs, pepsi-ingress, pepsi-httpd). There the
two shared secrets are concatenated into the TLS 1.3 key schedule, which also
hashes the handshake transcript containing both key shares, so the ciphertexts
are bound. Sequoia 2.4 implements the RFC 9980 post-quantum OpenPGP algorithms,
whose combiner hashes the ECDH ciphertext and public key and relies on ML-KEM’s
own ciphertext binding for the ML-KEM part. Those algorithms exist only in the
OpenSSL and RustCrypto backends. Pepsi builds against Nettle by default and
neither generates nor offers such keys, so it does not use post-quantum OpenPGP
today (Traditional public-key algorithms broken by quantum computers). S/MIME has no hybrid mode in
Pepsi.
96.8.3.7. PAKE trusted-setup dependence and offline attacks on stored secrets¶
In their survey of password-authenticated key exchange (PAKE), Hao and van Oorschot record weaknesses that come from the setting rather than the protocol core [hao2022]. Protocols with a common reference string, such as SPAKE2, are broken for all sessions if anyone learns the discrete-log relation between the fixed generators. A password used as a TLS 1.3 pre-shared key can be attacked offline from one transcript. A web page served by the party that checks the password is not a trustworthy place to enter it. Password-encrypted credentials held by a provider, such as escrowed keychains or browser sync data, can be attacked offline by the provider or by anyone who obtains the data. The survey recommends complete specifications, realistic assumptions and the IETF-selected CPace and OPAQUE. It notes that offline guessing after a server compromise can only be made more expensive, not prevented.
Pepsi: Partly addressed. Impact: low.
Pepsi uses no PAKE and no password-based TLS, so the trusted-setup and PSK weaknesses have no counterpart. It does hold secrets derived from, or checked against, human-chosen or human-relayed values, and it takes them through web pages:
Secure-link messages are encrypted under a key derived with Argon2id from a PIN (by default 10 characters from a 31-symbol alphabet), a per-message salt, and a pepper kept in
secrets.doutside the database. No verifier is stored: the AEAD tag is the only check, so a database dump on its own cannot be attacked offline, and online guesses are limited byMAX_ATTEMPTSand lockouts (What this protects, and what it does not).Gateway-held private keys are wrapped under a high-entropy key-encryption key, not under a password (The private-key custody boundary).
Console, mailing-list and moderator passwords are stored as Argon2id hashes (64 MiB, three passes), and
pepsi-httpdchecks them throughverify_password_bounded.
The residue is the one the survey calls unavoidable. Whoever holds the database and the pepper (the operator or an attacker in control of the host) can search the PIN space offline, and can search console password hashes offline at the Argon2id cost. Both the portal and the console take the secret through a page served by the same server, so a compromised server captures it as it is entered (Someone holding a user’s mail password). The threat model trusts the operator, and the defaults make an offline search expensive. Further gains would need a different architecture, for example OPAQUE for console logins, at a cost in client complexity that a browser form avoids.
96.8.4. Missing or incorrect checks¶
A signature, certificate, policy or input that is not checked, or checked wrongly.
96.8.4.1. Lenient PKCS #1 v1.5 signature parsing allows e=3 forgery (BERserk)¶
A PKCS #1 v1.5 signature, raised to the public exponent, must equal exactly one
byte string: 00 01, at least eight FF bytes, 00, then the DER
DigestInfo naming the hash and containing the digest. The key cause of this issue
is verifiers that parse this block instead of building the expected block and
comparing the two. Every byte the parser does not check is room for an attacker.
With a small public exponent (e = 3, and with enough slack even 5 or 17), the
attacker can compute a value whose e-th power has the checked bytes in the right
places, without the private key. Bleichenbacher described this in 2006 using
trailing bytes after the digest. Kühn et al. extended it to 1024-2048-bit keys and
added two variants: an unchecked parameters field in the hash
AlgorithmIdentifier (OpenSSL, GnuTLS before 1.4.4), and NSS’s RSA_CheckSign,
which accepted any amount of padding and compared only the trailing bytes
(Thunderbird and Firefox before 1.5.0.8) [kuhn2008]. With an e = 3 CA in the
trust store, the attacker forges certificates and can intercept HTTPS, IMAPS and
POP3S.
The class kept coming back. BERserk (CVE-2014-1568) hid the forgery bytes in an overlong ASN.1 length field that NSS parsed leniently, affecting Firefox and Thunderbird and with them S/MIME signature verification [mozilla2014]. Symbolic execution found six lenient verifiers in 2019, among them Openswan, strongSwan, axTLS and libtomcrypt (CVE-2018-15836, CVE-2018-16149 to -16153) [chau2019]. Black-box differential testing of 45 implementations in 2021 found six forgeable ones, including node-forge, wpa_supplicant/hostapd and RELIC (12 CVEs). The same work found that 33 libraries reject valid signatures that omit the NULL hash parameter [yahyazadeh2021]. e = 3 roots still ship in some trust bundles. Hana et al. prove a 155-line C parser correct with Frama-C. They also note that the standard’s optional NULL parameter and its acceptance of BER are what undermine the unique encoding that a strict check needs [hana2025]. Every work recommends the same fix: re-encode the expected block and compare it in full, accept DER only, and avoid small exponents.
Pepsi: Addressed. Impact: none.
Every RSA PKCS #1 v1.5 verifier that Pepsi uses compares the decrypted block with the expected encoding rather than parsing it:
S/MIME signatures and X.509 path validation in
pepsi-crypto(smime.rs,trust.rs), which also validates the TLS client certificates that a submission listener accepts underTLS_AUTH_CLIENT_CA(pepsi-ingress/src/smtp/clientcert.rs), verify RSA signatures with AWS-LC throughaws-lc-rs(smime::verify_signature, whosersa_verificationpicks the AWS-LC parameters for the digest and key size).OpenPGP signatures are checked by Nettle through sequoia.
DKIM and ARC verification (
mail-authwith theaws-lc-rsfeature) and TLS certificate validation (rustls, webpki) use AWS-LC, which is derived from BoringSSL.
Nettle and AWS-LC verify by re-encoding and comparing, and none of these libraries appears among the vulnerable implementations in the works above. A weak or small-exponent key therefore cannot be used to forge a signature, and key sizes are bounded separately (Resource exhaustion in crypto parsing (crafted certificates, ASN.1, quines)). The interoperability side of the issue (accepting a DigestInfo without the NULL parameter) is decided inside these libraries. Pepsi relies on them and does not reimplement it. The rest of RSA signature encoding is discussed under RSA signature forgery from weak or unhashed message encodings.
96.8.4.2. Ed25519 malleability and divergent verification rules across libraries¶
EdDSA as specified leaves verifiers room to disagree. Brendel et al. compare the
original Ed25519 code, RFC 8032 and libsodium [brendel2021]. All three are
unforgeable, but the original only reduces S modulo the group order. Anyone
holding a signature (R, S) can therefore produce another valid signature
(R, S + mL) on the same message, so the scheme is not strongly unforgeable.
The original and RFC 8032 versions also accept small-order public keys and R
values. A malicious signer can then make one signature valid for any message, or
under two keys (repudiation). Without key prefixing, a third party could even
claim an honest signature under a mangled key of its own. Chalkias, Garillot and
Nikolaenko measured 18 libraries with twelve edge-case vectors [chalkias2020].
Only Zebra uses the cofactored equation, only libsodium rejects small-order
points, and several (ref10, donna, ed25519-java, TweetNaCl.js) do not fully
enforce S < L. Most accept non-canonical public keys. Randomised batch
verification can accept a signature that single verification rejects, depending
on random coefficients.
The result is a parser differential for signatures. Two components can disagree
on whether the same signature is valid, and any system that identifies a message
by its signature bytes can be confused. Missing range checks had the same effect
in older software: GnuPG’s verifier did not range-check ElGamal or RSA signature
values, so a second valid signature on a signed message could be produced
[nguyen2004]. The proposed rule set is to reject non-canonical S, R and
A, reject small-order A and R, and use cofactored verification for
both single and batch verification. Dalek and Libra adopted the canonical-S
check.
Pepsi: Addressed. Impact: none.
Pepsi verifies Ed25519 in two places. Nettle (through sequoia) checks OpenPGP
signatures, and AWS-LC (through mail-auth) checks DKIM ed25519-sha256
signatures. Both reject S >= L, so the trivial malleability is closed. The
RSA verifiers reject out-of-range values (AWS-LC refuses a signature not
smaller than the modulus), and ElGamal signatures are not accepted at all.
The remaining differences, such as small-order keys, cofactored versus
cofactorless checks, and ECDSA’s s versus n - s, matter only to a system
that uses signature bytes as identifiers or that runs two verifiers that must
agree. Pepsi does neither. No deduplication, replay key or audit record is keyed
on signature bytes. Each signature is verified by exactly one library on one
path, and nothing uses batch verification. A malicious signer can still make one
of its own signatures valid for several messages. That signer, however, could
equally sign each message, so this gives a signer no new ability to deceive a
Pepsi user.
96.8.4.3. Ed25519 signing with a mismatched public key leaks the private key¶
An Ed25519 signature hashes the public key into the value that determines its
S half, but not into the deterministic nonce that determines R. If a
signer can be made to sign the same message twice with the same private key and
two different claimed public keys, the two signatures share R and differ in
S, and the private key follows by simple algebra. ed25519-dalek before 2.0
let callers assemble a keypair from separate private and public halves, and
(de)serialise 64-byte keypairs, so nothing ensured that the two belonged together.
Several other Ed25519 libraries had the same API (RUSTSEC-2022-0093,
CVE-2022-50237) [rustsec-2022-0093]. The precondition is an application that
takes the public key from untrusted input or storage. Version 2.0 removed the
decoupled API except for explicitly labelled “hazmat” functions.
Pepsi: Addressed. Impact: none.
Pepsi does not use ed25519-dalek, and never pairs a private key with a
separately stored public key. DKIM and ARC Ed25519 keys are loaded from the PKCS
#8 file (pepsi-common/src/keys.rs, pepsi-dkim/src/keygen.rs) with
AWS-LC’s Ed25519KeyPair::from_pkcs8, which checks a stored public half
against the private seed, and the public key published in DNS is derived from
the same key pair. The AWS-LC constructor that receives both
(from_seed_and_public_key) also checks that they match.
OpenPGP identities are stored as one transferable secret key, public key packets
included, inside the AEAD blob that pepsi_common::keystore::wrap binds to the
row (pepsi-keymat). A database writer therefore cannot pair the private key
with a different public key without breaking the authentication tag. S/MIME
signing uses RSA or ECDSA, whose signing keys derive the public point from the
private scalar, and no hazmat signing API is used.
96.8.4.4. ECDSA verifier accepts r=s=0 (Psychic Signatures)¶
ECDSA verification must first reject signatures whose r or s lies outside
[1, n-1]. When Java’s verifier was rewritten from C++ in Java 15, the check was
lost. With r = s = 0, the verification equation held for every message and
every key, because the modular inverse of zero computed through Fermat’s little
theorem is silently zero (CVE-2022-21449; Java 15 to 18 before the April 2022
update). Neil Madden found and disclosed the flaw, and showed that it allowed
universal forgery of anything verified with ECDSA by an affected runtime: some TLS
handshakes and certificates, JWTs, SAML assertions, OIDC tokens and WebAuthn
messages [madden2022]. No key material is needed. The Wycheproof test vectors
detect the bug at once. The fix is the range check, and Madden recommends testing
crypto code against Wycheproof.
Pepsi: Addressed. Impact: none.
Pepsi verifies S/MIME ECDSA signatures (P-256 and P-384) in pepsi-crypto
with AWS-LC (EcPublic::verify in eckey.rs), which rejects an r or
s outside [1, n-1] before any arithmetic. Nettle (OpenPGP ECDSA through
sequoia) range-checks r and s before verifying, and TLS uses AWS-LC.
Pepsi contains no Java and no ECDSA arithmetic of its own.
96.8.4.5. Invalid curve attack on static ECDH from missing point validation¶
The usual formulas for elliptic-curve point addition and doubling do not depend
on the curve coefficient b. A library that multiplies its static secret
scalar by a peer-supplied point without checking that the point is on the curve
therefore computes “correctly” on a different, weak curve of small order. Jager,
Schwenk and Somorovsky sent such points as a TLS client’s key share. Whether the
server accepted the resulting Finished message revealed the secret modulo the
small order, and Chinese remaindering over a few thousand handshakes recovered
the server’s long-term ECDH key [jager2015]. Bouncy Castle 1.50 and Oracle’s
SunEC (the JSSE default in JDK 7/8) were exploitable; MatrixSSL, mbed TLS,
OpenSSL, LibreSSL and SunPKCS11-NSS validated points. The attacker can then
impersonate the server and decrypt recorded sessions that used the static key.
The authors note that any protocol combining a static EC key with a peer’s point
is at risk. The fix is to validate every received point. Bouncy Castle fixed it
in 1.51/1.52 and Oracle in the July 2015 update.
Pepsi: Addressed. Impact: none.
Pepsi’s static ECDH keys are the decryption keys of EC S/MIME identities and the
Curve25519 subkeys of OpenPGP identities. For S/MIME KeyAgreeRecipientInfo,
pepsi-crypto/src/smime.rs decodes the originator’s ephemeral point with
EcPublic::parse (pepsi-crypto/src/eckey.rs). It accepts only the SEC1
point encodings, which the identity point does not have, and has AWS-LC reject a
point that is not on the curve before the agreement runs; the message is then
treated as malformed. AWS-LC performs the agreement with the validated point and
checks the point again. Nettle validates NIST points in sequoia’s OpenPGP ECDH
path. X25519 is twist-secure and needs no membership check. TLS in Pepsi uses
only ephemeral (EC)DHE through rustls/AWS-LC, so there is no static TLS ECDH key
to attack.
96.8.5. Resource exhaustion and abuse¶
Exhaustion, amplification and the abuse of a service to attack others.
96.8.5.1. Resource exhaustion in crypto parsing (crafted certificates, ASN.1, quines)¶
Certificates, CMS structures and OpenPGP packets are parsed and validated before any signature can vouch for them, so a parser that does not bound its work hands any sender a denial of service. Shi et al. group ten such risks [shi2025]:
unbounded arithmetic on explicit curve parameters (binary-field degree, unchecked “primes”, square roots that loop, as in CVE-2022-0778);
unbounded ASN.1 element counts, lengths and OID sub-identifiers;
path validation without limits on names and name constraints, on the policy tree, or on cycles.
With these, they found 18 new vulnerabilities in Botan, Bouncy Castle, Crypto++,
phpseclib and Apple’s Security framework. One S/MIME e-mail hung macOS’s trust
daemon, because Mail imports a message’s certificates automatically. Earlier
cases follow the same pattern. OpenSSL’s policy tree could grow exponentially
under policy mappings (CVE-2023-0464) [openssl2023b]. Reading ASN.1 from a BIO,
as d2i_CMS_bio does, allocated whatever length a short encoding declared
(CVE-2016-2109) [openssl2016]. In OpenPGP, a compressed packet that decompresses
to itself made rPGP recurse without end, crashing Delta Chat for as long as the
message stayed on the server [song2024]. The RustCrypto rsa crate accepted
arbitrarily large public keys, which made each operation extremely slow
[includesec2019]. RFC 5751 names the same oversized-key risk for S/MIME agents
that verify or encrypt before validating a certificate [rfc5751]. The fixes are
explicit caps on sizes, counts, depth and tree nodes, cycle detection, and
validating before doing expensive work.
Pepsi: Addressed. Impact: none.
Pepsi’s own CMS and X.509 code bounds each of these resources:
RSA keys from others are limited to 8192 bits, for OpenPGP (
pgp::MAX_RSA_BITS) and S/MIME (smime::MAX_RSA_BITS) alike.Explicit EC parameters are not accepted, because only the named curves P-256 and P-384 are (
pepsi-crypto/src/eckey.rs).pepsi-crypto/src/trust/constraints.rsprocesses the RFC 5280 policy tree in a deduplicated form that avoids the exponential growth behind CVE-2023-0464. It caps policies per certificate (MAX_POLICIES= 64) and name comparisons (MAX_NAME_COMPARISONS= 2^20).Path building in
trust.rsskips any certificate already in the chain and stops atmax_depth8.CMS is decoded from an in-memory slice with the
dercrate, which does not allocate according to a declared length.MAX_RECIPIENT_INFOS(256) bounds recipient lists.The MIME walk is capped by
MAX_DEPTH,MAX_PARTSandMAX_LAYERS, and signature descent byMAX_SIGNATURE_DESCENT(3).An OpenPGP plaintext that would exceed
MAX_PLAINTEXT(64 MiB) after decompression is refused, not truncated. A compression quine therefore ends at that cap or at sequoia’s recursion limit (Decompression bombs exhausting attachment scanners).
The stage runs evaluate in spawn_blocking, and the dispatcher’s
per-message timeout and strike rule stop a worker that still hangs, without
blocking the queue (Availability). One path validation runs before any
message is accepted: a submission listener that sets TLS_AUTH_CLIENT_CA
validates the client certificate chain that a TLS peer presents, in the ingress
process and inside that connection’s task, against the configured CAs and the
revocation lists cached in pepsi.crl_cache
(pepsi-ingress/src/smtp/clientcert.rs). The chain is bounded by what one TLS
handshake can carry and by the same max_depth, policy and name-comparison
caps; the lists are fetched by pepsi-keydisc under [pepsi-keydiscovery]
CRL_MAX_BYTES (1 MiB) from distribution points that validated chains named,
and one read of the cache serves a minute of handshakes. A panic there ends that
connection only. Like the limits of any parser, these are only as good as the
code behind them. Parser memory safety is a separate issue
(Memory corruption in ASN.1, CMS, certificate and OpenPGP parsers).
96.8.6. Information leaks and tracking¶
Unintended disclosure of content, metadata or the reader’s activity.
96.8.6.1. Compression before encryption leaks plaintext through ciphertext length¶
Lossless compression maps inputs of equal length to outputs of different lengths, and encryption preserves the length. Kelsey showed in 2002 that this is a property of compression itself, and that PGP and GnuPG leak through it because they Deflate before encrypting [kelsey2002]. Passively, the compression ratio reveals redundancy, the data type and repeated content, and it tells two known candidate messages apart. An attacker who can get chosen text compressed together with secret text learns whether a string is present, and with many such messages can extract a repeated secret: Kelsey recovered 16-digit PINs against zlib. Pironti points out that RFC 4880 recommends compressing after signing and before encryption, which exposes signed and encrypted mail to the same leak, although no e-mail attack has been demonstrated [pironti2017].
The web made the extraction attack practical. CRIME used TLS-level compression to recover cookies [meyer2013] [rfc7457]. BREACH moved to HTTP response compression. A secret such as a CSRF token and reflected attacker input share one DEFLATE context, and the attacker drives the victim’s browser to send guesses and watches the encrypted sizes. Against Outlook Web Access the full CSRF token was recovered in about 95% of attempts, often within 30 seconds [gluck2013]. TLS compression has since been disabled everywhere. For HTTP compression only partial mitigations exist: separating secrets from reflected input, masking tokens per request, random padding and rate limiting.
Pepsi: Addressed. Impact: none.
Pepsi never compresses before it encrypts:
pepsi-crypto/src/pgp.rsbuilds outbound OpenPGP without aCompressorlayer, and S/MIME emission never producesCompressedData.Secure-link storage,
pepsi-stage-reencryptand the encrypted configuration archives encrypt the uncompressed bytes.pepsi-stage-reencryptalso re-seals inbound mail that the sender’s client compressed without compressing it again.rustls has no TLS compression, and
pepsi-httpdadds no HTTP response compression.
The only gzip in the tree is the RFC 8460 TLS report, which contains no secrets.
One residue lies outside Pepsi’s code. The reverse-proxy sites that
pepsi-setup writes for nginx and Apache do not disable compression, and
Debian’s default nginx.conf (gzip on for text/html) and Apache’s
mod_deflate compress proxied HTML. The console and portal pages carry a CSRF
token next to some reflected input. The session and CSRF cookies are
SameSite=Strict, however, so a cross-site request that a BREACH attacker
causes carries no session and gets no token-bearing page. Adding gzip off;
(or excluding the proxy from mod_deflate) to the generated sites would
remove even that dependence. Plain message length is a separate leak, not the
compression leak described here: pepsi-stage-encrypt pads what it encrypts
to a Padmé length ([stage-encrypt] PADDING, default yes;
pepsi-crypto/src/padding.rs), so the ciphertext gives the length away only
to within a size class, while the copy that pepsi-stage-reencrypt seals for
a mailbox is not padded.
96.8.6.2. Secret handling defects: variable-time compares, lost zeroisation, spills¶
Correct cryptography can still leak through the way code handles secrets. Code
Blau’s audit of GNU Taler found key material cleared with memset, which the
compiler may remove as a dead store. It also found public keys compared with a
memcmp wrapper that had an implicit size and was not constant time, and a
key-loading function that silently generated and wrote a new private key when
the file was missing or invalid, racing on access() [codeblau2020]. All of
these were fixed with explicit_bzero and a separate key helper. Trail of Bits
showed that the optimisation barrier of Rust’s subtle crate takes a reference
to its input. Compiled to WebAssembly, whose stack is not addressable, this spills
every secret passed through the barrier into exported linear memory, where the
surrounding JavaScript can read it [trailofbits2022]. GNU Mailman Core before
3.3.5 compared its REST API password in variable time. Anyone who could reach the
API could recover the password from response times and then administer every
list (CVE-2021-34337) [cve-2021-34337].
Pepsi: Partly addressed. Impact: low.
Pepsi compares secrets in constant time with subtle’s ct_eq. This covers:
the GNU Mailman-compatible REST API’s HTTP Basic credential (
basic_identityinpepsi-httpd/src/admin/auth.rs, which compares both halves even when the user name already differs), bearer-token digests, and CSRF digests;TOTP codes (
keystore/otp.rs);SRS hashes,
Pepsi-OriginMACs, SASL credentials, and the unsubscribe codes and VERP bounce-address MACs ofpepsi-list.
subtle leaks only a length difference. Pepsi is built
only for native targets, so the WebAssembly spill does not arise. Keys are never
generated as a side effect of loading. DKIM keys, the key-encryption key and the
secure-link pepper are created by pepsi-setup alone, and a missing file is an
error.
Zeroisation is only partial. Pepsi wipes memory with write_volatile and a
fence in the types it owns: Kek, the secure-link Pepper and
ContentKey, the Secret buffer for S/MIME content and key-wrapping keys,
and SecretKey. The argon2 crate is built with its zeroize feature
(Cargo.toml), so the memory-hard working blocks and the initial hash of a
password, PIN or archive-password derivation are wiped when it finishes instead
of lingering in freed heap memory. The unwrapped private key that
pepsi-keymat hands to pepsi-crypto (SecretKey.key, the transferable
secret key or PKCS #8 document, and its passphrase) is not freed without wiping
either: SecretKey wipes both on drop, as Secret does. What remains:
copies left behind by a Vec or String reallocation or a Clone,
serialised copies outside pepsi-crypto, and decrypted plaintexts, which are
freed without wiping. Wiping a plaintext would protect nothing: the decrypt
stage writes it to the queue database in clear anyway (Somebody holding a copy of the database).
Sequoia keeps the parsed secret key material in its own protected memory.
Exploiting the rest needs a memory disclosure in the same process. Closing it
completely would need every library that touches the data, and the standard
collections, to wipe on reallocation; no concrete change is left for Pepsi’s
code beyond the types it owns. A crash, or a debugger running under the same
account, does not provide such a disclosure: the setuid crypto stages are not
dumpable under the kernel’s default fs.suid_dumpable, and the other programs
that hold long-lived secrets (pepsi-httpd, pepsi-keys, pepsi-config
export/import, pepsi-setup apply) clear the dumpable flag at start
(pepsi_common::process::forbid_core_dumps), so none of them writes a core
file or can be attached with ptrace by another process of its uid; their
systemd units add LimitCORE=0 (A process of the same account). The timing of
RSA decryption is a separate issue (Timing and microarchitectural Bleichenbacher oracles (Marvin and successors)).
96.8.6.3. Cleartext AEAD nonces leak message or metadata¶
Standard AEAD security treats the nonce as known to both sides out of band. In practice (RFC 5116), the nonce travels in clear next to the ciphertext, and any unique value is accepted. Bellare, Ng and Tackmann point out that this makes the nonce a channel the security proof does not cover [bellare2019]. A message-dependent nonce, such as a hash of a low-entropy message or part of the message, reveals the message. A counter reveals how many messages a sender has produced. A device-specific nonce field, which RFC 5116 recommends for multiple encrypting devices, identifies the sender. Random nonces can expose devices with poor entropy. A passive observer of ciphertexts is enough. The paper proposes nonce-hiding AEAD and transforms (HN1 to HN5, and a GCM variant) that encrypt or derive the transmitted nonce under a key.
Pepsi: Addressed. Impact: none.
Every AEAD nonce that Pepsi chooses itself is drawn fresh from the operating system and carries no information:
The 96-bit nonce of the keystore wrap (
Kek::wrapinpepsi-common/src/keystore/wrap.rs) and of secure-link storage (pepsi-secure-link/src/crypto.rs) comes fromOsRng, as does the GCM nonce of S/MIMEAuthEnvelopedDatainpepsi-crypto.Each secure-link message and each S/MIME message also has its own content key, so a nonce is never even compared across messages.
OpenPGP SEIPDv2 encryption uses sequoia’s random per-message salt.
TLS 1.3 per-record nonces are a counter XORed with a secret IV, and are not transmitted.
None of these nonces is derived from the message, from a counter or from a device identifier.
96.8.6.4. Leakage-abuse attacks on searchable encryption of mail¶
Searchable encryption lets a server answer keyword queries over a user’s encrypted documents, such as mail, by deliberately revealing a leakage profile: at least which documents match each query, and in deployed designs often a token for each keyword of each document. Cash et al. show how a malicious server exploits this, with the Enron corpus as data [cash2015]. Their count attack matches result counts and keyword co-occurrence against known documents and recovers nearly all queries. Padding result lists helps little even at several hundred percent overhead. Against per-document tokens, a server that knows a few documents, or gets chosen ones inserted (for a mailbox, by sending the victim an e-mail), maps tokens to keywords. Knowing one e-mail sent to 500 employees revealed on average 35% of the keywords of all other encrypted messages. No complete fix exists. The authors recommend schemes with minimal leakage and evaluating deployments against these attacks.
Pepsi: Not applicable. Impact: none.
Pepsi offers no searchable encryption. It delivers mail to mailboxes
(Maildir, LMTP) that are searched by whatever IMAP server the operator runs. Mail
that arrived encrypted is stored either decrypted or re-sealed whole by
pepsi-stage-reencrypt to the user’s own key, with no keyword index. Secure-link
messages are stored as opaque AEAD ciphertext. The only full-text search in the
tree is over the plaintext archives of public mailing lists (pepsi-archive),
which are not encrypted and claim no confidentiality from the server.
96.8.6.5. RSA public moduli reveal the key-generating library¶
Libraries and smartcards do not generate RSA primes uniformly. They fix top bits, use strong or provable primes, avoid small factors of p-1, require Blum integers or handle rejected candidates in specific ways. Svenda et al. show that seven such choices leave a statistical fingerprint in the public modulus, after analysing more than 60 million keys from 22 libraries and 16 cards [svenda2016]. From public keys alone, a classifier names the probable source library (over 73% accuracy for a single key when a hit among the top candidate groups counts, and higher with several keys). The entropy loss does not help factoring. It does reduce the anonymity set of users of remailers or hidden services, lets an attacker preselect keys from a library known to be weak, and shows whether a key really came from secure hardware. The authors also found Oberthur cards whose failing RNG gave about 0.05% of keys the same prime, which makes those keys trivially factorable. They recommend that key generation check its RNG output, and that published keys be checked for such degenerate primes. Removing the fingerprint would require libraries to mimic the dominant one, which the authors consider unlikely.
Pepsi: Partly addressed. Impact: low.
Pepsi generates RSA keys in three places, and publishes all of them:
S/MIME identity keys under
CRYPTO_SMIME_ALGORITHM = rsa(2048 bits by default; the default algorithm isp256) and DKIM keys, with AWS-LC (pepsi-crypto/src/rsakey.rs, called frompepsi-crypto/src/keygen.rs, andpepsi-common/src/keys.rsforpepsi-setup);OpenPGP keys under
CRYPTO_OPENPGP_ALGORITHM = rsa, with sequoia’s nettle backend.
S/MIME certificates go out with signed mail, and DKIM keys are in DNS. AWS-LC’s
generator descends from BoringSSL’s and OpenSSL’s and follows FIPS 186-4
(e = 65537, each prime at least sqrt(2) * 2^(k-1), a minimum distance
between the primes, gcd(p - 1, e) = 1), so its moduli carry the
fingerprint of the OpenSSL family, the most common source in [svenda2016],
rather than one that singles Pepsi out; how closely they classify with it has
not been measured. Nettle is a rarer source, so an OpenPGP RSA key is more
likely to be recognisable as nettle’s, though not as Pepsi’s in particular. A
key recognised as a server library’s key is likely to be a gateway-custody key,
which narrows down where the private key lives. The leak is metadata only: it
does not weaken the key, and Pepsi’s keys draw on the operating system’s RNG,
not a smartcard’s.
The default OpenPGP key type is Ed25519/X25519, which has no such fingerprint,
and the default S/MIME algorithm p256 (or p384) has none either; a site
that sets CRYPTO_SMIME_ALGORITHM = rsa for RSA-only correspondents, or
CRYPTO_OPENPGP_ALGORITHM = rsa, takes it back (Client interoperability). The
fingerprint of a library’s prime generation cannot be removed from the library’s
keys without changing how it generates them, which is the vendors’ matter.
96.9. Accounts and people¶
Mailbox access and its credentials, and the decisions users and operators make.
96.9.1. Implementation defects¶
Memory safety, injection, parser differentials and logic errors in a particular implementation.
96.9.1.1. Authentication filter applied to the wrong password database¶
In Dovecot 2.2 and 2.3 before 2.3.20, the authentication component identified
passdb entries by their driver and arguments. When two entries had the same
driver and args, the username_filter and mechanism settings of one entry
could be applied to the other. This typically happened when one PAM service or
passwd file was used both for normal users and for master users. An administrator
who relied on username_filter to say which accounts may act as master users
therefore lost that restriction without any warning, and an ordinary authenticated
user could log in as a master user and open other users’ mailboxes
(CVE-2022-30550) [cve-2022-30550]. The precondition is an authenticated account
and an affected configuration with duplicate passdb definitions. Dovecot 2.3.20
fixed it in July 2022; giving the passdb entries distinct arguments is a
workaround.
Pepsi: Addressed. Impact: none.
Pepsi has no password database of its own for mail accounts. SMTP AUTH
(PLAIN/LOGIN, offered only over TLS) is delegated to a Dovecot auth socket
(pepsi-ingress/src/sasl.rs), and Pepsi takes only the verdict from it. What a
successful login permits is decided by Pepsi itself, and it is keyed on the
authentication identity (authcid) that the client presented, never on the
authorisation identity: Session in pepsi-ingress/src/smtp/session.rs looks
up USERNAME_MAP (pepsi-ingress/src/username_map.rs) for authcid and
merely records a differing authzid. A master-user login that Dovecot wrongly
accepted therefore gains no submission identity beyond the master account’s own,
so the escalation does not carry over into Pepsi (A mail-only user).
The flaw itself lives in the MDA. A deployment that uses Dovecot for IMAP and for
Pepsi’s SASL backend, defines master users and shares a passdb between them must run
a Dovecot release carrying the fix; mailbox access over IMAP is outside Pepsi.
The 10-pepsi.conf that pepsi-setup suggests adds only a dedicated
unix_listener and defines no passdb (pepsi-setup/src/dovecot.rs).
96.9.1.2. TOTP brute force via per-session attempt limits and long code validity¶
A six-digit TOTP code (RFC 6238) resists guessing only if failed attempts are counted per account and a code is valid only for a short time. In 2024 Oasis Security showed (“AuthQuake”) that Microsoft’s account sign-in, which protects Outlook mail, OneDrive, Teams and Azure, counted failures only per sign-in session (ten each) and accepted a code for about three minutes instead of one 30-second step. An attacker who held the password could open many sessions in parallel and enumerate codes, with about 3 % success per extended code window and over 50 % after about 70 minutes, and the account owner saw no alert [oasis2024]. The result was a full bypass of the second factor without user interaction. Microsoft fixed it in October 2024 with a much stricter per-account rate limit that lasts about half a day; the researchers also recommend alerting the owner to failed attempts.
Pepsi: Addressed. Impact: none.
Pepsi’s only TOTP is the optional second factor for self-service key management
(pepsi_common::keystore::otp, A second factor for key management). Its counter is per address,
not per session or connection: the otp_attempt SQL function in
pepsi-setup/db/procedures.sql decides each attempt under a row lock on the
otp_key row, so parallel guesses cannot overshoot the limit. After ten
consecutive failures (MAX_FAILURES) the enrolment is locked and every further
attempt is refused without the code being evaluated, until the operator resets it
(pepsi-keys otp reset). The acceptance window is one step either side of now
(WINDOW), about 90 seconds, and a code for a step not later than the last
accepted one is a replay and counts as a failure. An attacker therefore gets at
most ten guesses, each matching at most three of a million codes, before the lock.
There is a residue, documented in Someone holding a user’s mail password. The owner is not alerted to failed attempts. Anyone who holds the user’s mail password can cause the lock, which is a denial of service on self-service key management and on the console’s end-user sign-in (Signing in to the console by e-mail); it never affects mail delivery or encryption. The first enrolment is unprotected, and the enrolment reply carries the secret into the mailbox until the user deletes it.
96.9.2. Cryptographic weaknesses¶
Weak or broken algorithms, parameters and randomness, oracles, malleable encryption and side channels.
96.9.2.2. Offline guessing of weak password hashes, key passphrases and derived keys¶
Whenever a stored or transmitted value lets a guess be checked without asking the
server, the secret behind it falls to an offline dictionary search, and only its
own entropy and the cost per guess limit the attacker. The pattern recurs across
four decades. Kerberos encrypts the initial ticket reply under a password-derived
key and answers unauthenticated requests, so anyone can collect material to test
guesses against [bellovin1991]. Unsalted, deterministic hashes such as the Windows
LanManager hash allow precomputed rainbow tables that recover 99.9 % of
alphanumeric passwords in seconds [oechslin2003]. A single salted SHA-512 is
still a fast hash: SEPPmail’s GINA portal stored passwords that way, which a
dictionary run breaks in minutes once the hash leaks [doerig2026]. Designs that
derive both the login verifier and the data key from one password expose the data
too: MEGA’s client sends half of a PBKDF2 output to the server [backendal2023],
Doctolib’s two-server “virtual device” stores a hash of a fast, unsalted client
hash on each server so one compromise suffices [dayanikli2025], and ProtonMail
stores private keys encrypted under a bcrypt-derived key at low cost while
accepting passwords such as “1” [kobeissi2018]. Backups of TOTP secrets in popular
authenticator apps were protected by weak KDFs, hard-coded salts or ECB/unauthenticated
CBC [gilsenan2023], and a passphrase-protected OpenPGP secret keyring falls to about
500,000 guesses per second on one GPU because its iterated SHA-1 S2K is cheap and
the decrypted packet has an easily checked structure [milo2011]. Device thieves
often find the passphrase itself, and keys moved between devices travel as mailed
.p12/.asc files protected only by the export passphrase [orman2015].
The remedies are well known: a memory-hard, salted password hash (Argon2id) with adequate parameters, a password policy, no stored verifier that doubles as a key, and augmented PAKEs (OPAQUE, distributed OPRFs) where the server must not learn the password. They have limits. In Tippe and Berner’s simulation, 96.9-99.8 % of RockYou-like passwords fall whatever the algorithm and parameters, the OWASP Argon2id setting (46 MiB) cuts the compromise of strong passwords by about 40 % relative to SHA-256, and 46.6 % of Argon2 deployments on GitHub are configured weaker than OWASP recommends [tippe2025].
Pepsi: Partly addressed. Impact: low.
No user password protects key material in Pepsi. Private keys and TOTP secrets are
AEAD-wrapped under a random key-encryption key kept in secrets.d outside the
database (pepsi_common::keystore::wrap, The private-key custody boundary), so a database dump
holds no passphrase-protected key to attack. Operator-console and mailing-list
passwords are Argon2id hashes with a per-hash random salt in PHC format
(pepsi_common::password) at 64 MiB and three passes, RFC 9106’s second
recommended setting and above the one that Tippe and Berner evaluated. They are
checked off the executor through verify_password_bounded, and a hash stored
with weaker parameters is replaced at its owner’s next successful sign-in
(upgraded_hash_bounded). For a list’s moderator password, that is the next
time an Approved: header carries it and it verifies in
pepsi-stage-list-post (A moderator password hash is upgraded when it is used). The console
demands at least 12 characters, the list member pages 10, and both refuse a
password on a list of common passwords or one containing the account’s name or
address (new_password_refusal). API tokens are random 256-bit secrets stored
as digests. The secure-link portal stores no PIN verifier at all: the content key
is Argon2id over the PIN, a per-message salt and a pepper kept outside the
database, and the AEAD tag is the only check (pepsi-secure-link/src/crypto.rs,
What this protects, and what it does not). SMTP AUTH passwords are never stored by
Pepsi; Dovecot verifies them, and the Mailman importer does not import upstream
password hashes. Precomputed tables therefore have nothing to target, and a stolen
database alone yields only Argon2id hashes.
Three residues remain, none of them a change left for Pepsi’s code. A weak but
policy-conforming console or list password is still guessable from a dump,
Argon2id or not, and a hash whose owner never signs in (or never approves a
post) again keeps the parameters that it was made with.
The secure-link PIN is server-generated with 10 characters (about 49 bits), and
PIN_LENGTH cannot be lowered below 10 (MIN_PIN_LENGTH; 8 characters,
about 40 bits, could be searched for one targeted message by an attacker holding
the database and the pepper). The
pepsi-config export archive (pepsi-config/src/archive.rs) protects the whole
secrets.d tree, the KEK and the pepper included, with Argon2id (64 MiB, t=3)
under an operator-chosen password; it must be at least 12
characters long and not on the list of common passwords, but on a copied
archive a weak password that passes both checks still opens every private key in
the database. Finally, pepsi-keys identity export
--private writes the key unprotected to standard output (the export is
recorded in the event log as key.identity.export), and users’ own client
keys and mailbox passwords are outside Pepsi’s control (see also
Weak passwords and guessable account recovery questions and Partitioning oracles test many password guesses per query).
96.9.3. Protocol design gaps¶
Weaknesses of the design itself: missing bindings between identities, optional protection that can be stripped, and other design flaws.
96.9.3.2. OAuth device-code phishing yields mailbox access and refresh tokens¶
The OAuth 2.0 device authorization grant lets an input-constrained device obtain tokens by having the user type a short code into the genuine sign-in page on another device, and nothing binds the code to the person who requested it. From August 2024, a campaign tracked by Microsoft requested device codes and sent them to victims disguised as Teams meeting IDs after building rapport over messengers. The victim signed in on the real page, MFA included, and the access and refresh tokens went to the attacker, who searched the mailbox through Microsoft Graph and phished further from the compromised account. A later variant used the Authentication Broker client to register a device and obtain a Primary Refresh Token [microsoft2025]. This is the standard flow working as designed. Mitigations are to block the device-code flow where it is not needed, name the requesting application in the prompt, revoke refresh tokens on suspicion, and use phishing-resistant MFA and conditional access.
Pepsi: Not applicable. Impact: none.
Pepsi is neither an OAuth authorisation server nor a resource server, and it
never initiates a device-code flow. Its only OAuth role is that of a client towards
a smarthost: pepsi-helper-token-refresh uses the refresh_token or
client_credentials grant against a configured HTTPS token endpoint and writes
the access token for AUTH = oauth (pepsi-helper-token-refresh).
How the operator obtains the initial refresh token is outside Pepsi; an operator who
uses a device-code tool for that should verify that they requested the code
themselves. Lures that arrive as mail are the generic phishing problem
(Reverse-proxy phishing steals passwords, OTPs and session cookies past MFA).
96.9.3.3. OAuth IdP mix-up, code injection, PKCE downgrade and login CSRF¶
Fett, Küsters and Schmitz’s formal analysis of OAuth 2.0 found that the redirect
back to a client carries no reliable indication of which identity provider issued
it. In the IdP mix-up attack a network attacker or malicious IdP makes a client
that serves several IdPs send the code or token issued by an honest IdP to the
attacker, who redeems it or logs in as the user; a naive client that infers the IdP
from the redirection URI can be pushed into the attacker’s session (session
swapping). Both were verified on real implementations (mod_auth_openidc, pyoidc,
nytimes.com) [fett2016]. RFC 9700 (BCP 240) generalises these into code injection
with a stolen code, CSRF and access-token injection that make the victim use the
attacker’s account, and PKCE downgrade when a server enforces PKCE only if the
client sends a challenge [rfc9700]. The fixes are issuer identification (iss in
the response) or distinct redirect URIs per server, PKCE for every code flow and
enforced once used, and one-time CSRF tokens.
Pepsi: Not applicable. Impact: none.
Pepsi runs no authorisation-code flow: it is not a relying party or authorisation
server and never handles an authorisation code, state or PKCE verifier. Its
OAuth client (pepsi-helper-token-refresh/src/oauth.rs) uses only the
refresh_token and client_credentials grants against one fixed token endpoint
per smarthost, so there is no IdP choice to confuse. Pepsi’s own web logins are
not federated; they protect against login CSRF with SameSite=Strict cookies and
a CSRF token on every mutation (The administration console, CSRF tokens not bound to the user or privilege level).
96.9.3.4. OAuth bearer and refresh token leakage, replay and client impersonation¶
OAuth access tokens are bearer credentials: whoever holds one can use it, at the
intended resource server or a counterfeit one, and refresh tokens are long-lived and
especially valuable to steal. RFC 9700 also lists TLS-terminating proxies that pass
client-supplied security headers through, resource servers that cannot tell a
client-credentials token from a user token (so a client choosing a client_id
equal to a user’s sub impersonates that user), and the password grant, which
exposes user passwords to clients [rfc9700]. These tokens are what mail clients and
servers use for IMAP and SMTP authentication at the large providers. The remedies
are sender-constrained tokens (mutual TLS or DPoP) with audience restriction,
minimal privileges, refresh-token rotation, sanitising proxies and dropping the
password grant.
Pepsi: Partly addressed. Impact: low.
Pepsi holds OAuth tokens only as a client of a smarthost, and handles them
carefully (pepsi-helper-token-refresh, Extending the Pipeline). The
client secret and refresh token live in an @inline-secret@ file readable only by
the dedicated pepsi-helper-token-refresh account; rotated refresh tokens are
kept in a private 0700 state directory; access tokens are written atomically to
0640 files of the pepsi-token group, which only the SGID smarthost stage can
read. Credentials are sent only to an https:// token endpoint (fetch_token),
and the SMTP client refuses every credential-bearing SASL mechanism over an
unencrypted connection, with TLS_VERIFY on by default and optional DANE. The
password grant is not implemented. For OAUTHBEARER the host and port are part of
the exchange.
The tokens are nevertheless plain bearer tokens: neither the SMTP OAuth mechanisms
nor the providers’ mail endpoints support sender-constrained tokens, so a token read
from the token directory, or presented to a smarthost impersonated after an operator
disabled TLS_VERIFY, can be replayed until it expires, and a stolen refresh
token until it is revoked. The scope is what the operator registered. The remaining
exposure is therefore a compromise of the pepsi-token group or a weakened TLS
setting, and closing it needs mail providers to accept mTLS-bound tokens.
96.9.3.5. Mailbox access as the root of web account recovery and authentication¶
Most web services identify users by an e-mail address and authenticate them by their ability to receive mail there: confirmation links, password reset links, “magic” login links. Garfinkel described this e-mail-based identification and authentication in 2003 and its limits: mail travels and is stored mostly without encryption, so an eavesdropper, a server on the path, a provider’s staff or anyone with the mailbox password passes the check; some sites mailed the user’s old password; and flawed resets went to an arbitrary address instead of the one on file [garfinkel2003a]. Li, Wang and Sun measured the consequence in 2018: 97.1 % of 239 popular sites used e-mail for recovery, on 89.1 % it alone sufficed, and few sites challenged unusual logins. They concluded that whoever controls the mailbox can fully take over 81.1 % of the sites; most of 11 large mail providers allowed short passwords, and few used login-risk checks [li2018]. The mailbox becomes a single point of failure for a person’s online identity. Proposed fixes are to send only fresh links to the address on file and never old passwords, to sign recovery mail, and SEAR: a provider holds DKIM-signed recovery mail marked by a header until the user re-authenticates with a second factor [li2018].
Pepsi: Partly addressed. Impact: low.
As a mail server, Pepsi carries recovery mail to its users’ mailboxes, and those are
exactly as safe as the mailbox password, which the MDA (Dovecot) checks; Pepsi adds
no second factor for mailbox access and implements no SEAR-like holding of recovery
mail. The transport half is covered: submission AUTH only over TLS, MTA-STS and
DANE outbound (Security model).
Where Pepsi itself relies on the mailbox, it follows Garfinkel’s advice. The list
member pages issue a reset link, never a password, and have no knowledge-based
recovery (The administration console; the web tier mails nothing itself,
Mail and password resets sent to unverified registration addresses). The console’s end-user
sign-in is a mailed one-time link that yields exactly own:<address> and asks
for the TOTP code where one is enrolled (Signing in to the console by e-mail). Self-service by
e-mail (settings, wallet and key commands) is keyed on the authenticated
envelope sender of a locally submitted message (state.local_origin), not on
receipt, and key changes can additionally require a TOTP code (A second factor for key management).
The residue is that whoever holds a user’s mail password can do everything those
channels allow without a second factor, including resetting a list account and,
for a user who has not enrolled one, signing in to the console as
own:<address> and registering keys (Someone holding a user’s mail password). Users can enrol
the second factor; a SEAR-style hold for recovery mail would need a convention
that senders do not use today.
96.9.3.6. Typo-squatted, expired or recycled domains and mailboxes capture accounts¶
An e-mail address outlives the person and the domain behind it, while third parties
keep trusting it as an identity and a recovery factor. Garfinkel noted early that
addresses pass to new holders (re-issued accounts, a successor receiving a departed
employee’s mail) and that the holder today need not be the registered user
[garfinkel2003a]. Gruss et al. showed that most of the ten largest free-mail
providers release deleted or expired addresses for re-registration: 33.5 % of leaked
addresses tested could be registered again, and expired second-level domains were
referenced by about 11.6 million leaked addresses; re-registering one gives the
attacker the old owner’s mail and, through password resets, their accounts
[gruss2018]. Lever et al. traced six years of “residual trust” in re-registered
domains: name-server, mail and Regional Internet Registry contact addresses under
expired domains, and expired domains that stayed on whitelists [lever2016]. Szurdi
and Christin registered typo domains of large providers and estimated that 1,211
typo domains held by others receive some 800,000 misdirected mails a year, including
sensitive documents, and that a mistyped outgoing server name sends all of a user’s
mail to the squatter [szurdi2017]. Li et al. found 3,000 registrable domains still
being mailed by a large provider’s users and 312 registrable former mailboxes at
webmail providers, and noted that “user unknown” bounces tell attackers which names
are free [li2024b]. Remedies are never to release an address, to re-verify addresses
and treat bounces as a loss of the factor, RFC 7293 Require-Recipient-Valid-Since
(not deployed), defensive registration of typo domains, and expiring residual trust
when ownership changes.
Pepsi: Partly addressed. Impact: low.
Pepsi does not release addresses by itself: its local delivery maps a recipient to
a passwd account (pepsi_common::local::Locality), aliases and lists to their
maps, and accounts are created and deleted by the operator. Pepsi implements
RFC 7293 and keeps the record it needs: pepsi.login_assignment holds, per
login, the uid and when that assignment was first seen, recorded at local delivery
(Maildir, and LMTP for every accepted recipient that passwd knows) and re-checked
against passwd by pepsi-setup run and the hourly pepsi-queue gc. A login
seen under another uid, or back after a check found it gone, has a new owner, and
at that moment the previous owner’s pepsi.settings overrides, own
<login>/... whitelists and confirm-to-send challenges, mailbox quota,
auto-reply logs, pending list confirmations, console enrolment links and end-user
console sessions are dropped (login_assignment_reset) and an
account.reassigned event is logged. The login’s mailing-list addresses lose
their verification and their link to the previous owner’s list account, so a
password reset cannot carry the new owner into it, and their plain memberships
stop receiving (delivery_status unknown), so private list traffic does not
reach the new owner. Owner and moderator roles stay, so that lists do not lose
their owners, and the event names them for the operator. Key material is not
deleted (it may be the only key to the previous owner’s archive): pepsi-setup
run and check list every key-store identity, cached peer key and second
factor older than the current owner with the command that disposes of it, so mail
encrypted to the old owner stays readable by the new one only until the operator
acts on that warning. Senders that know when they last confirmed an address can
use the RRVS SMTP extension, which ingress advertises and answers with 550
5.7.17 for a login reassigned after the given date, or the
Require-Recipient-Valid-Since header field, which local delivery and
~/.forward processing honour by bouncing instead of delivering; relays pass
the request on or refuse it. pepsi-setup also warns about state kept for
logins that no longer exist (a failed passwd lookup is never counted as a missing
account).
Several gaps remain. An account that is deleted and re-created under the same uid
between two checks, with no mail delivered in between, is not seen as a new owner.
Owner and moderator roles of a recycled address are only reported, and addresses
served by aliases rather than logins are untouched. A virtual user that exists
only in an MDA’s own user database has no passwd entry for LMTP delivery to
record, so a change of its owner is not noticed. The same applies to a served
domain the operator lets expire. Residual trust also exists on the inbound side:
pepsi.whitelist rows other than mailing lists learnt from confirmation replies
(LIST_MAX_IDLE_DAYS) have no expiry, so an entry for a correspondent’s domain
survives the domain changing hands, and dkim_required does not help because
the new owner controls the DNS. The recipient check at RCPT
(VERIFY_RECIPIENTS) answers 550 5.1.1 for unknown local addresses, which
is the same address-existence signal that Li et al. describe, rate-limited by
MAX_INVALID_RECIPIENTS; RRVS refusals count towards the same limit, and
only a recorded reassignment fails the test, so an address that was never recycled
reveals nothing. Operators should still never reuse a login, and should retire
keys when an account is closed. Typo-squatting on the sender side is a client and
user matter that Pepsi cannot detect.
96.9.3.7. Kerberos authenticator replay within the clock-skew window¶
Kerberos replay protection rests on a timestamped authenticator that stays valid for the clock-skew window, typically five minutes. Bellovin and Merritt pointed out in 1991 that the cache of live authenticators that the design required was never implemented and that forking TCP servers cannot easily share one. A captured ticket and authenticator can therefore be replayed within the window to impersonate the user, whether the attacker captured them by watching a short mail-checking session or combines the replay with TCP sequence-number prediction. An attacker who subverts an unauthenticated time service can widen the window [bellovin1991]. They recommended an optional challenge-response exchange and an authenticated time service. Modern Kerberos implementations keep replay caches and are normally used inside TLS or with mutual authentication.
Pepsi: Addressed. Impact: none.
Pepsi never accepts Kerberos authentication; it only presents Kerberos credentials
to a smarthost (AUTH = gssapi, pepsi-common/src/smtp/gssapi.rs). That exchange
is refused on a cleartext connection (MODE = plain is rejected in
pepsi-stage-relay-to-smarthost/src/config.rs), so a network attacker cannot
capture the authenticator to replay it, and Pepsi requests mutual authentication, so
it also verifies the smarthost. The replay cache on the accepting side is the
smarthost’s, and the credential cache is filled by an external k5start or similar
process, never by Pepsi.
96.9.3.8. Unauthenticated decryption instructions redirect users to attacker sites¶
Encrypted-mail systems that reach recipients without keys add human-readable instructions to each message: where to obtain the software, where to fetch the key, which web page to open. Segeberg’s EASEmail design, a symmetric key distribution centre with per-pair keys, notes that these instructions are not covered by the message authentication, so an active attacker can remove them or point a new recipient to a different key server or a malicious website, and the thesis offers nothing beyond user caution [segeberg2009]. Kobeissi describes the same shape for ProtonMail’s “Encrypt-to-Outside”: the message travels through the recipient’s own provider with a link to the sender’s web application, and that provider can replace the link with a look-alike page, harvest the password and the reply and re-encrypt it to the real key. That is a complete, undetected man-in-the-middle attack [kobeissi2018].
Pepsi: Vulnerable. Impact: medium.
Pepsi’s secure-link portal has exactly this structure (The secure-link fallback portal). The
recipient receives a notification mail containing the portal link with its 192-bit
token, and the PIN reaches them by a second channel. The notification is sent on the
outbound path and so DKIM-signed for the sender’s domain, but a mail client shows no
binding between that signature and the link, and the recipient cannot tell the
genuine portal origin (BASE_URL) from a look-alike. With NOTICE_SIGNER
configured (off by default; Signed notices) the notification also
carries an OpenPGP or S/MIME signature by the deployment’s published notice
identity, but a recipient who holds no key is the least likely to check it, and
whoever controls the mailbox can deliver an unsigned copy, which only a recipient
who expects the signature would notice. Anyone who reads the
recipient’s mailbox or controls their provider can therefore replace the link with a
relaying phishing page, collect the PIN as the recipient types it and read the
message. This is the very adversary that the separate PIN is meant to exclude
(What this protects, and what it does not). A phisher without access to the notification can
only collect a PIN that opens nothing. Replies written in the portal go to the
original sender only, so the reply-diversion half of Kobeissi’s attack does not
apply.
There is no technical fix that does not require the recipient to hold something in
advance (a key, which makes the portal unnecessary, or a pinned origin). Operators
can reduce the exposure with a dedicated, recognisable portal hostname, by
PIN_DELIVERY = command to a channel tied to the recipient, and by telling
recipients the portal address through the same out-of-band channel as the PIN; see
also Portal passwords sent over the same unprotected channel and Link-target deception (mismatched text, fake tooltips, homographs).
96.9.3.9. Sender spoofing and business e-mail compromise¶
Phishing mail generally pretends to come from a trusted sender: a bank, a business partner or an executive. In business e-mail compromise the impersonated party asks an employee to transfer money or change payment details, using a spoofed, look-alike or genuinely compromised account; the message needs no link or attachment and works by social engineering alone. Goenka et al.’s survey cites industry figures that 96 % of social attacks arrive by e-mail, 21 % of users do not know that e-mail can be spoofed, targeted phishing reaches the inbox in 18.8 % of cases and 73 % of BEC messages in one quarter of 2022 came from free webmail accounts [goenka2023]. Losses are fraudulent payments, credential theft and malware. The survey’s countermeasures concern detecting phishing sites; for mail, the relevant defences are sender authentication with enforced DMARC, marking of external and look-alike senders, and payment verification by a second channel.
Pepsi: Partly addressed. Impact: medium.
Pepsi verifies SPF, DKIM, DMARC and ARC at ingress and records the result in
Authentication-Results and state.auth, but inbound authentication is
fail-open: only a definite DMARC failure under DMARC_ENFORCE rejects, which
the wizard writes for a new installation while the code defaults to no
(A remote sender, pepsi-ingress). A validated ARC chain
whose last sealer is listed in ARC_TRUSTED_SEALERS overrides such a
failure. A spoof that is delivered is marked where the reader sees it. A
message from outside whose From: claims one of the served domains without
a DMARC pass or an aligned DKIM or SPF pass gets X-Pepsi-Warning:
served-domain-not-authenticated, and one whose DMARC failure was recorded but
not acted on gets X-Pepsi-Warning: dmarc-fail-not-enforced. Either warning
puts [external] (TAG_EXTERNAL) at the front of the Subject, after
any forged copies of the tag are removed (Mail from outside that claims to be ours is marked). The
display-name check covers a name or comment that claims another address
("ceo@victim.example" <me@example.org>, judged as rendered). Inbound mail
of that shape is not refused but marked with X-Pepsi-Warning:
display-name-claims-other-address and state.auth.display_name_mismatch,
and a From: that carries bidi controls or invisible characters is marked
with X-Pepsi-Warning: from-has-bidi-or-invisible-characters. These warning
fields reach the reader only through a Sieve rule or the Outlook read pane and
Thunderbird extension (Outlook: the read pane, Thunderbird: the verdict button,
Sender display deception: display names, look-alikes, RTLO and truncation). A From: that cannot be read one way
only or that names mailboxes in several domains (from-ambiguous) also gets
[external], and so does a Sender: naming a served mailbox that nobody
authenticated (served-sender-not-authenticated;
pepsi-ingress/src/external.rs). A From: domain that renders like a
served domain without being one (examp1e.org) is marked X-Pepsi-Warning:
from-domain-resembles-served-domain however well it authenticates, but
without the tag; a look-alike of a correspondent’s domain is caught only when
it signs, by withholding [verified] (Look-alike and IDN homograph domains, confusable characters and alias addresses).
A display name without an address ("CEO" <me@example.org>) is compared
with nothing, and a stranger writing from their own, authenticated domain that
resembles no served domain earns no mark. A message
from a genuinely compromised or a free-mail account passes every check. The
whitelist stages (pepsi-stage-check-whitelist) gate on DKIM or ARC and on
the parsed address, not on display names, which limits only the whitelist’s
own bypass.
DMARC_ENFORCE helps only for domains publishing an enforcing policy
(Missing, invalid or non-enforcing DMARC policies leave domains spoofable, Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment)), and
operators can add content and URL filtering through pepsi-stage-milter.
Marking every external sender would need new development in Pepsi. The decisive
defence against BEC, verifying payment changes by another channel, rests with
users.
96.9.3.10. Account hijacking amplified by attention-bond payment schemes¶
Spammers take over legitimate mail accounts by phishing, keyloggers, sniffing of cleartext passwords and password reuse, to send from a reputable account. Rao and Reiley argue that “attention bond” or e-mail postage schemes, which pay the recipient for unsolicited mail, would raise the value of a hijacked account by orders of magnitude: a criminal could send mail from it to an address of their own that demands payment and simply collect the bonds from the victim [rao2012]. They propose no technical fix.
Pepsi: Addressed. Impact: low.
Pepsi implements both halves of such a scheme with GNU Taler:
pepsi-stage-anti-spam charges unknown senders, and pepsi-stage-auto-pay
pays the demands that come back for mail the deployment sent
(pepsi-stage-auto-pay). A demand is paid only for mail that Pepsi
provably originated (the Pepsi-Origin HMAC with a tracked nonce), so a forged
demand pays nothing. But mail sent by a hijacked account is genuinely
originated, so an attacker holding a user’s submission password can mail an
address behind a pay-to-send gate that they control and have auto-pay settle each
demand. The per-message MAX_TOTAL bounds each payment, and
MAX_TOTAL_PER_DAY bounds what one wallet spends in 24 hours, booked atomically
(auto_pay_try_spend). The daily limit is mandatory wherever money moves: a
stage with a non-zero MAX_TOTAL and no MAX_TOTAL_PER_DAY refuses to start,
and pepsi-setup validate refuses the configuration, so the loss is bounded by
the daily limit for each day the password stays stolen, not by the number of
messages the attacker can send (Someone holding a user’s mail password). The same password cannot
lift the bound: pepsi-stage-edit-settings refuses MAX_TOTAL and
MAX_TOTAL_PER_DAY in an e-mailed override, as it refuses WALLET_MODE,
WALLET_SCOPE and WALLET_USER, however permissive EDITABLE_STAGES is.
The wizard writes MAX_TOTAL = KUDOS:0 with MAX_TOTAL_PER_DAY = KUDOS:0,
which pays nothing until the operator chooses values. The wallet self-service
commands do not send money to third parties: pull creates a request and
push accepts an incoming payment.
The underlying problem, a stolen mail password, is outside the payment scheme; what remains is a loss up to the daily limit that the operator chose.
96.9.4. Missing or incorrect checks¶
A signature, certificate, policy or input that is not checked, or checked wrongly.
96.9.4.1. OAuth redirect URI validation failures leak codes, credentials and state¶
The redirect step of browser-based OAuth carries the authorisation code (or, in the
implicit grant, the token) in a URL, and several implementation choices leak it. An
authorisation server that matches redirect URIs by pattern rather than exactly can be
made to send codes or tokens to an attacker’s URI, also through open redirectors;
codes and state in URLs leak through Referer headers, history and logs, and a
non-single-use state lets an attacker log the victim into the attacker’s account
[rfc9700]. Fett, Küsters and Schmitz found that an IdP answering the login form POST
with a 307 redirect makes the browser re-POST the user’s username and password to the
relying party (verified on mod_auth_openidc), and that state leaked via
Referer from the redirection endpoint of the Facebook PHP SDK [fett2016]. The
fixes are exact redirect-URI matching, no implicit grant, no open redirectors,
single-use codes and state, a restrictive Referrer-Policy, and 303 instead of
307 redirects.
Pepsi: Not applicable. Impact: none.
Pepsi implements no browser OAuth flow, neither as client nor as authorisation
server, so it has no redirection endpoint, redirect-URI registry, state or
authorisation code. Its token helper speaks only to a token endpoint over HTTPS
(pepsi-helper-token-refresh/src/oauth.rs). The analogous URL-borne secret in
Pepsi, the secure-link token, is served with Referrer-Policy: no-referrer and is
never a session credential on its own (What this protects, and what it does not).
96.9.4.2. Cross-app OAuth account takeover in integration platforms¶
Integration platforms act as one OAuth client for many third-party apps, including
Outlook and Gmail connectors; examples are workflow automation services, virtual
assistants and smart-home hubs. Luo et al. found that they do not verify that the
authorisation server which issued a code belongs to the app they believe is
active, because they track the app either in state or in the redirect_uri
but not both bound together. In cross-app OAuth account takeover a malicious app
starts linking and redirects the victim to a benign app’s authorisation server,
often with silent consent, and the returned code is redeemed at the attacker’s
token endpoint; in cross-app request forgery the attacker’s authorisation is
injected into the victim’s account. Eleven of 18 platforms were vulnerable to the
first and five more to the second, including Microsoft Power Automate, where one
click gave access to over 50 Microsoft 365 and Azure apps including the victim’s
Outlook mail (CVE-2023-36019, CVSS 9.6) [luo2025]. The robust fix binds a per-app
identifier into both state and a per-app redirect_uri and checks both
before redeeming a code; PKCE does not help.
Pepsi: Not applicable. Impact: none.
Pepsi is not an integration platform and has no account-linking flow. Each smarthost token is configured by the operator for one MTA, with its own token endpoint and client credentials in a separate secret section, and is obtained without any browser redirect (pepsi-helper-token-refresh).
96.9.4.4. Mail and password resets sent to unverified registration addresses¶
Many services grant full account access before they confirm that the registrant controls the e-mail address given. People enter addresses that are not theirs, by typing mistakes, to avoid spam or to collect sign-up bonuses, and short dictionary or name addresses are hit most often. Every later message of the account, including receipts, delivery notices, credentials and password-reset links, then goes to the true owner of the address. Joukov et al. analysed six years (2016 to 2023) of such mail arriving at a short Gmail address and tested the 100 most visited US sites [joukov2023]: of the 75 sites that could be studied, only 21 (28%) verified the address. Of 759 significant misdirected messages, 369 (49%) contained personal data, some of them login credentials, tax identification numbers or government documents.
The owner of the address gains the registrant’s data and can take over the account through the reset function, and the registrant can lose access. No attacker capability is needed beyond owning a frequently mistyped address, and spam filters do not catch the mail because it was solicited, only not by its recipient. The fix is for services to verify an address before sending account data or allowing any sensitive action; the authors suggest that regulation may be needed to enforce it.
Pepsi: Addressed. Impact: none.
The one Pepsi surface where strangers create accounts is the mailing-list member
tier of pepsi-httpd (pepsi-httpd/src/web/account.rs). Registering creates
the user with an unverified address and a verification token valid for one day;
an unverified address cannot sign in, and a password-reset token is minted only
for an address that is already verified (rest::user_by_verified_address).
Registration, resend and reset are rate-limited per target address as well as per
client, re-use a live token instead of minting another, and answer identically for
known and unknown addresses. An owner who adds an address to a roster cannot mark
it verified. The web tier mints and records the token (pepsi.list_pending) but
sends no mail itself (mint_or_resend in account.rs): no notice stage is
wired to it, so a token reaches the person through the operator, who can also set
an owner’s password directly with pepsi-list owner reset-password. Nothing is
therefore mailed to an address that nobody has verified.
List subscriptions default to the confirm policy. An operator may choose open,
or subscribe an address with pepsi-list without confirmation, and the address
then receives list traffic, but this gives nobody an account or a reset path. Control
messages that change settings, keys or a wallet (pepsi-stage-edit-settings, the
key commands, pepsi-stage-auto-pay) act only for authenticated local submissions
and answer the authenticated sender (A mail-only user).
96.9.5. Deployment, configuration and credentials¶
Configuration errors, abandoned resources and weak, reused or stolen secrets.
96.9.5.1. Online guessing and spraying of passwords and PINs¶
User-chosen secrets follow a skewed, predictable distribution, so an attacker who can submit guesses to the login interface succeeds against a noticeable share of accounts with few attempts [bonneau2012]. The effect is strongest for short numeric PINs: Markert et al. found that with 10, 30 and 100 guesses an attacker recovers 4.6%, 7.6% and 16.2% of 4-digit PINs, that 6-digit PINs are hardly better because users choose them more predictably, and that only a large enforced blocklist (about 10% of the PIN space) helps [markert2020]. Rate limiting is the defence for the online case, but it must cover the right key: the IMAP specification warns that unlimited attempts allow brute force and password spraying, and that error messages distinguishing an unknown user from a wrong password enable account enumeration [rfc9051].
Spraying tries one or two common passwords against many accounts from many addresses, which per-source limits do not see. In late 2023 an attacker used a low-volume spray from residential proxy addresses to take over a legacy Microsoft test tenant account without multi-factor authentication, then abused an over-privileged OAuth application to obtain application-wide access to corporate Exchange Online mailboxes [microsoft2024]. The recommended defences are per-account and per-source limits or delays, uniform failure messages, monitoring for spraying, a second factor, and blocking passwords that appear on spraying lists.
Pepsi: Addressed. Impact: low.
Pepsi has six guessing interfaces, and each has a limit. SMTP AUTH in
pepsi-ingress is offered only under TLS, a session is closed after three
failures (MAX_AUTH_FAILURES), and a source range is refused AUTH outright
after AUTH_FAILURES_PER_HOUR (default 20) failures
(pepsi-ingress/src/limits.rs). Failures are also counted per account across
all sources (ACCOUNT_AUTH_FAILURES_PER_HOUR, default 10): past that budget an
attempt from a range that the account has not signed in from in 30 days waits
ACCOUNT_AUTH_DELAY (20 s) and such attempts are checked one at a time, so a
spray spread over many addresses gets one guess per delay at an account. It is a
delay, never a lock, because a lock would let anyone who knows an account name
shut its owner out. The console login in pepsi-httpd is rate-limited per
account and per source (LOGIN_RATE_LIMIT, 10 per minute) and capped at
LOGIN_DAILY_LIMIT (100) failed sign-ins per account per day from all sources;
it runs Argon2id through verify_password_bounded and gives one answer for an
unknown account, a wrong password and a disabled account. An operator account may
enrol a TOTP second factor (pepsi-keys otp enroll --console), which the setup
applier checks at every password sign-in. Console passwords must have at least 12
characters, member-tier passwords at least 10, and wherever either is chosen it is
refused when it is on a shipped list of common passwords (the part of a published
breach corpus long enough to be accepted, pepsi_common::password::is_common)
or contains the account’s name. The list member sign-in draws on the same
per-address budget as the forms that make the server send mail: two attempts per
address per hour (spend_budget in pepsi-httpd/src/web.rs), which rules out
guessing but lets anyone keep a member out of the web pages with two wrong
passwords an hour. The secure-link PIN is generated by Pepsi (ten characters by
default), so the skewed distribution that Markert et al. measured does not apply,
and MAX_ATTEMPTS wrong PINs lock a token for a window that doubles with each
lockout (The secure-link fallback portal). The TOTP second factor locks after ten consecutive
failures, decided under a row lock (A second factor for key management); the console’s end-user
sign-in link (Signing in to the console by e-mail) carries 256 random bits, allows five submissions
and expires after 30 minutes, and the code it asks for is checked by pepsi-setup
apply through the same lock. Pepsi serves no IMAP; mailbox access and the
password database belong to the MDA, usually Dovecot, which also verifies the SMTP
password for Pepsi (SASL_TYPE = dovecot).
Four residues remain: the per-account budget lets a spray try one or two passwords
at every account before any delay begins, which is what the per-range budget and
the MDA’s own policy bound; the counters are in memory and a restart forgets them;
mail passwords are chosen and stored by the MDA, so the common-password list does
not reach them; and anybody who knows a console account’s name can spend its daily
ceiling, refusing its password sign-ins until the allowance refills, which the
local socket (SO_PEERCRED) and bearer tokens are not subject to.
96.9.5.2. Replay of phished or reused static passwords and public-address logins¶
A password is a static secret that stays valid after it has been seen. Whoever observes it being typed, captures it with malware or on an unencrypted connection, collects it on a phishing page, or obtains it from another site where the user reused it can log in later; one leak at one verifier thus extends to every service where the same password is used [bonneau2012]. Mail accounts are especially exposed: the login name is usually the publicly known address, credentials are stored in mail clients, the same password often opens the organisation’s single sign-on, and a compromised mailbox becomes the reset channel for other accounts [holstchristensen2021]. One-time codes and challenge-response tokens resist replay, although several of them still fall to an active man in the middle or to malware on the client [bonneau2012].
Pepsi: Partly addressed. Impact: medium.
Submission to Pepsi is authenticated with the user’s mail password (via Dovecot),
the login is usually the address, and the same password normally opens the mailbox
over IMAP. Whoever holds it can therefore send mail as the user, read their mail,
and send the control messages that change their settings or keys. The threat model
states this plainly (Someone holding a user’s mail password). Pepsi adds a partial defence for the
most damaging step: a user who enrols the TOTP second factor (A second factor for key management)
cannot have a key registered, retired or generated for them without a code, and an
Autocrypt: header then registers nothing. Without enrolment, the “a new key
was registered” notice is the only signal, and it arrives in the mailbox that the
attacker can read; the same mailbox also yields the console’s own:<address>
session through the mailed sign-in link, again unless a factor is enrolled
(Signing in to the console by e-mail).
Pepsi also offers authentication without a reusable password where a deployment can
use it: client certificates (TLS_AUTH_CLIENT, TLS_AUTH_CLIENT_CA),
SO_PEERCRED for local
submission and for the admin socket, and bearer tokens for the API, stored only as
digests. A console account may enrol a TOTP second factor for its password
sign-in (pepsi-keys otp enroll --console), checked by the setup applier; without
one, a phished administrator password is enough to use the console within the
account’s scopes, and a reverse-proxy phishing kit would defeat a code anyway
(Reverse-proxy phishing steals passwords, OTPs and session cookies past MFA). What remains is inherent in password-based mail
access and in users reusing passwords. The options are for operators (client
certificates, a second factor in the MDA’s authentication, enrolling TOTP for users
and console accounts).
96.9.5.3. Stolen unrotated token-signing key accepted for enterprise mailboxes¶
In 2023 an attacker (tracked as Storm-0558) read the Exchange Online mailboxes of government agencies by forging authentication tokens. The US Cyber Safety Review Board traced it to two failures [csrb2024]. First, the attacker held a signing key for consumer Microsoft accounts that had been created in 2016 and never rotated: the consumer system had no automated rotation, manual rotation had stopped in 2021, and nothing alerted on old keys. How the key was stolen is still unknown. Second, because a common OpenID Connect metadata endpoint listed consumer and enterprise keys together and the SDKs had not been updated to tell them apart, enterprise applications such as Outlook Web Access accepted tokens signed with the consumer key. With it the attacker forged tokens for essentially any account and read mail for at least six weeks, including about 60,000 messages from the State Department.
Microsoft revoked the key, fixed the validation and rotated its other signing keys. The Board recommends automated, monitored, frequent key rotation, keys kept in isolated systems such as HSMs, stateful token validation, and a narrow scope for each key.
Pepsi: Partly addressed. Impact: low.
Pepsi issues no signed tokens. Console and member sessions, CSRF tokens and API
bearer tokens are random values whose digests are stored in the database and
checked on every request, which is the stateful validation the Board recommends:
no key exists whose theft would let anyone mint a session, and revoking a row ends
it. The keys that Pepsi does hold are each limited to one purpose: a private key
is wrapped under the KEK bound to its (address, protocol, purpose), and the
TOTP secrets are wrapped under a separate context (The private-key custody boundary).
Pepsi does hold long-lived signing and MAC keys, though: the per-domain DKIM keys, the
SRS HMAC key, the Pepsi-Origin key, the list URI keys and the list’s
VERP_SECRET, all on the host’s file
system. The wizard keeps the SRS and origin keys stable across re-runs, because
replacing one outright invalidates the addresses already in circulation. The SRS
key can nevertheless be rotated with an overlap period, as libsrs2 and postsrsd
do: [pepsi-srs] PREVIOUS_SECRET_FILE names retired keys that verify
returning addresses but sign nothing, and pepsi-setup reports when one is
older than MAX_AGE_DAYS and so verifies nothing any more (recipe in
Rotating the SRS key). The DKIM keys are held by the signing daemon
pepsi-dkim, as files of its own account that the mail stages
cannot read, and it rotates them automatically when [pepsi-dkim]
ROTATION_DAYS is set (off by default), waiting until the next key’s records
are visible in DNS and mailing the postmaster the records to add and remove;
pepsi-dkim rotate and the console’s “rotate now” rotate at once
(Rotating DKIM keys). A stolen DKIM key lets an attacker
sign mail as the domain (DKIM private key theft and key-service compromise,
Short, long-lived or shared DKIM RSA keys and rsa-sha1 signatures); a stolen SRS key lets them forge
reverse paths that ingress relays. None of these grants mailbox access, and
stealing them requires a compromise of the host. There is no HSM or PKCS#11
custody, which docs/ROADMAP.md places out of scope. Nothing is left for
Pepsi’s code; scheduled DKIM rotation is the operator’s choice to turn on, as the
Board’s recommendation of frequent automated rotation asks.
96.9.5.5. Login spoofing and ticket key exposure on multi-user hosts¶
In their 1991 analysis of Kerberos, Bellovin and Merritt pointed out that credentials
cached on a shared host are only as safe as that host [bellovin1991]. A trojaned login
program captures the password, and the protocol’s reply, encrypted under a
password-derived key, leaves no room for one-time passwords or hand-held
authenticators. Cached tickets and session keys (in /tmp, possibly on a file
server, or in pageable shared memory) can be read by root and by anyone who breaks
local protection while the user is logged in, and a host’s own service key lets an
intruder impersonate any user to services that trust the host. The authors proposed a
login reply under a server-chosen random value, so that hand-held authenticators can
be used, and argued that the multi-user exposure cannot be solved without dedicated
key-storage hardware.
Pepsi: Partly addressed. Impact: low.
Pepsi has no login program, and its users’ passwords are verified by the MDA. The
analogue is the credentials and keys that Pepsi keeps on a host that may also have
local shell users, which it does for Maildir and .forward delivery. Pepsi
separates them by account: the KEK fragment in secrets.d is readable only by
pepsi-crypto, wrapped private keys are a database column granted to that role
alone, the DKIM keys are readable only by pepsi-dkim, the signing daemon’s
account (the stages ask it for signatures over a socket), and the smarthost’s
OAuth tokens, TLS client key and Kerberos credential cache (AUTH = gssapi) are
readable only through group pepsi-token, which the stage gains through a
setgid bit on a binary that local users cannot execute
(pepsi-stage-relay-to-smarthost). pepsi-setup moves the
secrets it knows out of the world-readable pepsi.conf into secrets.d and
warns about any other credential-looking option left there, and the local shell
user is a modelled adversary (A local shell user). The programs that hold the
KEK, unwrapped private keys or other secrets in memory are not dumpable:
pepsi-keys, pepsi-httpd, pepsi-config export and import and
pepsi-setup apply clear the flag themselves
(pepsi_common::process::forbid_core_dumps, with LimitCORE=0 in their
units), and for the setuid crypto stages the kernel’s set-user-ID rule does the
same, so a crash writes no core file and another process of the same account
cannot read their memory.
What remains is the paper’s own conclusion: everything is held in files and processes
on the host, so root, or an attacker who escalates to it or to one of these service
accounts, obtains the keys, and the DKIM keys and service credentials are not wrapped
at all. The operator is trusted in Pepsi’s model. Hardware custody (HSM, PKCS#11) is
out of scope; the schema reserves the custody values hsm and mpc so
it could be added without a migration (docs/ROADMAP.md). Nothing is left for
Pepsi’s code: operators reduce the exposure by running Pepsi on a host without
shell users.
96.9.6. Resource exhaustion and abuse¶
Exhaustion, amplification and the abuse of a service to attack others.
96.9.6.1. CAPTCHA-solving markets enable mass webmail account creation¶
Free webmail providers protect account registration with CAPTCHAs, but these are defeated by relaying them to paid human solvers. Rao and Reiley’s 2012 survey of the economics of spam reports a price of about $0.70 per thousand solved CAPTCHAs, with answers in 10 to 15 seconds and about 90% accuracy [rao2012]. Spammers thus create webmail accounts in bulk and send from the providers’ reputable infrastructure. The survey knows no effective countermeasure, since harder CAPTCHAs burden legitimate users as well.
Pepsi: Addressed. Impact: none.
Pepsi creates no mail accounts: users are the operator’s (passwd entries, the
MDA’s user database, USERNAME_MAP). The only self-service registration is the
mailing-list member tier of pepsi-httpd, which deliberately ships no CAPTCHA,
and a member account confers no ability to send mail: there is no web posting, and
the account only manages the member’s own subscriptions and reads archives.
Registration mints a verification token but mails nothing
(Mail and password resets sent to unverified registration addresses). The forms that do send mail,
for subscribe and unsubscribe confirmations and for sign-in and reset requests,
are limited to two messages per target address per hour (spend_budget in
pepsi-httpd/src/web.rs). Mass registration therefore gives a spammer no
sending capacity and only a bounded way to have mail sent to strangers.
Pay-to-send (pepsi-stage-anti-spam) is Pepsi’s answer to spam
economics on the receiving side.
96.9.7. Information leaks and tracking¶
Unintended disclosure of content, metadata or the reader’s activity.
96.9.7.1. TOTP secrets exposed in plaintext backups and to app developers¶
A TOTP second factor is only as secret as the seed it is computed from, and authenticator apps often let it escape. Gilsenan et al. studied 22 Android authenticator apps in 2023 [gilsenan2023]: 12 could export TOTP secrets, issuers and labels in plaintext, usually through the share menu (e-mail, SMS), the clipboard or a file, and only four warned the user. Three synchronised plaintext secrets to the cloud and two sent them to the developer; some apps that encrypt backups sent the backup password to their servers, and several leaked the list of services and user names to third parties. Anyone who obtains such a backup holds the second factor of every account in it, so the protection falls back to the e-mail or cloud account to which the backup was sent. The authors recommend not offering plaintext backups (or warning clearly), encrypting every field, and never letting the backup password leave the device; some vendors described the behaviour as intended.
Pepsi: Partly addressed. Impact: low.
Pepsi is a TOTP verifier for self-service key management (A second factor for key management). Its
stored copy is protected: each secret is wrapped with AES-256-GCM under the key store’s
KEK, bound to (address, totp, second-factor), and the otp_key table is granted
to pepsi-crypto alone, so neither pepsi-httpd nor an ordinary stage can read
it.
The enrolment by e-mail delivers the secret through the mailbox, the channel that
the paper warns about, and narrows what a later reader of that mailbox gets in three
ways (pepsi-stage-encrypt/src/control.rs). The reply carrying the
otpauth:// URI, the base32 secret and the QR code is encrypted to the user’s
own (MUA) keys when they have registered any, so only the client holding such a
key can read it. The secret is only pending (pepsi.otp_pending): it
becomes the second factor when the user sends otp confirm with a code from
it within OTP_CONFIRM_WINDOW (one hour by default), which proves that it
reached an app. A second factor already in force stays in force until then, wrong
confirmation codes count against the pending secret only, and an unconfirmed
secret lapses and is deleted. And the reply carries an Expires: header
(RFC 4021) at the end of that window, which clients that honour it use to hide or
expire the message; both replies tell the user to delete it. The terminal path
avoids the mailbox: pepsi-keys otp enroll prints the URI and the base32
secret once, to the operator or, on a setuid installation, to the address’s own
login (pepsi-keys/src/otp.rs); the console offers no enrolment (its applier
can only reset one).
What remains is for users and their clients: a user without a key of their own
receives the reply in clear, and a confirmed secret stays in the reply until the
user deletes it (or a client honours Expires:), so a later
thief of the mail password who finds it undeleted still has both factors
(Someone holding a user’s mail password). What the user’s authenticator app does with the secret
is outside Pepsi’s control. The impact is limited to key management and the
console’s end-user sign-in (Signing in to the console by e-mail), the two things that the factor gates;
an operator console account’s factor is enrolled on the terminal only
(pepsi-keys otp enroll --console) and never passes through a mailbox.
96.9.7.2. Addresses published on web pages harvested for spam and phishing¶
E-mail addresses published on web pages in machine-readable form are collected by
automated harvesters and then used for spam and phishing. Prince et al. measured this
with Project Honey Pot in 2005 [prince2005]: harvesters made up about 6.5% of the
visitors to the honey-pot pages, the first message arrived about 11 days after the
harvest on average (from under a second to 223 days), “fraudster” harvesters sent
phishing or advance-fee fraud usually within 12 hours, and an obscure user name or an
unusual domain did not reduce spam. Harvesters are rarely on blocklists. Simple
obfuscation works surprisingly well: 52% of harvesters missed an address whose @
was written as an HTML character reference, and addresses rendered as images or by
JavaScript were almost never collected.
Pepsi: Partly addressed. Impact: low.
Pepsi publishes addresses on the web in the mailing-list archives and list pages of
pepsi-httpd. Sender addresses in archive listings and message views are shown
obscured (local@...) to anonymous visitors and in full only to signed-in members,
who need a verified address (shown_sender and obscure in
pepsi-httpd/src/web/archive.rs and web.rs), which stops the bulk harvesting
that turns a public archive into a source of spam addresses. WKD looks keys up by a
hash of the local part, so it does not enumerate addresses.
The same applies to message bodies and search snippets: every address-shaped
string in them, including quotation lines (”… <alice@example.org> wrote:”),
mailto: links and signatures, is shown as local@... to anonymous visitors
(obscure_addresses in web.rs), so the third parties that a post quotes, who
never chose to be published, are not harvested either.
Nothing further is left for Pepsi’s code: the list’s own posting and role
addresses are shown in full, because they are published by design; attachments
are served as stored, since rewriting them would alter what the poster sent, so
an address inside one is not obscured; and whether an archive is public at all
(archive_policy) is the list owner’s choice.
96.9.8. Misleading display and user decisions¶
Indicators and displays that mislead, and decisions a user cannot be expected to get right.
96.9.8.1. Users send mail unencrypted by mistake because encryption state is unclear¶
When encryption is a separate action that is easy to miss and whose state is not clearly shown, users send the message they meant to protect in the clear. Whitten and Tygar first observed it in 1999 with PGP 5.0: three of twelve participants mailed the secret unencrypted, one believing encryption “was transparent and had happened” [whitten1999]. The problem survived automation. In studies of the Private Webmail overlay for Gmail, where encryption had to be switched on per message, about one participant in ten sent the protected message in clear (3 of 25 and 3 of 32), mostly noticing only afterwards, and many typed the sensitive text into the provider’s compose window first, so the provider had the draft [ruoti2013] [ruoti2015b]. Mailvelope users found its small encryption button easy to overlook [mauries2017], and Ruoti and Seamons expect the mistake to recur with infrequent use, while users generally do not know which parts are protected, such as the subject [ruoti2019].
The damage is done once the message is sent; no attacker action is needed, and anyone reading the mail in transit or at the provider gains the plaintext. Pwm 2.0 reduced the rate from about 10% to 2% by letting users choose encryption before composing, labelling the normal button “Send unencrypted” and using a distinct colour scheme [ruoti2015b]; paradoxically, fully transparent encryption also made users distrust the tool, because they never saw that anything had been encrypted [ruoti2013].
Pepsi: Partly addressed. Impact: medium.
Pepsi encrypts on the server, so there is no button to forget: every message to a
recipient with a usable key is encrypted without user action, and users may raise a
message to required with a subject keyword ([secure], [encrypt]) or have
an operator set ENCRYPT = required for them (pepsi-stage-encrypt).
The Pwm draft leak has no analogue, because the mail store is trusted in gateway
custody (Gateway custody (custody = local, the MTA key)).
But Pepsi can reproduce the failure Whitten and Tygar described: users told that
“the server encrypts” assume it always does. Under the default ENCRYPT =
opportunistic, ON_NO_KEY resolves to sending cleartext, and a recipient
without a usable key gets plaintext; the copy in the sender’s Sent folder was
saved by the mail client before Pepsi acted. (A key lookup that fails in the DNS
is the exception: that recipient is deferred, the sender gets a delay notice, and
cleartext leaves only when the sender asks for it with the [clear-ok] subject
keyword or the operator sets CLEAR_ON_DNS_FAILURE.) The feedback that the
studies call for exists in two forms. NOTIFY_CLEARTEXT = author makes the
stage send the author a notice for each copy that left unencrypted, naming the
recipients and the reason; it is off by default and can be switched on by the
operator or for one address in pepsi.settings. And a subject that begins with
a near miss of a configured keyword ([encyrpt], a look-alike letter,
[encrypted]) is answered with a warning naming the keyword, by default; only a
keyword written in another language still passes silently as ordinary mail. With
the notice off, the sender of an ordinary message is not told that it went out in
clear, which is why the impact stays medium. What remains is for operators:
switching the notice on, configuring keywords in their users’ languages, or
choosing ENCRYPT = required site-wide or per user, with ON_NO_KEY =
secure-link or bounce, at the cost of most external mail going through the
portal or bouncing.
96.9.8.3. Users and vendor claims misrepresent what end-to-end encryption protects¶
Users of encryption tools often have inaccurate mental models of what they protect. In a 2018 survey of 125 people, most of whom used an end-to-end encrypted messenger, only 12% felt able to explain end-to-end encryption, about three quarters believed the provider or governments could still read their messages, and about half thought SMS or a landline call at least as secure [abusalma2018]. Short explanations do not help and can harm: vendors’ in-app descriptions led study participants to change correct answers to wrong ones, and WhatsApp’s text made people believe their messages were also protected at rest on their phone [demjaha2018]. Feature names mislead as well: 11 of 19 interviewed users believed Gmail’s “confidential mode” encrypted their mail, whereas it is access control, the provider can read and keep the content, and the copy restrictions do not stop screenshots [qahtani2021].
No attacker action is needed. Users who overestimate their protection send sensitive content where they should not; users who underestimate it pick an unprotected channel instead. The papers recommend explanations tested for harm, statements of what is not protected, and naming that does not suggest more than is provided.
Pepsi: Partly addressed. Impact: low.
Pepsi’s main mode, gateway custody, is not end-to-end in the strict sense: the server
decrypts, the queue holds plaintext, and the mail store is plaintext unless the user
also holds a client key and pepsi-stage-reencrypt is used. The manual says so
directly (Introduction, Gateway custody (custody = local, the MTA key)), and the indicators have exactly
defined meanings: [decrypted] says only that the message arrived encrypted and was
opened at this server, not who sent it (What a security indicator means). The secure-link
messages describe the portal accurately, including that a lost PIN cannot be looked
up.
The people at risk of a wrong mental model are the users, who see only the subject
tags and whatever their operator tells them. A [decrypted] tag is easily read as
“this mail was private all the way to me” or as “authentic”. The manual therefore
carries a chapter written for them, which operators may copy into their own help pages
(Using Pepsi: a guide for users): in plain words it says what each subject tag means and does not
mean, that the server can read their mail, that the mailbox copy is plaintext unless
it is re-encrypted to a key of their own, that a reply may leave in cleartext
(Users send mail unencrypted by mistake because encryption state is unclear) and how to insist on encryption, and what a
secure-link message is. It also tells the operator not to call the service
“end-to-end encryption”, and claims nothing beyond What a security indicator means and
Gateway custody (custody = local, the MTA key). What remains is what the papers ask for and a page cannot supply:
the text has not been tested with users, and what users are actually told is still the
operator’s choice.
96.9.8.4. Key management too hard: end-to-end mail clients error-prone or unused¶
The main reason that end-to-end mail encryption is barely used is that clients leave key management to the user, and users fail at it. Whitten and Tygar’s 1999 evaluation of PGP 5.0 found irreversible errors poorly guarded: a revocation was not sent to the key server although the dialog suggested it would be, and a forgotten pass phrase or a deleted private key meant a new key pair, with mail encrypted to the old one lost [whitten1999]. Two decades later the pattern is the same. With Mailvelope only 1 of 10 novice pairs exchanged encrypted mail within an hour, most often failing by encrypting to their own key [ruoti2019a]; 5 of 6 participants leaked plaintext into Gmail drafts, 3 sent mail unencrypted and one encrypted to the wrong key [lerner2017]; a participant mailed their private key instead of the public one [mauries2017]; and a FlowCrypt user sent their key passphrase to a contact [schiller2022]. Surveys and tests of PGP, S/MIME and pEp clients found that most people do not know mail encryption exists, few verify fingerprints, key retrieval and moving keys to mobile devices are the hardest steps (users mail private keys to themselves), and Outlook could encrypt only replies [reuter2021] [reuter2020]. PGP-enabled clients make it easy to send confidential mail unencrypted or to encrypt to the wrong key [green2014], and mail clients warn alarmingly about self-signed certificates while saying nothing about unsigned, forgeable mail [garfinkel2005a].
The result is non-use. In ten years of a university’s mail, only 5.46% of users ever used S/MIME or PGP, 0.06% of messages were encrypted and 2.8% signed, even between users who had already exchanged certificates, and private keys were mailed and weak or expired keys kept in use [stransky2022]. The consistent recommendation is automation: keys generated, published and found without user action and opportunistic encryption whenever a key is known, as proposed by Roth et al. with acceptance of a first key and introduction of later keys by the old one [roth2005], by Garfinkel and Miller as key continuity management [garfinkel2005a], and confirmed by the studies in which FlowCrypt and pEp removed most problems [reuter2021].
Pepsi: Partly addressed. Impact: medium.
Pepsi is built on this recommendation. In gateway custody users never handle a key:
pepsi-stage-encrypt generates them, publishes them over WKD and emits
Autocrypt:, pepsi-keydisc discovers correspondents’ keys (WKD, DANE, VKS,
LDAP) and pepsi-stage-autocrypt-learn learns them from inbound mail, and encryption and verification happen without user action
(Key management). Most failures in the studies (wrong key chosen, own key
encrypted to, private key mailed, plaintext in drafts, no key exchange) have no
counterpart for these users. The residues are where Pepsi automates validity without
telling the user, and where a user’s own client keys are involved:
Unverified keys.
MIN_TRUSTdefaults to the lowest rung, so harvested and gossiped keys are used without verification and the sender is not told which key or rung was used (Keys of correspondents, TOFU and key continuity miss first-contact and new-identity attacks). Two mechanisms narrow this without involving the user: a key harvested from a message whose DKIM signature passed at ingress, aligned withFrom:and covered the key ranks above one from unsigned mail (runginbound-signed,pepsi-common/src/keystore/rank.rs) and is never displaced by one; and whenpepsi-stage-encryptencrypts to a key that nobody published, it asks discovery in the background (recheck_harvested), at most once perNEGATIVE_TTLper address, so a WKD, DANE or key-server answer replaces the harvested key for later messages. Neither tells the sender anything.Revocation is published, where a key can sign it. Every revoking surface goes through
pepsi_keymat::revoke:pepsi-keys identity revoke, theretiree-mail command and the console’srevoke-identity. That function signs a revocation certificate with an OpenPGP MTA key while its private half still exists and stores it as the key’s public half. WKD then serves the key as revoked, a key that had been uploaded to a key server has the revocation uploaded there (pepsi-keys identity publish --retry), and the reply says exactly what was published (Revocation publishes what it can). Whitten and Tygar’s failure remains only where Pepsi holds no private half: a user’s own client key, whose revocation only their client can sign, and an S/MIME certificate, which its issuer revokes; the reply says that correspondents are not told.Lost client keys. A user’s client key, registered automatically from their
Autocrypt:header, becomes the address’s public key, andpepsi-stage-reencrypt(wizard default yes) seals every inbound message that the gateway decrypted to the user’s client keys. There is no escrow or gateway key that could open the filed copy later, by decision (Client custody (custody = client, the MUA key)): the recovery path is a second or third registered client key, since the filed copy is sealed to every one and the Web Key Directory serves them all, so a correspondent whose client takes the whole answer (gpg does) encrypts to the backup too. Thekey-registerednotice and the reply toregistersay this to the user (Losing a client key); a user with a single key who loses it still loses the mail filed under it, which is the price of client custody rather than a gap.
Nothing further is left for Pepsi’s code: raising MIN_TRUST is the operator’s
trade between verified keys and cleartext, and revoking or backing up a client key
is for its owner and their client.
96.9.8.5. Browser security indicators and anti-phishing toolbars ignored or spoofed¶
Phishing mail leads to look-alike web sites, and the browser’s indicators do not stop
users from entering credentials there. Dhamija et al. found in 2006 that 23% of
participants never looked at the address bar or security indicators, the best phishing
site fooled 90%, and 15 of 22 clicked through a certificate warning; education and
experience did not predict resistance [dhamija2006]. With always-correct
anti-phishing toolbars, Wu et al.’s participants were still spoofed 33% to 45% of the
time, explaining away look-alike URLs such as www.ssl-yahoo.com, and only an
active warning at the dangerous action helped [wu2006a]. A page can also draw a
complete fake browser window with a genuine-looking address bar, padlock and EV
indicator, which users accepted as often as a homograph domain [jackson2007].
Herzberg and Jbara found that only 18% of responses correctly identified an
unprotected site with the classic indicators, and proposed a prominent indicator
naming the certified owner or, better, a name or logo chosen by the user, which
improved detection substantially [herzberg2008].
The attacker needs nothing but a convincing message and site. The lasting advice is active warnings at the moment of risk, indicators that the page cannot imitate, and legitimate sites behaving consistently, for instance never asking users to follow mail links to enter credentials.
Pepsi: Partly addressed. Impact: low.
Pepsi runs no browser, but its secure-link portal follows the pattern that
phishing imitates: the recipient gets an HTML mail with a “Read the message”
button and is asked for a PIN on a web page. Its design limits what an imitation
can obtain: the portal asks for no account credentials, only a per-message PIN
that is useless without the 192-bit link token, and the notification states that
the PIN never arrives by e-mail. With NOTICE_SIGNER configured (off by
default) the notification is also signed by the deployment’s published notice
identity (Signed notices), which a client that verifies signatures
can tell from a fake, but a missing signature is a passive indicator of the kind
this literature finds ignored. A fake notification can still lead users to a
phishing page that asks for their mail password or delivers malware, and
recipients trained to follow such links are easier to deceive; the portal’s host
name is the operator’s choice and is the only thing that a careful user can check.
Pepsi cannot improve the browser’s indicators, which is the client vendors’ task,
and for HTTPS downgrade see SSL stripping and certificate-warning click-through.
Operators reduce the risk by serving the portal from their organisation’s own, recognisable domain and telling users what genuine notifications look like. Correspondents with published keys never see the portal.
96.9.8.6. Mail sender and phishing warnings missed or disregarded by users¶
Mail providers deliver mail whose origin they cannot confirm and leave the decision to the reader through a passive indicator, which does not work. In a 2023 study of Gmail’s “via” indicator, 89% of participants who saw it remembered it, but it had no significant effect on whether they would click the link; 85% still believed the displayed bank was the sender, and a related-looking via domain made the message more reassuring rather than less [liu2023b]. The indicator is grey, the size of the surrounding text, uses a word without security meaning, and is hidden behind two taps in the mobile app. Warnings fail worse for blind and low-vision users: screen readers present Gmail’s banner as a single word before sender and subject, which users skip, Outlook’s junk banner comes after the subject, and the banner cannot easily be found again, so participants missed or ignored it and read the message anyway [sharevski2024].
A phisher only has to get the message delivered. The authors recommend indicators that are noticeable (contrasting colour, a word conveying risk), explain the risk first, appear early in the message list and as a distinct element for assistive technology, and conclude that passive indicators are not sufficient on their own.
Pepsi: Partly addressed. Impact: low.
Pepsi is a server, and how a warning is shown is decided by the reader’s client.
Pepsi’s own indicators are subject prefixes ([decrypted], [verified]) placed at
the start of the decoded subject, where list views and screen readers present them
before anything else, with forged copies stripped
(Forged security tags in the Subject bypass gateway sanitisation) and exact meanings (What a security indicator means).
Research shows that the absence of an indicator goes unnoticed, so Pepsi also
writes negative ones, in the same place. A message from outside gets
[external] at the front of the subject and an X-Pepsi-Warning naming the
reason (Mail from outside that claims to be ours is marked) when its From: claims a served domain
without aligned authentication, when its From: is ambiguous, when its
Sender: names a served mailbox that nobody authenticated, or when its DMARC
failure was delivered because DMARC_ENFORCE is off (the wizard writes it for a
new installation; the compiled-in default is off) or the policy is none. The
tag is written after verification, so the originator’s DKIM signature over
Subject was judged on the bytes that it signed. A signature inside a
ciphertext that is bad, or sound but unanchored, gets [bad signature] or
[unverified signer] by default, and a plaintext from an unauthenticated
container [decrypted, unauthenticated]. For readers who want the verdict
outside the message area, which the message cannot imitate, the Outlook read pane
and the Thunderbird extension render X-Pepsi-Crypto and X-Pepsi-Warning as
a badge and a pane (Outlook: the read pane, Thunderbird: the verdict button).
A From: domain that renders like one of the served domains without being
one (examp1e.org, or a Cyrillic e (U+0435) in example.org, compared by UTS
#39 skeleton) gets X-Pepsi-Warning: from-domain-resembles-served-domain
however well it authenticates its own domain; the warning is a header field
only, for filters and the client extensions, since [external] means a
served-domain claim that nobody authenticated, and the look-alike claims nothing of
the kind.
Some cases stay silent. A stranger’s own domain that resembles no served domain
and fails no DMARC check gets no mark. A bad cleartext signature under the default
ON_BAD_SIGNATURE = record with an empty TAG_BAD_SIGNATURE looks like an
unsigned message (Missing or misleading indicators for forged or external sender mail). Under the default
ON_MISSING_SIGNATURE = record, an unsigned message from a correspondent whose
mail carried a valid signature within MISSING_SIGNATURE_WINDOW_DAYS is noted
only in X-Pepsi-Crypto (usually-signed=), where the client extensions show
it. Operators can set TAG_BAD_SIGNATURE, ON_MISSING_SIGNATURE = tag
([unsigned, usually signed]) and enforce DMARC. Rendering warnings accessibly
remains the client vendors’ task.
96.9.8.7. Spoofed or unreadably signed confirmation and password reset mail¶
Web sites identify and authenticate users by their ability to receive mail: registration, confirmation links and password reset messages all rest on a message that the user is expected to trust. Garfinkel pointed out in 2003 that recipients cannot tell a genuine message of this kind from an attacker’s copy. PayPal was already struggling with this at the time. Phishing that imitates confirmation and reset mail therefore works, and spam filters may in turn drop the genuine message [garfinkel2003a]. Signing the messages would let clients and filters recognise them. But OpenPGP and S/MIME signatures were shown by clients without support as unreadable attachments (an OpenPGP-signed message could appear blank with two attachments), which discouraged senders from using them. Garfinkel proposed signature formats that do not burden non-supporting clients, and optionally storing a public key per registered address so that later signed messages can be checked against it without a CA. The general weakness of mailbox-based authentication is treated under Mailbox access as the root of web account recovery and authentication.
Pepsi: Addressed. Impact: low.
Pepsi sends this kind of mail itself. The console mails one-time sign-in links
to end users (Signing in to the console by e-mail; the link’s origin is the configured
ENROL_URL, never the request’s Host), and the list web tier
(pepsi-httpd/src/web/account.rs) mints address verification and password
reset tokens that the operator passes on
(Mail and password resets sent to unverified registration addresses). The secure-link portal
sends a link to the recipient. The
secretary sends challenges, and several stages send notices with links or
instructions (payment requests, key rotation notices, settings and key
management replies). The flows are built carefully. A reset token is minted
only for an already verified address. Tokens expire after a day and are re-used
rather than re-minted. The form answers identically for known and unknown
addresses. A
GET on a token link changes nothing. Links point at the configured base URL
and are shown in full (The secure-link fallback portal). Every such message leaves with a
DKIM signature aligned to the deployment’s domain, which the recipient’s
provider checks under DMARC; pepsi-setup suggests p=reject; adkim=s as the
starter record for a domain that publishes none (pepsi-setup/src/dmarc.rs)
and leaves an existing p=none record in place with a note that it protects
nothing.
Both of the measures that the literature asks for are available. Outbound, the
component that writes a notice marks it, and with NOTICE_SIGNER configured
an instance of pepsi-stage-encrypt signs every marked message with one
OpenPGP or S/MIME identity of the deployment, whose key its Web Key Directory
publishes, protected headers included and nothing encrypted
(Signed notices). A client that verifies signatures can then tell a
genuine notice from a copy that DMARC let through, which is Garfinkel’s
proposal with a published key standing in for the per-address one. The option
is off until the operator creates the identity; the wizard writes the notice
stage with the option commented out. The cost Garfinkel describes remains for
clients without support, which show an OpenPGP signature as an attachment; a
signed notice is sent from the signer’s address so that a client’s check of
the signer against From: holds. The signature vouches for what the
deployment wrote, not for the fields a notice quotes from the message that
caused it, and a notice to a third party is left unsigned while a per-address
override could have changed its wording (Forged notices). Inbound, a
forged notice claiming one of the served domains without an aligned SPF or
DKIM pass is tagged [external] with X-Pepsi-Warning:
served-domain-not-authenticated (Mail from outside that claims to be ours is marked), and refused
when DMARC_ENFORCE = yes and the domain publishes an enforcing policy. A
portal notice is the classic phishing template, but a fake portal gains less
from it than usual, because the PIN comes to the recipient out of band from the
sender (The secure-link fallback portal). Operators close the rest of the gap by moving the
DMARC policy to quarantine or reject once their reports are clean.
Rendering signature status accessibly remains the client vendors’ task.
96.9.8.8. Look-alike and IDN homograph domains, confusable characters and alias addresses¶
Unicode deliberately keeps visually identical characters distinct, so a name can render like a trusted one while designating something else. Gabrilovich and Gontmakher named the homograph attack in 2002. They registered a “microsoft.com” spelt with Cyrillic letters and showed that IDN rules then forbade only auxiliary characters [gabrilovich2002]. Unicode TR #36 catalogues the variants. Mixed-script spoofs replace single letters, whole-script spoofs write a whole label in another script, and single-script spoofs use look-alikes within one script (“rn” for “m”, or combining marks). Rendering and font choices make the set larger [unicode-tr36]. RFC 6530 notes that internationalised mail extends the problem to local parts. Local parts are case sensitive, so normalising them does not help, and certificates that carry addresses inherit the confusion [rfc6530].
Measurements show that the attack is real. Holgers et al. found registered
confusables for many popular sites in 2006, 12-15% of them using IDN
characters. Most were advertising or for sale, and only 1.3% imitated the
original site [holgers2006]. ShamFinder’s homoglyph database (2019) found
3,280 IDN homographs of popular .com names, about half of them active.
Four of the ten most-resolved targeted gmail.com, the top one being an
active phishing site [suzuki2019]. Phishing surveys list typo-, bit-, sound-,
homograph- and combo-squatting among the main techniques. They report that over
80% of phishing sites hold TLS certificates, so the padlock says nothing about
the name [goenka2023]. Wu et al. (NDSS 2026) added a variant that needs no
Unicode at all. Alias syntax (+suffix, dots, provider-specific infixes) is
undocumented and differs between providers. As a result 31.65% of users who
knew about aliases accepted a phishing address as an alias of a trusted contact,
and users with technical expertise were more susceptible [wu2026]. The
proposed defences are confusable detection and mixed-script restrictions in the
software that displays names (UTS #39), registry bundling of confusables, a user
interface that shows which character was substituted rather than bare Punycode,
and standardised alias syntax at providers.
Pepsi: Partly addressed. Impact: low.
Pepsi displays no names to readers. It delivers the From: field, links and
addresses as received; showing them is the mail client’s job. Pepsi’s
processing does not confuse a look-alike with the original, because it
compares by exact identity. Domains are converted with IDNA2008
non-transitional processing to A-labels and lower-cased
(pepsi-common/src/domain.rs). The key store, WKD and the whitelist all key
on that form. pepsi-stage-check-whitelist matches an anchored expression
against the parsed addr-spec, so a homograph of a whitelisted correspondent is
not whitelisted. Addresses that Pepsi stores for list members must have ASCII
local parts (validate_email), and local accounts are passwd logins created
by the operator. The secure-link PIN alphabet leaves out look-alikes.
Where a look-alike would borrow credibility from Pepsi’s own indicator it is
looked for. A [verified] tag binds the signer to the From: address as
the reader sees it, and a WKD key or an anchored CA is an anchor like any
other, so before pepsi-stage-decrypt reports a signature valid it
compares the signer’s domain by skeleton with the domains in
LOCAL_DOMAINS, the domains of every crypto_identity and peer_key
address, and the domain of every from whitelist row that is a literal
address or a whole-domain wildcard (pepsi_common::lookalike,
keystore::db::known_domains, read once per TRUST_ANCHOR_TTL and only for
a message that would otherwise be valid). The skeleton is computed over the
domain’s U-label form with the UTS #39-style decomposition, mark stripping and
Cyrillic/Greek/digit folding that pepsi_common::indicator::skeleton applies
to subject tags. Equal skeletons over different domains withhold the tag
(valid-untrusted, withheld=lookalike-domain), and the signer’s A-label
is written to X-Pepsi-Crypto (signer-domain=), as it is for any
internationalised signer domain, where a client or a Sieve rule can see what
the rendered form hides (What [verified] binds the signer to, What a security indicator means).
The tag also names the bound address, so a reader sees [verified:
alice@xn--xample-9ua.org] rather than a bare [verified] beside a name.
Inbound mail is checked the same way at ingress, against the served domains
only: a From: domain whose skeleton equals a served domain’s while the
domain differs gets X-Pepsi-Warning: from-domain-resembles-served-domain
(pepsi_common::lookalike::collision, the function the decrypt stage uses),
whether or not the look-alike authenticates its own domain. That case hurts
most (examp1e.org writing to example.org staff), and checking it costs no
database read. The warning is a header field only, without the [external]
tag, whose meaning is a served-domain claim that nobody authenticated.
Several gaps remain: the checks cover domains only, not local parts (a local part
is its own domain owner’s to choose, and [verified: addr] shows the whole
address); ingress compares with the served domains only, so a look-alike of a
correspondent’s domain is caught by the decrypt stage for signed mail alone; a
legitimate internationalised domain whose skeleton equals a known ASCII one is
delivered and verified but not tagged; alias syntax at other providers
(+suffix, dots, infixes) is not modelled at all; and bidi text in a From:
display name is treated under Bidi override and syntax spoofing make displayed text differ from logical text. Beyond that the
defence belongs to client vendors and registries.
96.9.8.9. Bidi override and syntax spoofing make displayed text differ from logical text¶
A displayed string is the output of the Unicode bidirectional algorithm, while software processes the logical order. Explicit override and isolate controls, or right-to-left neighbours of neutral delimiters, can therefore make text display differently from what it is. Unicode TR #36 describes how “.” and “/” take the direction of their neighbours, so that URLs and addresses that mix directions display in a misleading order. It also describes syntax look-alikes (fraction slash, one-dot leader) that hide the real registrable domain, and how IDNA2003 and IDNA2008 can resolve the same name differently [unicode-tr36]. Boucher and Anderson’s “Trojan Source” (2021-2023) applied the bidi controls to source code. Overrides inside comments and string literals show reviewers different logic from what the compiler executes (CVE-2021-42574, with homoglyph identifiers as CVE-2021-42694). The authors note that the same trick has long been used to disguise the extension of malware attachments in mail. Coordinated disclosure led to compiler diagnostics (rustc, gcc), editor warnings and visible rendering of the controls [boucher2023]. In mail, the right-to-left override reverses addresses and attachment names in many clients (Sender display deception: display names, look-alikes, RTLO and truncation).
Pepsi: Partly addressed. Impact: low.
Pepsi handles bidi controls in two places. strip_forged_tags
(pepsi-common/src/indicator.rs) removes embedding, override and isolate
controls from the whole Subject of mail passing pepsi-stage-decrypt,
because they could make text anywhere in the line render as a security tag at
its start (Forged security tags in the Subject bypass gateway sanitisation). Ingress does the same for
every message from an unauthenticated session while it removes forged
[external] tags (strip_own_tags, pepsi-ingress/src/external.rs),
unless EXTERNAL_SUBJECT_TAG = no. And Pepsi’s own source
code is built with a Rust toolchain whose text_direction_codepoint_in_comment
and text_direction_codepoint_in_literal lints refuse Trojan Source by
default. For domains Pepsi follows IDNA2008 only (domain.rs), so it cannot
disagree with itself about which name a Unicode domain designates.
A third place is Pepsi’s own. Every attachment file name that Pepsi itself
shows or offers for download loses its embeddings, overrides, isolates and
direction marks (pepsi_common::filename::is_bidi_control), which are format
characters (Cf) that a char::is_control filter would pass. This covers
the secure-link portal (safe_name), the list archive (sanitise in
pepsi-archive/src/attach.rs) and the digest’s attachment placeholders
(pepsi-list/src/digest/scrub.rs). An archived
invoice<RLO>fdp.exe is offered as invoicefdp.exe.
Ingress also marks inbound mail whose From: carries bidi controls,
direction marks or invisible characters with X-Pepsi-Warning:
from-has-bidi-or-invisible-characters. Mail with an attachment whose file name
carries them gets X-Pepsi-Warning:
attachment-name-has-bidi-or-invisible-characters; ingress reads the
filename or name parameter, RFC 2231 and RFC 2047 decoded, in any part
including attached messages, with mail-parser
(pepsi_common::filename::message_has_disguised_filename). Both warnings are
meant for a Sieve rule or the client extensions
(Sender display deception: display names, look-alikes, RTLO and truncation).
Neither field is removed or rewritten, since that would break the
originator’s DKIM signature.
Several gaps remain. Pepsi delivers From: display names, attachment file names
and body text to mailboxes with their bidi controls intact (marked as above, apart
from body text), and subjects are cleaned only on the decrypt path and at ingress
for mail from outside; attachments inside ciphertext are not seen at ingress.
Whether a reversed address or a disguised .exe deceives the user then depends
on the client. On Pepsi’s own pages this is closed: the console, the list archive
and owner pages and the secure-link portal wrap subjects, senders, recipients and
file names in <bdi>, so an embedded right-to-left override reorders only its
own text. Removing the controls from From: display names and filename
parameters in transit would break the originator’s DKIM signature, so for
delivered mail the fix belongs to the client’s display.
96.9.8.11. Users click through or over-trust certificate warnings¶
When certificate validation fails, many clients warn the user instead of refusing, and the person deciding usually proceeds. Luo et al. tested 30 Android and five desktop browsers against 157 invalid certificates. Mobile browsers rejected only 5.4-9% outright and left the rest to a warning page or accepted them. The authors cite click-through rates of up to 64.6% for Chrome on Android warnings [luo2023]. Professionals do no better. In Ukrop et al.’s study of 75 developers, testers and administrators, about one in five rated a self-signed certificate or one that violated name constraints “looks OK” or better. Trust in an expired certificate depended mainly on how long ago it had expired. Clearer error messages and documentation lowered the over-trust [ukrop2019]. For mail, RFC 8314 (2018) observes that clients which let users click through certificate failures train users to accept them. “Pinning” a certificate that failed validation at account setup is open to a man in the middle at exactly that moment and has no secure refresh. The RFC asks for no easy click-through on accounts with a minimum confidentiality level and for security indicators only on verified TLS [rfc8314]. The attacker gains interception of credentials and mail, with the user’s consent.
Pepsi: Partly addressed. Impact: low.
Pepsi asks no human to accept a certificate. Its verdicts are fixed by
configuration. An S/MIME signer certificate that does not chain to an
operator-installed anchor simply yields valid-untrusted and no tag, with
nothing to click (What a security indicator means). pepsi-setup obtains real
certificates with certbot and never generates a self-signed one. A certificate
it cannot obtain is reported as deferred rather than replaced by a stop-gap, so
the users’ MUAs are not trained to click through on Pepsi’s own submission and
web listeners. The smarthost, LMTP and other relay clients verify by default
(TLS_VERIFY defaults to yes, and the wizard writes yes).
The automated analogue of “warn instead of reject” is DANE = warn, under
which pepsi-stage-relay-to-internet only logs a mismatch with usable TLSA
records and delivers anyway, so mail to a DANE-protected domain reaches an active
attacker who presents the wrong certificate, which RFC 7672 forbids. DANE =
strict is the default of
both relay stages (and the wizard writes it), so such a mismatch defers the
message as an MTA-STS enforce failure does
(pepsi-stage-relay-to-internet); DANE = warn is available only
as an explicit opt-out. The general unauthenticated-MX case is treated under
MTAs accept unvalidated certificates and rarely use DANE or MTA-STS. TLS_VERIFY = no is also available to an
operator who, like Ukrop’s participants, wants a misconfigured smarthost to
“just work”. That decision is the operator’s and leaves a man in the middle on
that hop. Finally, how a user’s own mail client treats certificate failures
when it connects to Pepsi is outside Pepsi’s control
(Mail clients and access protocols use cleartext login or strippable STARTTLS). The documentation and the
Stalwart importer present TLS_VERIFY = no as exposing
the relay password and the mail to a man in the middle, and point to TLS_CA
for a smarthost with a private CA. What is left is the operators’ own opt-outs
(DANE = warn, TLS_VERIFY = no), each documented as such, and the users’
mail clients.
96.9.8.12. Sender display deception: display names, look-alikes, RTLO and truncation¶
Users judge a message by the sender their client shows, and clients show
attacker-controlled data. RFC 4686 (2006) already warned about this. Signatures
relate only to the address, while users often look only at the display name.
Look-alike domains and unfamiliar Punycode pass for the real one. And a
From: listing several addresses leaves open which one a policy applies to
[rfc4686]. Shen et al. (USENIX Security 2021) showed the user-interface end of
this on 30 services and 23 clients. IDN homographs in addresses were rendered
without browser-style defences (10 services). Invisible characters and
@ : ; " truncated the displayed address (12). The right-to-left override
reordered it (11). Gmail, iCloud, Yandex and others fixed issues, while Outlook
and Mail.ru considered their behaviour conformant [shen2021]. Yu et al. found
webmail conversation views that show only the display name [yu2022a]. Veit et
al. tested seven clients in 2022. All mobile clients showed only the display
name until the user interacted. An RTLO address made Gmail web and Apple Mail
show the domain reversed, and long addresses were truncated even after
interaction. 43.8% of sender cases were rated highly susceptible [veit2024].
Their 2026 catalogue adds local-part substitution at the trusted domain,
legitimate notification services, mangled and extended domains, and forwarded
messages whose remote content changes later [veit2026]. The recommended client
behaviour is to always show name and address, to neutralise bidi controls and
mixed-script domains, and never to truncate the registrable domain.
Pepsi: Partly addressed. Impact: medium.
Pepsi blocks the parts of this that are about parsing. Ingress refuses a
message with more than one From: field. The submission gate checks every
mailbox in the From: of mail from local users. The key lookup, the signer
binding and the DKIM signing domain all read the first mailbox the way a client
does (Ambiguous From headers checked as one address and displayed as another). The display is a different
matter. A display name that names another address is refused at submission
(550 5.6.0 for "ceo@victim.example" <me@example.org>, judged as
rendered: encoded-words decoded, full-width @ folded, invisible and bidi
controls removed; pepsi_common::indicator::display_name_claim), and inbound
mail of that shape is marked, not refused: ingress adds X-Pepsi-Warning:
display-name-claims-other-address (removing any copy that a sender wrote) and
records state.auth.display_name_mismatch
(Ambiguous From headers checked as one address and displayed as another). The warning field reaches the
reader through a Sieve rule or the Outlook read pane and Thunderbird extension
(Outlook: the read pane, Thunderbird: the verdict button). A display name
without an address, such as "CEO" <me@example.org>, is not checked, and
inbound a From: with mailboxes in several domains, or one that cannot be
read strictly one way, is accepted but marked X-Pepsi-Warning:
from-ambiguous and tagged [external]. RTLO, other bidi
controls and invisible characters in the display name or address are not
removed, since the field is delivered as signed, but inbound mail carrying them
is marked with X-Pepsi-Warning: from-has-bidi-or-invisible-characters
(pepsi_common::indicator::from_has_display_controls; the zero-width joiners
and variation selectors that scripts and emoji need are exempt;
Bidi override and syntax spoofing make displayed text differ from logical text). A From: claiming a
served domain without aligned authentication, a Sender: naming a served
mailbox that nobody authenticated, or a DMARC failure without enforcement, is
tagged [external] (Mail from outside that claims to be ours is marked). A stranger’s own domain is
not flagged unless it renders like a served domain, which gets
X-Pepsi-Warning: from-domain-resembles-served-domain without a tag
(Look-alike and IDN homograph domains, confusable characters and alias addresses). Apart from those marks, only the
Authentication-Results field, which clients rarely show, tells the reader
whether the sender was authenticated (Missing or misleading indicators for forged or external sender mail).
The [verified: <address>] tag binds the signer to the From: line as
the reader sees it: pepsi-stage-decrypt withholds it (valid-untrusted,
withheld= in X-Pepsi-Crypto) when the display name or a comment shows
another address, when the field names more than one mailbox, and when the
signer’s domain is a look-alike of a known one (What [verified] binds the signer to,
What a security indicator means).
Most of this is the mail client’s job, and Pepsi cannot rewrite From:
without breaking the originator’s DKIM signature and DMARC alignment. Marking
every external sender rather than only those claiming a served domain would tag
legitimate list and notification mail and wear the mark out
(Mail sender and phishing warnings missed or disregarded by users), so what remains is for client
vendors: always showing name and address, neutralising bidi controls and never
truncating the domain.
96.9.8.13. Users misread or ignore signature and encryption indicators¶
Signature and encryption indicators protect only if users notice them and read
them correctly, and studies keep finding that they do neither. Whitten and Tygar
(1999) found that PGP 5 gave verification no visual representation of its own.
A single Decrypt/Verify button suggested that “verify” only meant decryption
had worked [whitten1999]. Garfinkel et al. surveyed 470 Amazon sellers in 2004.
Only a third of those who had received S/MIME-signed invoices for over a year
knew they had received signed mail, and 26% did not understand “signed”,
“sealed” and “encrypted”. Clients without support showed the signature as an
unreadable smime.p7s attachment, and nothing warned when a correspondent’s
key changed [garfinkel2005b]. Sheng et al. repeated the PGP study with PGP 9.
Automatic decryption made protection invisible, and two of five users accepted
a plain message formatted to look like PGP-decrypted and verified output
[sheng2006]. Fry et al. found clients using a wax “seal” icon for a signature,
which users read as confidentiality, and no feedback on whether a sent message
went out encrypted [fry2012]. Masone and Smith showed that even a correctly
read indicator answers the wrong question. A signature says “this key belongs
to this address”, while the recipient needs to know whether the sender may
request the action. In their grid-operator study, S/MIME users decided
correctly in 60% of tasks, no better than plaintext users. A look-alike sender
name fooled about half of every group [masone2010]. The proposed remedies are
distinct, passive indicators that need no training, warnings on key change
rather than on CA trivia, feedback before sending, and indicators designed for
the trust decision rather than the cryptography.
Pepsi: Partly addressed. Impact: low.
pepsi-stage-decrypt takes these findings into account. Verification is
automatic and has its own tag, separate from decryption ([verified:
<address>] versus [decrypted], in nesting order;
pepsi-stage-decrypt/src/report.rs), and the tag names the address that the
signer is bound to, which answers the question of who signed. Only an anchored
signature over the plaintext earns it, a clearsigned block that shows the
reader unsigned text is partial and earns nothing, and a first-seen key
earns nothing in cleartext (What a security indicator means). A signature inside a
ciphertext is always tagged, so that a replayed ciphertext does not read as
merely [decrypted]: [unverified signer] for a sound signature by an
untrusted or unknown key, [bad signature] for a bad one. With ISOLATE_SIGNED
the signed part is everything delivered. Forged tags are removed from the
decoded subject, look-alikes included, and every inbound X-Pepsi-* header
is stripped (Forged security tags in the Subject bypass gateway sanitisation). Because the tag lives in
the subject, it works in any client and never appears as an unreadable
attachment. Under ENABLE_PEP outbound mail is signed only inside
encryption, so non-supporting recipients do not get smime.p7s clutter. A
correspondent’s key changing produces a notice to the local recipients
(A rotation is never silent), which is what Garfinkel et al. asked for.
What remains is on the human side. Outside a ciphertext the indicator is
positive-only: under the default ON_BAD_SIGNATURE = record with an empty
TAG_BAD_SIGNATURE (empty because a list cannot rewrite a body it cannot
read), a message whose cleartext signature fails looks exactly like an
unsigned one; an unsigned message from a correspondent who usually signs is
tagged only under ON_MISSING_SIGNATURE = tag (default record: a
usually-signed= mark in X-Pepsi-Crypto, pepsi.signed_sender).
[decrypted] on a message that carries no signature may be
read as “authentic”. A tag in the middle of a subject is left alone, and a
sender can still imitate verified output in the body
(Security status spoofed in-band in message body or headers); the Outlook read pane and the
Thunderbird extension show the verdict from X-Pepsi-Crypto outside the
message area, where the content cannot imitate it, but only for readers who
install them (Outlook: the read pane, Thunderbird: the verdict button). As
Masone and Smith found, [verified: <address>] on an unfamiliar domain is a
statement about the address, not about authority; a look-alike of a domain
this deployment knows withholds the tag (Look-alike and IDN homograph domains, confusable characters and alias addresses).
Senders hear that their own message went out in clear only under
NOTIFY_CLEARTEXT = author, which is off by default, and never which key or
rung a recipient’s copy was encrypted to
(Users send mail unencrypted by mistake because encryption state is unclear). Switching that notice on is the
operator’s choice, and what is left beyond it is the clients’ display and the
readers’ attention rather than Pepsi’s code.
96.9.8.14. Users skip, botch or cannot use key fingerprint verification¶
Decentralised and opportunistic key distribution is secure against an active attacker only if people compare fingerprints, and they mostly do not, or do it badly. Whitten and Tygar found PGP 5 deriving key validity automatically from trust ratings that users misread. Only three of eight participants who fetched keys considered whether to trust them [whitten1999]. The secure-messaging literature confirms this for the “authentication ceremony”. Unprompted, only 13-14% of users find and complete it. Many who try send the code over the very channel being checked. Users confuse key-change notices with connectivity problems [vaziripour2017] [herzberg2020] [alatawi2023] [unger2015]. Comparisons are also error-prone. With hexadecimal fingerprints, 10.1% of substituted keys matching in the parts people look at (80 of 112 bits, a feasible partial-preimage search) were accepted. Generated sentences reached 98% detection [dechand2016]. Remote comparison across apps or by voice had false-accept rates of 13-40%, rising to 60% for a one-digit difference [shirvanian2017a]. In p≡p, five of ten trustwords are shown by default, so a full check covers 80 bits. A user who checks three or four words can be beaten with about 2^32-2^38 key generations, and voice comparison invites voice-imitation and social engineering [sandoval2020a]. Model checking of p≡p showed that a careless “confirm” turns an unauthenticated key into the highest rating, Secure & Trusted [stojkovski2019]. The proposed remedies are better encodings (sentences, digits), commitments, mandatory or PAKE-based verification, ceremonies that are easier to find, and key transparency to reduce the reliance on users.
Pepsi: Partly addressed. Impact: medium.
Pepsi does not rely on users verifying fingerprints for its inbound verdicts.
[verified] requires a key anchored without a ceremony: our own identity, an
operator-pinned key, DNSSEC-validated DANE, WKD, or an S/MIME chain to an
operator-installed anchor. TOFU, harvested and gossiped keys can only produce
valid-untrusted (What a security indicator means). No click can promote a key, so the
careless-confirm failure that Stojkovski et al. found in p≡p has no direct analogue:
the one user act that raises a key’s rung, the pin e-mail command, needs an
enrolled TOTP second factor and the whole fingerprint typed into a new message,
and is audited (key.peer.pin). Pepsi implements no handshake, and the
operator’s pepsi-keys peer import --pin / peer pin remain the other ways
to raise a key to manual.
For outbound mail the problem stays, by an explicit trade. MIN_TRUST
defaults to the bottom rung, so mail is encrypted to unverified keys, and the
sending user is offered no ceremony at all and is not told which rung was used
(Keys of correspondents, TOFU and key continuity miss first-contact and new-identity attacks). The ladder does what it can
without a human: a key covered by a passing, aligned DKIM signature ranks above
one from unsigned mail and is never displaced by one, and a harvested key in use
makes the encrypt stage ask discovery in the background, so that a key that the
owner published replaces it (Key management too hard: end-to-end mail clients error-prone or unused).
The authentication that stands in for the ceremony is the correspondent’s
domain, not the correspondent. The one place where Pepsi asks a human to compare
fingerprints is the key rotation notice
(pepsi-stage-autocrypt-learn/src/notice.rs, A rotation is never silent),
mailed to the local users whose next reply goes to the new key. It shows each
fingerprint in hex and, beneath it, in the PGP word list
(pepsi_common::keystore::words), whose alternating two- and three-syllable
words were designed for comparison aloud, and it advises comparing in person or
by reading the words to each other. It names the new key’s rung
(inbound-signed, inbound or gossip), so that the reader knows what
vouches for it. When key commands are on, it also gives the exact subject that
records a successful comparison, pin FPR CODE, which pins the key on the
manual rung for every user of the deployment (A user’s own pin). The
word list is not one of the sentence encodings that Dechand et al. measured, and
twenty words for a v4 fingerprint is long: what it removes is the hex digit
confusion and the partial match on the ends, not the effort. What remains is
that the comparison is optional, a forged rotation is detected only by a user
who makes it, and a user who never pins is protected only by the rung rules
and ACCEPT_ROTATION = expired or a higher MIN_TRUST (both at the cost of
cleartext or refused rotations). Outbound, the sending user is still not told
which rung each recipient’s key sat on at the time (state.crypto.out
records it for the operator). What is left is for users, who choose whether to
compare, and operators, who choose the rung rules; replacing the ceremony by key
transparency needs a standard for e-mail first.
96.10. 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.
Who must act |
Critical or high |
Medium |
Low |
Total |
|---|---|---|---|---|
0 |
1 |
0 |
1 |
|
0 |
45 |
103 |
148 |
|
0 |
5 |
23 |
28 |
|
0 |
14 |
17 |
31 |
|
0 |
6 |
39 |
45 |
|
0 |
4 |
20 |
24 |
|
0 |
12 |
17 |
29 |
|
0 |
12 |
26 |
38 |
|
All open issues (each counted once) |
0 |
53 |
153 |
206 |
96.10.1. Pepsi developers¶
A change to Pepsi’s code or defaults would close or narrow the issue.
96.10.1.1. Deployment, configuration and credentials¶
Subversion of legitimate packages in source, build or distribution – partly addressed, medium
96.10.2. Pepsi operators and domain owners¶
Configuration, DNS records or operating policy of the deployment.
96.10.2.1. Implementation defects¶
TLS library implementation bugs (Heartbleed and kin) – partly addressed, low
Bailiwick and cache-acceptance flaws let resolvers cache out-of-zone records – partly addressed, medium
DNS label misinterpretation and unvalidated DNS data injected into applications – partly addressed, low
Resolvers abort or crash on malformed responses and bad CD-bit caching – partly addressed, low
Multiple or duplicate From headers evade DMARC and DKIM checks – partly addressed, low
Content concealed from spam filters (HTML/CSS, invisible chars, bad QR) – partly addressed, low
MIME parser differentials let content evade filters and gateways – partly addressed, low
LDAP filter and regex injection in key lookup selects another user’s key – partly addressed, low
96.10.2.2. Cryptographic weaknesses¶
Cross-protocol Bleichenbacher attacks via shared RSA keys (DROWN) – partly addressed, low
Missing forward secrecy: stolen keys or resumption state decrypt past traffic – partly addressed, low
DNS source-port and TXID randomisation defeated by side channels or weak PRNGs – partly addressed, medium
IP fragmentation enables off-path DNS cache poisoning – partly addressed, medium
Weak, shared or never-rotated DNSSEC signing keys – partly addressed, medium
Short, long-lived or shared DKIM RSA keys and rsa-sha1 signatures – partly addressed, low
Bleichenbacher oracle on S/MIME RSA key transport via gateway bounces – partly addressed, low
Downgrade from authenticated to unauthenticated encryption under the same key – partly addressed, low
CBC padding and format oracles against unauthenticated S/MIME – partly addressed, low
Chosen-ciphertext attacks via a reply oracle on unauthenticated encryption – partly addressed, low
Short keys and weak digests in deployed certificates and keyrings – partly addressed, low
Bleichenbacher padding oracle in RSA PKCS #1 v1.5 decryption – partly addressed, low
Timing and microarchitectural Bleichenbacher oracles (Marvin and successors) – partly addressed, low
CBC padding oracles (Vaudenay) recover plaintext from padding errors – partly addressed, low
Manger chosen-ciphertext attack on distinguishable RSA-OAEP decoding errors – partly addressed, low
Unauthenticated encryption modes are malleable and forgeable – partly addressed, low
Unauthenticated private-key encryption lets the storage holder maul keys – partly addressed, low
RSA key reuse across encryption and signature schemes enables cross-attacks – partly addressed, low
Insufficient key length: factoring RSA-768/1024 and brute-forcing DES – partly addressed, low
Timing and branch-prediction attacks on modular exponentiation – partly addressed, low
Acoustic and electromagnetic key extraction (RSA, ECDH) via chosen ciphertexts – partly addressed, low
Side channels in RSA key generation (non-constant-time GCD) – partly addressed, low
Offline guessing of weak password hashes, key passphrases and derived keys – partly addressed, low
96.10.2.3. Protocol design gaps¶
Opportunistic STARTTLS can be stripped by an active attacker – partly addressed, medium
SMTP has no originator authentication: envelope and header sender forgeable – vulnerable, medium
Mail routing and sender authentication rely on unauthenticated DNS – vulnerable, medium
Off-path DNS cache poisoning by forged responses (Kaminsky) – partly addressed, medium
On-path DNS interception and resolver tampering – partly addressed, medium
SSL stripping and certificate-warning click-through – partly addressed, low
Keys published in DNS are only as trustworthy as the zone operator – vulnerable, medium
DANE-TA usage bypasses revocation and policy constraints – partly addressed, low
Unauthenticated or failed denial of existence suppresses DNS records – partly addressed, low
DNSSEC key compromise cannot be revoked; synchronised expiry of signatures – vulnerable, low
Missing zone isolation in shared authoritative DNS enables covert hijacking – vulnerable, medium
TLS reports can be suppressed, flooded or redirected – partly addressed, low
Provider-side encryption at rest leaves data readable by the provider – partly addressed, medium
DKIM replay of a validly signed message to unintended recipients – partly addressed, medium
SPF and DKIM authenticate a domain other than the displayed From – partly addressed, low
Domain-level authentication never identifies the individual sender – partly addressed, medium
Relaxed DMARC alignment lets any subdomain speak for the organisation – partly addressed, medium
Forwarders, relays and lists launder spoofed mail into authenticated mail – partly addressed, low
Authenticated accounts and tenants may send as any From address – partly addressed, low
Sender whitelists bypassed by a forged From address – partly addressed, low
Postage stamps stolen, depleted or reused in stamp-based anti-spam – partly addressed, low
IP blocklists evaded by bots, webmail accounts and shared networks – partly addressed, low
Adversarial evasion of content-based phishing and scanning classifiers – partly addressed, low
No warning when a usually-signing contact sends unprotected mail – partly addressed, medium
Client-side scanning undermines end-to-end encryption – partly addressed, low
Opportunistic E2EE trusts server-supplied keys without verification – partly addressed, medium
Autocrypt and in-band key exchange open to key injection and MITM – partly addressed, low
TOFU and key continuity miss first-contact and new-identity attacks – vulnerable, medium
Key escrow, provider-held keys or provider-served crypto code defeat E2EE – vulnerable, medium
No forward secrecy for long-term mail encryption keys – partly addressed, low
Keyservers accept and serve unauthenticated key material and revocations – partly addressed, low
CA compromise, coercion and mis-issuance of certificates – vulnerable, medium
Unconstrained CA signing scope and opaque trust-store control – partly addressed, medium
CA domain validation subverted via BGP and DNS attacks – partly addressed, medium
Log equivocation and unenforced Certificate Transparency – partly addressed, low
Replayed OCSP responses and stale revocation windows – partly addressed, low
Non-repudiable signatures and lack of deniability – vulnerable, low
Colluding introducer forwards an attacker key in trusted introductions – partly addressed, low
Encrypted unsolicited mail evades content filters – partly addressed, low
EFAIL direct exfiltration: plaintext spliced into attacker content – partly addressed, low
Predictable RNG compromises all session secrets without static-static DH – partly addressed, medium
PAKE trusted-setup dependence and offline attacks on stored secrets – partly addressed, low
Reverse-proxy phishing steals passwords, OTPs and session cookies past MFA – partly addressed, low
OAuth bearer and refresh token leakage, replay and client impersonation – partly addressed, low
Typo-squatted, expired or recycled domains and mailboxes capture accounts – partly addressed, low
Unauthenticated decryption instructions redirect users to attacker sites – vulnerable, medium
Sender spoofing and business e-mail compromise – partly addressed, medium
96.10.2.4. Missing or incorrect checks¶
TLS clients skip certificate or host-name verification – partly addressed, low
Ambiguous wildcard and multi-name certificate matching – partly addressed, low
Stub resolvers trust an unauthenticated AD bit from the recursive resolver – partly addressed, medium
Unsigned or stale delegation glue trusted by resolvers – partly addressed, medium
Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment) – partly addressed, low
Mail-filter gateways bypassed by direct delivery or trusted relay IPs – partly addressed, low
Innocent mail servers injected into DNS blocklists – partly addressed, medium
Unnormalised address aliases create unlimited distinct accounts – partly addressed, low
Keys and certificates imported or trusted without verification – partly addressed, low
Revocation not checked or soft-failed by clients – partly addressed, low
96.10.2.5. Deployment, configuration and credentials¶
DNSSEC misconfiguration breaks the chain of trust (missing DS, bogus zones) – partly addressed, low
Most recursive resolvers do not validate DNSSEC – partly addressed, low
Mistimed or noncompliant DNSSEC key rollovers make zones bogus – partly addressed, low
Stale or mismatched TLSA records break SMTP DANE – partly addressed, low
Dangling DNS records to released resources enable takeover – partly addressed, low
BGP hijacking of mail infrastructure lacking ROA/ROV and redundancy – vulnerable, medium
Weakest-link CA trust and interception roots allow forged certificates – partly addressed, medium
Large DNSSEC and TLSA responses fragment and are dropped – partly addressed, low
Missing, invalid or non-enforcing DMARC policies leave domains spoofable – partly addressed, low
Missing, invalid, broken or soft-fail SPF records – partly addressed, low
Overly permissive SPF (+all, shared-provider includes, cloud IP pools) – partly addressed, medium
DKIM private key theft and key-service compromise – partly addressed, medium
Blocklist collateral damage and authentication-misconfiguration bounces – partly addressed, low
Mail appliances store secrets world-readable or unprotected – partly addressed, low
Stale certificates and missing revocation after key exposure – partly addressed, low
Certificates without revocation pointers or a validatable chain – partly addressed, low
Replay of phished or reused static passwords and public-address logins – partly addressed, medium
Stolen unrotated token-signing key accepted for enterprise mailboxes – partly addressed, low
Login spoofing and ticket key exposure on multi-user hosts – partly addressed, low
96.10.2.6. Resource exhaustion and abuse¶
Mail bombing and mailbox flooding (incl. chain bombs) – partly addressed, medium
Resource exhaustion of SMTP servers – partly addressed, low
KeyTrap: algorithmic complexity DoS in DNSSEC validation – partly addressed, medium
Resolver resource exhaustion (cache flush, CNAME chains, retry bypass) – partly addressed, medium
MTA-STS policy poisoning causes denial of mail delivery – partly addressed, low
TLS handshake computational denial of service – partly addressed, medium
Subscription and web-form e-mail bombing via unverified sign-ups – partly addressed, medium
SPF checks let outsiders induce queries from closed resolvers – vulnerable, low
Challenge-response filters send backscatter to forged senders – partly addressed, low
Bounces, auto-replies and MDNs reflected at forged return addresses – partly addressed, low
Spam and virus scanner crashes and timeouts on crafted mail – partly addressed, low
Resource exhaustion of a postage quota enforcer – partly addressed, low
Provider notification workflows send attacker-controlled mail – partly addressed, low
Keyserver certificate flooding and keystore poisoning – partly addressed, low
96.10.2.7. Information leaks and tracking¶
Recipient address harvesting via VRFY/EXPN, RCPT replies and bounces – partly addressed, low
NSEC/NSEC3 zone walking enumerates names and key-record addresses – partly addressed, low
DMARC reports sent to unauthorised, foreign or unregistered destinations – partly addressed, low
DKIM signatures make stolen mail verifiably attributable – partly addressed, low
Scriptless CSS exfiltration of decrypted plaintext – partly addressed, low
Decrypted mail, keys or subjects persisted to logs and local storage – partly addressed, medium
Portals and APIs disclosing user data or key material without auth – partly addressed, low
Cleartext metadata, headers and lengths of encrypted mail – partly addressed, low
Keyserver queries and refreshes leak contacts and keyring contents – partly addressed, low
Automatic key lookups (WKD, OPENPGPKEY) leak who is being contacted – partly addressed, low
OCSP and certificate URL fetches leak activity to third parties – partly addressed, low
RSA public moduli reveal the key-generating library – partly addressed, low
Addresses published on web pages harvested for spam and phishing – partly addressed, low
96.10.2.8. Misleading display and user decisions¶
Missing or misleading indicators for forged or external sender mail – partly addressed, low
Inconsistent, missing or opt-in e-mail security indicators – partly addressed, low
Forged security tags in the Subject bypass gateway sanitisation – partly addressed, medium
Clients silently send mail unencrypted – partly addressed, low
Portal passwords sent over the same unprotected channel – partly addressed, medium
Users send mail unencrypted by mistake because encryption state is unclear – partly addressed, medium
Users share encryption passwords and shared secrets in cleartext – partly addressed, medium
Users and vendor claims misrepresent what end-to-end encryption protects – partly addressed, low
Key management too hard: end-to-end mail clients error-prone or unused – partly addressed, medium
Browser security indicators and anti-phishing toolbars ignored or spoofed – partly addressed, low
Mail sender and phishing warnings missed or disregarded by users – partly addressed, low
Users click through or over-trust certificate warnings – partly addressed, low
Users misread or ignore signature and encryption indicators – partly addressed, low
Users skip, botch or cannot use key fingerprint verification – partly addressed, medium
96.10.3. Standards bodies¶
The standard itself has to change; Pepsi implements it as written, usually for interoperability.
96.10.3.1. Implementation defects¶
Untrusted SPF macro, explanation and trace data from DNS – partly addressed, low
96.10.3.2. Cryptographic weaknesses¶
EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail – partly addressed, low
96.10.3.3. Protocol design gaps¶
MTA-STS first-contact gap and blocking of policy discovery – partly addressed, low
DNSSEC key compromise cannot be revoked; synchronised expiry of signatures – vulnerable, low
TLS reports can be suppressed, flooded or redirected – partly addressed, low
DKIM replay of a validly signed message to unintended recipients – partly addressed, medium
Intermediary modifications to signed mail cannot be attributed – vulnerable, low
Missing, malformed and unreliable DMARC aggregate and failure reports – partly addressed, low
Unauthenticated client auto-configuration steers clients to attacker servers – partly addressed, low
Undetectable key substitution or equivocation by key directories and CAs – partly addressed, medium
Autocrypt and in-band key exchange open to key injection and MITM – partly addressed, low
No forward secrecy for long-term mail encryption keys – partly addressed, low
Surreptitious forwarding: signatures not bound to the intended recipient – partly addressed, low
Ciphertext decrypted inside attacker-controlled message context – partly addressed, medium
Header fields not protected by signature or encryption – partly addressed, low
Non-repudiable signatures and lack of deniability – vulnerable, low
Unknown key-share: derived keys not bound to party identities – partly addressed, low
96.10.3.4. Missing or incorrect checks¶
Unnormalised address aliases create unlimited distinct accounts – partly addressed, low
Invalid, expired or old signatures reported as valid – partly addressed, low
96.10.3.5. Deployment, configuration and credentials¶
Weakest-link CA trust and interception roots allow forged certificates – partly addressed, medium
96.10.3.6. Resource exhaustion and abuse¶
MTA-STS policy poisoning causes denial of mail delivery – partly addressed, low
Bounces, auto-replies and MDNs reflected at forged return addresses – partly addressed, low
DMARC, TLS-RPT and DKIM failure reports as reflection floods – partly addressed, low
96.10.3.7. Information leaks and tracking¶
DKIM signatures make stolen mail verifiably attributable – partly addressed, low
Cleartext metadata, headers and lengths of encrypted mail – partly addressed, low
Automatic key lookups (WKD, OPENPGPKEY) leak who is being contacted – partly addressed, low
96.10.3.8. Misleading display and user decisions¶
Recipient cannot see whether a message travelled over TLS – partly addressed, low
Users skip, botch or cannot use key fingerprint verification – partly addressed, medium
96.10.4. Other mail providers¶
Other MTAs, receivers, providers and certificate authorities in the ecosystem, whose behaviour Pepsi cannot control.
96.10.4.1. Cryptographic weaknesses¶
DNS source-port and TXID randomisation defeated by side channels or weak PRNGs – partly addressed, medium
IP fragmentation enables off-path DNS cache poisoning – partly addressed, medium
Weak, shared or never-rotated DNSSEC signing keys – partly addressed, medium
Insufficient key length: factoring RSA-768/1024 and brute-forcing DES – partly addressed, low
96.10.4.2. Protocol design gaps¶
Opportunistic STARTTLS can be stripped by an active attacker – partly addressed, medium
SMTP has no originator authentication: envelope and header sender forgeable – vulnerable, medium
Mail routing and sender authentication rely on unauthenticated DNS – vulnerable, medium
Off-path DNS cache poisoning by forged responses (Kaminsky) – partly addressed, medium
On-path DNS interception and resolver tampering – partly addressed, medium
Missing zone isolation in shared authoritative DNS enables covert hijacking – vulnerable, medium
Headers added to DKIM-signed mail when not oversigned – partly addressed, low
8BITMIME downgrade in transit breaks DKIM signatures – partly addressed, low
Missing, malformed and unreliable DMARC aggregate and failure reports – partly addressed, low
OAuth bearer and refresh token leakage, replay and client impersonation – partly addressed, low
Mailbox access as the root of web account recovery and authentication – partly addressed, low
96.10.4.3. Missing or incorrect checks¶
MTAs accept unvalidated certificates and rarely use DANE or MTA-STS – partly addressed, medium
Unsigned or stale delegation glue trusted by resolvers – partly addressed, medium
Receivers deliver mail failing SPF, DKIM or DMARC (including strict alignment) – partly addressed, low
Mail-filter gateways bypassed by direct delivery or trusted relay IPs – partly addressed, low
Innocent mail servers injected into DNS blocklists – partly addressed, medium
96.10.4.4. Deployment, configuration and credentials¶
MTA-STS scarce, in testing mode, misconfigured or not enforced – partly addressed, low
Dangling DNS records to released resources enable takeover – partly addressed, low
BGP hijacking of mail infrastructure lacking ROA/ROV and redundancy – vulnerable, medium
Missing, invalid, broken or soft-fail SPF records – partly addressed, low
Overly permissive SPF (+all, shared-provider includes, cloud IP pools) – partly addressed, medium
Blocklist collateral damage and authentication-misconfiguration bounces – partly addressed, low
CAs issue non-compliant or broken certificates – partly addressed, low
Certificates without revocation pointers or a validatable chain – partly addressed, low
96.10.4.5. Resource exhaustion and abuse¶
Short-lived BGP hijacks to send untraceable spam – partly addressed, low
Direct-to-MX bot spam and IP spoofing evade port-25 blocking and reputation – partly addressed, low
96.10.4.6. Information leaks and tracking¶
DSNs, MDNs and Delivered-To disclose addresses, readers and topology – partly addressed, low
96.10.5. Mail client and webmail vendors¶
The software the recipient reads mail with.
96.10.5.1. Implementation defects¶
MIME parser differentials let content evade filters and gateways – partly addressed, low
Reply-steering header parsing (Bcc on reply-all, header-name prefixes) – partly addressed, low
GnuPG status-line and output injection fools front ends – partly addressed, low
96.10.5.2. Cryptographic weaknesses¶
EFAIL: CBC/CFB malleability gadgets exfiltrate decrypted mail – partly addressed, low
OpenPGP integrity protection (MDC) missing, strippable or not enforced – partly addressed, low
Downgrade from authenticated to unauthenticated encryption under the same key – partly addressed, low
CBC padding and format oracles against unauthenticated S/MIME – partly addressed, low
Chosen-ciphertext attacks via a reply oracle on unauthenticated encryption – partly addressed, low
Legacy, export-grade, 64-bit-block or ECB content encryption in mail – partly addressed, low
CBC padding oracles (Vaudenay) recover plaintext from padding errors – partly addressed, low
Unauthenticated encryption modes are malleable and forgeable – partly addressed, low
96.10.5.3. Protocol design gaps¶
Mail clients and access protocols use cleartext login or strippable STARTTLS – partly addressed, low
Headers added to DKIM-signed mail when not oversigned – partly addressed, low
Unauthenticated Sender header and inconsistent on-behalf-of display – partly addressed, low
Replies, drafts and mailto turning clients into decryption/signing oracles – partly addressed, medium
Unauthenticated client auto-configuration steers clients to attacker servers – partly addressed, low
No warning when a usually-signing contact sends unprotected mail – partly addressed, medium
Encrypted mail stored under the transport key forces key retention – partly addressed, low
Surreptitious forwarding: signatures not bound to the intended recipient – partly addressed, low
Ciphertext decrypted inside attacker-controlled message context – partly addressed, medium
Header fields not protected by signature or encryption – partly addressed, low
EFAIL direct exfiltration: plaintext spliced into attacker content – partly addressed, low
Weak binding between signer certificate or key and the From address – partly addressed, low
Unknown key-share: derived keys not bound to party identities – partly addressed, low
96.10.5.4. Missing or incorrect checks¶
Invalid, expired or old signatures reported as valid – partly addressed, low
Acting on signature presence without verification – partly addressed, low
96.10.5.5. Information leaks and tracking¶
Received and other outgoing headers expose sender IPs, clients and contacts – partly addressed, low
DSNs, MDNs and Delivered-To disclose addresses, readers and topology – partly addressed, low
Remote content and personalised links reveal opens, device and location – partly addressed, low
Backchannels and CSS bypass remote-content blocking and fingerprint – partly addressed, low
Scriptless CSS exfiltration of decrypted plaintext – partly addressed, low
TOTP secrets exposed in plaintext backups and to app developers – partly addressed, low
96.10.5.6. Misleading display and user decisions¶
Recipient cannot see whether a message travelled over TLS – partly addressed, low
Missing or misleading indicators for forged or external sender mail – partly addressed, low
Inconsistent, missing or opt-in e-mail security indicators – partly addressed, low
Forged security tags in the Subject bypass gateway sanitisation – partly addressed, medium
Signature spoofing via partial signing and MIME/CMS wrapping – partly addressed, low
Key management too hard: end-to-end mail clients error-prone or unused – partly addressed, medium
Browser security indicators and anti-phishing toolbars ignored or spoofed – partly addressed, low
Mail sender and phishing warnings missed or disregarded by users – partly addressed, low
Look-alike and IDN homograph domains, confusable characters and alias addresses – partly addressed, low
Bidi override and syntax spoofing make displayed text differ from logical text – partly addressed, low
Users click through or over-trust certificate warnings – partly addressed, low
Sender display deception: display names, look-alikes, RTLO and truncation – partly addressed, medium
Users misread or ignore signature and encryption indicators – partly addressed, low
96.10.6. Maintainers of Pepsi’s dependencies¶
Libraries Pepsi builds on.
96.10.6.1. Implementation defects¶
TLS library implementation bugs (Heartbleed and kin) – partly addressed, low
Bailiwick and cache-acceptance flaws let resolvers cache out-of-zone records – partly addressed, medium
DNS label misinterpretation and unvalidated DNS data injected into applications – partly addressed, low
Resolvers abort or crash on malformed responses and bad CD-bit caching – partly addressed, low
MIME parser differentials let content evade filters and gateways – partly addressed, low
Memory corruption in ASN.1, CMS, certificate and OpenPGP parsers – partly addressed, low
Malleable ASN.1 OID encoding accepted by a DER decoder – partly addressed, low
96.10.6.2. Cryptographic weaknesses¶
Traditional public-key algorithms broken by quantum computers – vulnerable, low
Bleichenbacher padding oracle in RSA PKCS #1 v1.5 decryption – partly addressed, low
Timing and microarchitectural Bleichenbacher oracles (Marvin and successors) – partly addressed, low
Manger chosen-ciphertext attack on distinguishable RSA-OAEP decoding errors – partly addressed, low
Timing and branch-prediction attacks on modular exponentiation – partly addressed, low
Acoustic and electromagnetic key extraction (RSA, ECDH) via chosen ciphertexts – partly addressed, low
Side channels in RSA key generation (non-constant-time GCD) – partly addressed, low
Compilers turn constant-time code into secret-dependent branches – partly addressed, low
96.10.6.3. Protocol design gaps¶
Log equivocation and unenforced Certificate Transparency – partly addressed, low
96.10.6.4. Missing or incorrect checks¶
OpenPGP subkey and user ID binding signatures not verified – partly addressed, low
96.10.6.5. Deployment, configuration and credentials¶
Malicious packages under confusing names (typosquatting, dependency confusion) – partly addressed, low
Subversion of legitimate packages in source, build or distribution – partly addressed, medium
96.10.6.6. Resource exhaustion and abuse¶
KeyTrap: algorithmic complexity DoS in DNSSEC validation – partly addressed, medium
Resolver resource exhaustion (cache flush, CNAME chains, retry bypass) – partly addressed, medium
Spam and virus scanner crashes and timeouts on crafted mail – partly addressed, low
96.10.6.7. Information leaks and tracking¶
Secret handling defects: variable-time compares, lost zeroisation, spills – partly addressed, low
RSA public moduli reveal the key-generating library – partly addressed, low
96.10.7. Users¶
What the human user has to do or avoid.
96.10.7.1. Implementation defects¶
GnuPG status-line and output injection fools front ends – partly addressed, low
96.10.7.2. Cryptographic weaknesses¶
Offline guessing of weak password hashes, key passphrases and derived keys – partly addressed, low
96.10.7.3. Protocol design gaps¶
Mail clients and access protocols use cleartext login or strippable STARTTLS – partly addressed, low
SSL stripping and certificate-warning click-through – partly addressed, low
Compelled or covert provider disclosure of keys and IP logs – partly addressed, medium
Provider-side encryption at rest leaves data readable by the provider – partly addressed, medium
Authenticated mail from abusers – pass is no evidence of legitimacy – partly addressed, low
Social whitelisting: compromised senders, unrevocable attestations, probing – partly addressed, low
Encrypted mail stored under the transport key forces key retention – partly addressed, low
Key escrow, provider-held keys or provider-served crypto code defeat E2EE – vulnerable, medium
Weak binding between signer certificate or key and the From address – partly addressed, low
Mailbox access as the root of web account recovery and authentication – partly addressed, low
Typo-squatted, expired or recycled domains and mailboxes capture accounts – partly addressed, low
Sender spoofing and business e-mail compromise – partly addressed, medium
96.10.7.4. Missing or incorrect checks¶
Acting on signature presence without verification – partly addressed, low
96.10.7.5. Deployment, configuration and credentials¶
Replay of phished or reused static passwords and public-address logins – partly addressed, medium
96.10.7.6. Information leaks and tracking¶
Remote content and personalised links reveal opens, device and location – partly addressed, low
TOTP secrets exposed in plaintext backups and to app developers – partly addressed, low
Addresses published on web pages harvested for spam and phishing – partly addressed, low
96.10.7.7. Misleading display and user decisions¶
Clients silently send mail unencrypted – partly addressed, low
Portal passwords sent over the same unprotected channel – partly addressed, medium
Signature spoofing via partial signing and MIME/CMS wrapping – partly addressed, low
Certificates do not convey sender role; look-alike name attacks – partly addressed, medium
Users send mail unencrypted by mistake because encryption state is unclear – partly addressed, medium
Users share encryption passwords and shared secrets in cleartext – partly addressed, medium
Key management too hard: end-to-end mail clients error-prone or unused – partly addressed, medium
Sender display deception: display names, look-alikes, RTLO and truncation – partly addressed, medium
Users misread or ignore signature and encryption indicators – partly addressed, low
Users skip, botch or cannot use key fingerprint verification – partly addressed, medium
96.10.8. Nobody yet (open problems)¶
No fix is known.
96.10.8.1. Implementation defects¶
Content concealed from spam filters (HTML/CSS, invisible chars, bad QR) – partly addressed, low
Privilege escalation through a mailing-list manager setuid wrapper – partly addressed, low
96.10.8.2. Cryptographic weaknesses¶
Compilers turn constant-time code into secret-dependent branches – partly addressed, low
Data-dependent memory access in Argon2d leaks the password – partly addressed, low
96.10.8.3. Protocol design gaps¶
Compelled or covert provider disclosure of keys and IP logs – partly addressed, medium
Keys published in DNS are only as trustworthy as the zone operator – vulnerable, medium
Domain-level authentication never identifies the individual sender – partly addressed, medium
Authenticated mail from abusers – pass is no evidence of legitimacy – partly addressed, low
Social whitelisting: compromised senders, unrevocable attestations, probing – partly addressed, low
Proof-of-work and sender-pays postage fail to price out spammers – partly addressed, low
IP blocklists evaded by bots, webmail accounts and shared networks – partly addressed, low
Adversarial evasion of content-based phishing and scanning classifiers – partly addressed, low
Client-side scanning undermines end-to-end encryption – partly addressed, low
Opportunistic E2EE trusts server-supplied keys without verification – partly addressed, medium
TOFU and key continuity miss first-contact and new-identity attacks – vulnerable, medium
Keyservers accept and serve unauthenticated key material and revocations – partly addressed, low
CA compromise, coercion and mis-issuance of certificates – vulnerable, medium
CA domain validation subverted via BGP and DNS attacks – partly addressed, medium
Colluding introducer forwards an attacker key in trusted introductions – partly addressed, low
PAKE trusted-setup dependence and offline attacks on stored secrets – partly addressed, low
Reverse-proxy phishing steals passwords, OTPs and session cookies past MFA – partly addressed, low
Unauthenticated decryption instructions redirect users to attacker sites – vulnerable, medium
96.10.8.4. Missing or incorrect checks¶
Divergent and non-compliant X.509 path validation across libraries – partly addressed, low
96.10.8.5. Deployment, configuration and credentials¶
Malicious packages under confusing names (typosquatting, dependency confusion) – partly addressed, low
CAs issue non-compliant or broken certificates – partly addressed, low
Private keys shared across devices or publicly known – partly addressed, low
96.10.8.6. Resource exhaustion and abuse¶
Mail bombing and mailbox flooding (incl. chain bombs) – partly addressed, medium
Resource exhaustion of SMTP servers – partly addressed, low
Short-lived BGP hijacks to send untraceable spam – partly addressed, low
TLS handshake computational denial of service – partly addressed, medium
Subscription and web-form e-mail bombing via unverified sign-ups – partly addressed, medium
SPF checks let outsiders induce queries from closed resolvers – vulnerable, low
Challenge-response filters send backscatter to forged senders – partly addressed, low
Resource exhaustion of a postage quota enforcer – partly addressed, low
96.10.8.7. Information leaks and tracking¶
Recipient address harvesting via VRFY/EXPN, RCPT replies and bounces – partly addressed, low
Keyserver queries and refreshes leak contacts and keyring contents – partly addressed, low
Secret handling defects: variable-time compares, lost zeroisation, spills – partly addressed, low
96.10.8.8. Misleading display and user decisions¶
Certificates do not convey sender role; look-alike name attacks – partly addressed, medium
96.4.3.16. Social whitelisting: compromised senders, unrevocable attestations, probing¶
Even a whitelist bound to authenticated senders inherits the weaknesses of trust between people. Garriss et al. name them for their friend-of-friend system RE: [garriss2006]: a compromised sender machine or stolen key lets a spammer send as a legitimate whitelisted user; attestations can only expire, not be revoked, so one granted by mistake keeps working towards other users until it lapses; a malicious recipient can probe the matching protocol to learn part of a sender’s contacts; and token checks against the sender’s server assume no man in the middle. Exchanging whitelist contents between users to widen acceptance also discloses who corresponds with whom. RE: limits these with expiry, private set matching and audit trails, but does not remove them.
Pepsi: Partly addressed. Impact: low.
Pepsi has no friend-of-friend attestations, so the attestation and protocol-probing weaknesses have no direct analogue, and whitelists are not exchanged between servers. The privacy part is handled by namespaces:
pepsi-whitelistenforces per-login ownership onadd,remove,importandlist, because the shared list reveals who the organisation corresponds with (pepsi-whitelist). Two residues remain. A correspondent whose account or machine is compromised is whitelisted like the real one; nothing in Pepsi can tell them apart, and only asignature_requiredrow narrows this to theft of the signing key. And most whitelist rows never expire: only the mailing-list rows that pepsi-stage-auto-whitelist learns from a subscription confirmation reply carry alast_seenand lapse afterLIST_MAX_IDLE_DAYSwithout an authenticated matching posting (and are then deleted bypepsi-queue gc); every other row, correspondents included, is removed by hand. A weak probing channel exists where a row lacksdkim_required: whether a payment request reaches the attacker’s envelope address after a message forgingFrom: xreveals whetherxis whitelisted for that recipient. No payment request is sent for a message whose SPF or DMARC verdict isfail(pepsi_common::autoreply), so the channel is closed for everyxat a domain that publishes a DMARC record or an SPF record ending in-all, and stays open for domains that publish neither (a~allrecord yieldssoftfail, which is still answered). Expiring rows that have not matched for a long time would bound stale trust only at the cost of holding quiet correspondents at the gate again, and a user can remove a row at any time. What remains is therefore the user’s housekeeping and the open problem of a compromised correspondent; nothing further is left for Pepsi’s code.