Skip to content
Crypto Disclosed report Advanced CVE-2026-4873

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.

bonaire Follow

Originally disclosed on HackerOne

  • 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:

Bash
python3 ./server.py --port 2525

Control:

Bash
curl -sv \
  -u alice:pw \
  --url 'imap://127.0.0.1:2525/Box/;MAILINDEX=1' \
  --ssl-reqd

Reuse:

Bash
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.

The original report as published on HackerOne, by bonaire. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Start the test mail server on a local port.
  2. Run a control request that requires TLS to confirm the expected behaviour.
  3. Run a request that first opens a plaintext connection, then a second transfer that requires TLS.
  4. 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.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.