libcurl did not check the server certificate of TLS connections done to a host specified as an IP address, or when explicitly asked to use SSLv3.
This flaw only exists when libcurl is built to use mbedTLS or PolarSSL as the TLS backend.
The documentation for mbedTLS and PolarSSL (wrongly) says that the API
function ssl_set_hostname()
is used only for setting the name for the TLS
extension SNI. The set string is however even more importantly used by the
libraries to verify the server certificate, and if no "hostname" is set it
just skips the check and successfully continue with the handshake.
libcurl would wrongly avoid using the function when the specified hostname was given as an IP address or when SSLv3 is used, as SNI is not supposed to be used then. This then leads to that all uses of TLS oriented protocols (HTTPS, FTPS, IMAPS, POPS3, SMTPS, etc) allows connections to servers with unverified server certificates as long as they are specified as IP addresses or using SSLv3.
By tricking a libcurl-using client to use a URL with a host specified as IP address only, an application could be made to connect to an impostor server or Man In The Middle host without noticing.
Note: PolarSSL is the old name and releases of the library that nowadays is known and released under the name mbedTLS.
{ "www": "https://curl.se/docs/CVE-2016-3739.html", "severity": "High", "package": "curl", "URL": "https://curl.se/docs/CVE-2016-3739.json", "last_affected": "7.48.0", "CWE": { "desc": "Improper Validation of Certificate with Host Mismatch", "id": "CWE-297" }, "affects": "both" }