CVE-2026-4873: connection reuse ignores TLS requirement
Libcurl's connection reuse logic for cleartext-upgrade mail protocols did not account for a later transfer's TLS requirement, so a transfer that demanded STARTTLS could reuse an already-open plaintext connection. This meant a transfer expected to be encrypted could instead travel in cleartext.
- Disclosed after 37 days
Libcurl connection reuse for cleartext-upgrade mail protocols does not include the later transfer's CURLOPT_USE_SSL. If a plaintext connection to one of these protocols is already open and reusable, a later transfer that explicitly requires STARTTLS can incorrectly reuse that plaintext connection.
This affects smtp://, pop3://, and imap://
Reproduction
Start the server:
python3 ./server.py --port 2525
Control:
curl -sv \
-u alice:pw \
--url 'imap://127.0.0.1:2525/Box/;MAILINDEX=1' \
--ssl-reqd
Reuse:
curl -sv \
-u alice:pw \
--url 'imap://127.0.0.1:2525/' \
-X NOOP \
--next \
-sv \
-u alice:pw \
--url 'imap://127.0.0.1:2525/Box/;MAILINDEX=1' \
--ssl-reqd
Impact
A later TLS-required mail transfer can be sent over a previously established plaintext connection, contrary to expectation.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the connection-reuse matching logic for cleartext-upgrade mail protocols did not compare the new transfer's TLS requirement against the security state of the cached connection.
Impact
A later TLS-required mail transfer could be sent over a previously established plaintext connection, contrary to expectation.
What the attacker needed
Plaintext connection already open and reusable
How it was found
- Start the test mail server on a local port.
- Run a control request that requires TLS to confirm the expected behaviour.
- Run a request that first opens a plaintext connection, then a second transfer that requires TLS.
- The second transfer may reuse the plaintext connection rather than upgrading.
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 report has not been written yet. The Original tab links to the source.
Some mail protocols start in plain text and then upgrade to an encrypted connection using a command called STARTTLS. A library that reuses existing connections must check that the old connection meets the new request's security needs. Here it did not, so a request that asked for encryption could quietly go over an unencrypted link.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.