Skip to content
Crypto Disclosed report Advanced CVE-2021-22947

CVE-2021-22947: STARTTLS protocol injection via MITM

A man-in-the-middle could inject cleartext responses into a STARTTLS connection by pipelining them with the STARTTLS response, causing the client to accept forged data as if it were encrypted. This allowed forging mailbox content for IMAP and POP3, and sent mail content for SMTP.

monnerat Follow

Originally disclosed on HackerOne

Medium 5.3 View original
  • Triaged in 8 hours
  • Fixed in 14 days
  • Paid in 14 days
  • Disclosed after 15 days

Summary:

A man-in-the-middle can inject cleartext forged responses to future encrypted commands by pipelining them to the STARTTLS response.

Steps To Reproduce:

Use the attached test case within the curl test system. It is based on IMAP FETCH with explicit TLS. Upon test failure, the downloaded file contains "You've been hacked!" rather than the requested mail.

Impact

Mailbox content forgery (IMAP, POP3). Sent mail content forgery (SMTP).

The original report as published on HackerOne, by monnerat. 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

Impact

A man-in-the-middle could forge mailbox content for IMAP and POP3, and sent mail content for SMTP.

What the attacker needed

Man-in-the-middle position; STARTTLS used by client

How it was found

  1. Use the attached test case within the curl test system, based on IMAP FETCH with explicit TLS.
  2. Observe that upon test failure, the downloaded file contains forged content rather than the requested mail.

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.

STARTTLS is a way to upgrade a plain-text email connection to an encrypted one. An attacker sitting between the client and server could sneak in fake replies before the encryption started, so the client treated them as if they came from the secure session. This let the attacker fake emails or mailbox contents.

What is Crypto?

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

More by monnerat

View all

5 more disclosed reports, best first.

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.