Dead.Letter (CVE-2026-45185) – How XBOW found an unauthenticated RCE on Exim
A use-after-free in Exim's GnuTLS TLS handling lets a remote, unauthenticated attacker write a single newline byte into a freed transfer buffer during a BDAT chunk, corrupting allocator metadata. The write-up claims this one-byte primitive can be escalated to remote code execution.
xbow.com
Published on xbow.com
XBOW discovered CVE-2026-45185, a critical unauthenticated RCE in Exim, and used the disclosure window to test how far human and autonomous exploit development could go.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely tls_close() frees the TLS transfer buffer and restores only the top-level receive callbacks, leaving the BDAT lower-layer callbacks pointing at tls_ungetc, which then writes into the freed buffer.
Impact
An unauthenticated remote attacker could corrupt allocator metadata and, per the write-up, escalate the one-byte write to remote code execution; triggering requires almost no special server configuration.
What the attacker needed
Remote, unauthenticated SMTP access; server uses GnuTLS for TLS; attacker controls TLS shutdown timing
How it was found
- Open a plaintext SMTP session and issue STARTTLS to begin a GnuTLS-handled TLS connection.
- Begin a BDAT chunk so the BDAT wrappers are pushed and the TLS callbacks are saved in the lower layer.
- Close the TLS layer mid-chunk so the transfer buffer is freed while the BDAT loop keeps running.
- Continue sending body bytes in cleartext so the loop reaches the end-of-data case with a missing line ending.
- The end-of-data repair calls ungetc through the stale lower-layer callback, writing one byte into the freed buffer.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Exim is a mail server program. When a mail client switches the connection to encrypted mode (TLS), Exim keeps a temporary buffer of decrypted bytes. If the client closes the encrypted connection at an awkward moment while still sending message data, Exim frees that buffer but a leftover code path still writes one character into it. Writing into memory that has already been handed back is called a use-after-free, and it can let an attacker bend the program's memory bookkeeping to their will.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.