Skip to content
Crypto Disclosed report Intermediate CVE-2021-22946

CVE-2021-22946: Protocol downgrade required TLS bypassed

In curl, the --ssl-reqd option was silently ignored for IMAP and POP3 if the capability command failed, and for FTP a non-standard 230 response in the greeting forced the connection to continue unencrypted. An attacker in a man-in-the-middle position could then sniff or modify the unencrypted data.

monnerat Follow

Originally disclosed on HackerOne

Medium 6.5 View original
  • Triaged in 5 hours
  • Fixed in 14 days
  • Paid in 14 days
  • Disclosed after 16 days

Summary:

In imap and pop3, --ssl-reqd is silently ignored if the capability command failed. In ftp, a non-standard 230 response (preauthentication?) in the greeter message forces curl to continue unencrypted, even if TLS has been required.

Steps To Reproduce:

Use a parameterizable test server to fail capability command for imap (CAPABILITY reply: A001 BAD Not implemented) and pop3 (CAPA reply: -ERR Not implemented) and to send response code 230 in FTP server greeting message.

  1. curl --ssl-reqd imap://server/...
  2. curl --ssl-reqd pop3://server/...
  3. curl --ssl-reqd --ftp-ssl-control ftp://server/...

These 3 commands are successsful, but network sniffing shows that TLS is never negotiated.

Impact

A MitM can silently deny mandatory TLS negotiation and thus sniff and/or update unencrypted transferred data.

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

Root cause

Likely, curl treated a failed capability command or an unexpected FTP greeting response as a reason to skip the required TLS negotiation instead of aborting the connection.

Impact

A man-in-the-middle could silently prevent mandatory TLS negotiation and then sniff or modify the unencrypted data.

What the attacker needed

Attacker in man-in-the-middle position; server sends crafted capability or greeting response

How it was found

  1. Set up a test server that replies to the IMAP CAPABILITY command with a BAD response.
  2. Run curl with --ssl-reqd against the IMAP server.
  3. Set up a test server that replies to the POP3 CAPA command with an error.
  4. Run curl with --ssl-reqd against the POP3 server.
  5. Set up an FTP server that sends a 230 response in its greeting.
  6. Run curl with --ssl-reqd and --ftp-ssl-control against the FTP server.

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.

curl is a tool for transferring data. The --ssl-reqd option tells it to refuse to continue unless the connection is encrypted with TLS. This report shows that in some situations curl ignored that instruction and carried on without encryption, so someone watching the network could read or change the data.

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.