CVE-2021-22946
High · 7.5CVSS
7.5
EPSS
4.5%
Published
Sep 29, 2021
CISA due date
—
Cloudanix analysis
A common command-line tool for moving files and checking email could send private information without encryption even when users explicitly asked for a secure connection.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Library
- Class
- Information Disclosure
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The flaw allows a malicious IMAP, POP3 or FTP server to return a crafted but valid response that bypasses curl's TLS upgrade requirement when --ssl-reqd or CURLOPT_USE_SSL is set to CURLUSESSL_CONTROL or CURLUSESSL_ALL, causing curl to silently continue the session in plaintext.
Why it matters to the business
Credentials, emails or files transferred with curl may travel unencrypted, enabling network eavesdroppers to capture sensitive information and increasing breach or compliance risk.
How an attack unfolds
An attacker hosts a rogue IMAP/POP3/FTP server that responds to curl's STARTTLS or AUTH TLS request with a legitimate-looking reply that omits the expected upgrade; curl accepts the reply, skips TLS negotiation and proceeds with clear-text commands, exposing all subsequent traffic.
How to fix it
Upgrade curl to a build containing commit 8e82f2a04a238c54ba91e553e9a8452e6d405965 or a later release that enforces the TLS requirement correctly.
How to confirm the fix worked
Confirm the running curl binary reports a version built after the referenced commit; re-test affected protocols with --ssl-reqd while capturing traffic to verify TLS negotiation occurs.
Typical attack path
- Attacker deploys a malicious server answering on IMAP, POP3 or FTP ports
- Victim invokes curl with --ssl-reqd or equivalent libcurl option against the attacker-controlled server
- Server returns a crafted protocol response that satisfies curl's upgrade check without actually negotiating TLS
- curl continues the session in plaintext
- Attacker captures credentials, messages or files from the unencrypted stream
How to detect it
Search command-line logs, process execution records and network flow data for curl invocations that target IMAP, POP3 or FTP ports while requesting SSL; inspect packet captures for absence of TLS handshakes after such requests.
- curl.*--ssl-reqd.*(imap|pop3|ftp)://
- CURLOPT_USE_SSL.*CURLUSESSL_CONTROL.*without TLS
- STARTTLS.*response.*followed by plaintext LOGIN or RETR
What your security team should do
- Immediately update all curl installations to a fixed build
- Audit scripts, CI jobs and applications that use curl against IMAP, POP3 or FTP with SSL enforcement
- Add network monitoring rules to detect plaintext IMAP/POP3/FTP sessions originating from curl processes
The record
A user can tell curl >= 7.20.0 and <= 7.78.0 to require a successful upgrade to TLS when speaking to an IMAP, POP3 or FTP server (`--ssl-reqd` on the command line or`CURLOPT_USE_SSL` set to `CURLUSESSL_CONTROL` or `CURLUSESSL_ALL` withlibcurl). This requirement could be bypassed if the server would return a properly crafted but perfectly legitimate response.This flaw would then make curl silently continue its operations **withoutTLS** contrary to the instructions and expectations, exposing possibly sensitive data in clear text over the network.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Alpine:v3.11 | curl | 0 | 7.79.0-r0 |
| Alpine:v3.12 | curl | 0 | 7.79.0-r0 |
| Alpine:v3.13 | curl | 0 | 7.79.0-r0 |
| Alpine:v3.14 | curl | 0 | 7.79.0-r0 |
| Alpine:v3.15 | curl | 0 | 7.79.0-r0 |
| Alpine:v3.16 | curl | 0 | 7.79.0-r0 |
| Alpine:v3.17 | curl | 0 | 7.79.0-r0 |
| Alpine:v3.18 | curl | 0 | 7.79.0-r0 |
| Alpine:v3.19 | curl | 0 | 7.79.0-r0 |
| Alpine:v3.20 | curl | 0 | 7.79.0-r0 |
| Alpine:v3.21 | curl | 0 | 7.79.0-r0 |
| Alpine:v3.22 | curl | 0 | 7.79.0-r0 |
| Debian:10 | curl | 0 | 7.64.0-4+deb10u3 |
| Debian:11 | curl | 0 | 7.74.0-1.3+deb11u2 |
| Debian:12 | curl | 0 | 7.79.1-1 |
| Debian:13 | curl | 0 | 7.79.1-1 |
| Debian:14 | curl | 0 | 7.79.1-1 |
| Debian:9 | curl | 0 | 7.52.1-5+deb9u16 |
| Mageia:8 | curl | 0 | 7.74.0-1.4.mga8 |
| Red Hat:enterprise_linux:8::baseos | curl | 0 | 0:7.61.1-18.el8_4.2 |
| Red Hat:enterprise_linux:8::baseos | curl-debuginfo | 0 | 0:7.61.1-18.el8_4.2 |
| Red Hat:enterprise_linux:8::baseos | curl-debugsource | 0 | 0:7.61.1-18.el8_4.2 |
| Red Hat:enterprise_linux:8::baseos | curl-minimal-debuginfo | 0 | 0:7.61.1-18.el8_4.2 |
| Red Hat:enterprise_linux:8::baseos | libcurl | 0 | 0:7.61.1-18.el8_4.2 |
| Red Hat:enterprise_linux:8::baseos | libcurl-debuginfo | 0 | 0:7.61.1-18.el8_4.2 |
| Red Hat:enterprise_linux:8::baseos | libcurl-devel | 0 | 0:7.61.1-18.el8_4.2 |
| Red Hat:enterprise_linux:8::baseos | libcurl-minimal | 0 | 0:7.61.1-18.el8_4.2 |
| Red Hat:enterprise_linux:8::baseos | libcurl-minimal-debuginfo | 0 | 0:7.61.1-18.el8_4.2 |
| Red Hat:rhel_dotnet:3.1::el7 | rh-dotnet31-curl | 0 | 0:7.61.1-22.el7_9 |
| Red Hat:rhel_dotnet:3.1::el7 | rh-dotnet31-curl-debuginfo | 0 | 0:7.61.1-22.el7_9 |
| Red Hat:rhel_dotnet:3.1::el7 | rh-dotnet31-libcurl | 0 | 0:7.61.1-22.el7_9 |
| Red Hat:rhel_dotnet:3.1::el7 | rh-dotnet31-libcurl-devel | 0 | 0:7.61.1-22.el7_9 |
| Red Hat:rhel_eus:8.2::baseos | curl | 0 | 0:7.61.1-12.el8_2.4 |
| Red Hat:rhel_eus:8.2::baseos | curl-debuginfo | 0 | 0:7.61.1-12.el8_2.4 |
| Red Hat:rhel_eus:8.2::baseos | curl-debugsource | 0 | 0:7.61.1-12.el8_2.4 |
| Red Hat:rhel_eus:8.2::baseos | curl-minimal-debuginfo | 0 | 0:7.61.1-12.el8_2.4 |
| Red Hat:rhel_eus:8.2::baseos | libcurl | 0 | 0:7.61.1-12.el8_2.4 |
| Red Hat:rhel_eus:8.2::baseos | libcurl-debuginfo | 0 | 0:7.61.1-12.el8_2.4 |
| Red Hat:rhel_eus:8.2::baseos | libcurl-devel | 0 | 0:7.61.1-12.el8_2.4 |
| Red Hat:rhel_eus:8.2::baseos | libcurl-minimal | 0 | 0:7.61.1-12.el8_2.4 |
| Red Hat:rhel_eus:8.2::baseos | libcurl-minimal-debuginfo | 0 | 0:7.61.1-12.el8_2.4 |
| Rocky Linux:8 | curl | 0 | 0:7.61.1-18.el8_4.2 |
| SUSE:Enterprise Storage 6 | curl | 0 | 7.60.0-25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | curl | 0 | 7.60.0-25.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | curl | 0 | 7.60.0-25.1 |
| SUSE:Linux Enterprise High Performance Computing 15-ESPOS | curl | 0 | 7.60.0-25.1 |
| SUSE:Linux Enterprise High Performance Computing 15-LTSS | curl | 0 | 7.60.0-25.1 |
| SUSE:Linux Enterprise Micro 5.0 | curl | 0 | 7.66.0-4.27.1 |
| SUSE:Linux Enterprise Micro 5.1 | curl | 0 | 7.66.0-4.27.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP2 | curl | 0 | 7.66.0-4.27.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP3 | curl | 0 | 7.66.0-4.27.1 |
| SUSE:Linux Enterprise Server 11-SECURITY | curl-openssl1 | 0 | 7.37.0-70.74.1 |
| SUSE:Linux Enterprise Server 12 SP4-LTSS | curl | 0 | 7.60.0-4.30.1 |
| SUSE:Linux Enterprise Server 12 SP5 | curl | 0 | 7.60.0-11.28.1 |
| SUSE:Linux Enterprise Server 15 SP1-BCL | curl | 0 | 7.60.0-25.1 |
| SUSE:Linux Enterprise Server 15 SP1-LTSS | curl | 0 | 7.60.0-25.1 |
| SUSE:Linux Enterprise Server 15-LTSS | curl | 0 | 7.60.0-25.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | curl | 0 | 7.60.0-4.30.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | curl | 0 | 7.60.0-11.28.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 | curl | 0 | 7.60.0-25.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | curl | 0 | 7.60.0-25.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP5 | curl | 0 | 7.60.0-11.28.1 |
| SUSE:OpenStack Cloud 9 | curl | 0 | 7.60.0-4.30.1 |
| SUSE:OpenStack Cloud Crowbar 9 | curl | 0 | 7.60.0-4.30.1 |
| Ubuntu:18.04:LTS | curl | 0 | 7.58.0-2ubuntu3.15 |
| Ubuntu:20.04:LTS | curl | 0 | 7.68.0-1ubuntu2.7 |
| Ubuntu:22.04:LTS | curl | 0 | 7.74.0-1.3ubuntu2 |
| Ubuntu:Pro:14.04:LTS | curl | 0 | 7.35.0-1ubuntu2.20+esm8 |
| Ubuntu:Pro:16.04:LTS | curl | 0 | 7.47.0-1ubuntu2.19+esm1 |
| openSUSE:Leap 15.2 | curl | 0 | 7.66.0-lp152.3.24.1 |
| openSUSE:Leap 15.2 | curl-mini | 0 | 7.66.0-lp152.3.24.1 |
| openSUSE:Leap 15.3 | curl | 0 | 7.66.0-4.27.1 |
| openSUSE:Tumbleweed | curl | 0 | 7.79.1-1.1 |
Related vulnerabilities
- CVE-2021-22926 libcurl-using applications can ask for a specific client certificate to be used in a… Also affects curl
- CVE-2021-22898 curl 7.7 through 7.76.1 suffers from an information disclosure when the `-t` command line… Also affects curl
- CVE-2020-8284 A malicious server can use the FTP PASV response to trick curl 7.73.0 and earlier into… Also affects curl
- CVE-2019-5481 Double-free vulnerability in the FTP-kerberos code in cURL 7.52.0 to 7.65.3. Also affects curl
- CVE-2019-5482 Heap buffer overflow in the TFTP protocol handler in cURL 7.19.4 to 7.65.3. Also affects curl
- CVE-2019-5436 A heap buffer overflow in the TFTP receiving code allows for DoS or arbitrary code… Also affects curl
- CVE-2017-8817 The FTP wildcard function in curl and libcurl before 7.57.0 allows remote attackers to… Also affects curl
- CVE-2017-8816 The NTLM authentication feature in curl and libcurl before 7.57.0 on 32-bit platforms… Also affects curl