Debian DLA-2500-1 : curl security update

high Nessus Plugin ID 144497

Synopsis

The remote Debian host is missing a security update.

Description

Several vulnerabilities were discovered in curl, a command line tool for transferring data with URL syntax and an easy-to-use client-side URL transfer library.

CVE-2020-8284

When curl performs a passive FTP transfer, it first tries the EPSV command and if that is not supported, it falls back to using PASV.
Passive mode is what curl uses by default. A server response to a PASV command includes the (IPv4) address and port number for the client to connect back to in order to perform the actual data transfer. This is how the FTP protocol is designed to work. A malicious server can use the PASV response to trick curl into connecting back to a given IP address and port, and this way potentially make curl extract information about services that are otherwise private and not disclosed, for example doing port scanning and service banner extractions.

The IP address part of the response is now ignored by default, by making CURLOPT_FTP_SKIP_PASV_IP default to 1L instead of previously being 0L. This has the minor drawback that a small fraction of use cases might break, when a server truly needs the client to connect back to a different IP address than what the control connection uses and for those CURLOPT_FTP_SKIP_PASV_IP can be set to 0L. The same goes for the command line tool, which then might need

--no-ftp-skip-pasv-ip set to prevent curl from ignoring the address in the server response.

CVE-2020-8285

libcurl offers a wildcard matching functionality, which allows a callback (set with CURLOPT_CHUNK_BGN_FUNCTION) to return information back to libcurl on how to handle a specific entry in a directory when libcurl iterates over a list of all available entries. When this callback returns CURL_CHUNK_BGN_FUNC_SKIP, to tell libcurl to not deal with that file, the internal function in libcurl then calls itself recursively to handle the next directory entry. If there's a sufficient amount of file entries and if the callback returns 'skip' enough number of times, libcurl runs out of stack space. The exact amount will of course vary with platforms, compilers and other environmental factors. The content of the remote directory is not kept on the stack, so it seems hard for the attacker to control exactly what data that overwrites the stack - however it remains a denial of service vector as a malicious user who controls a server that a libcurl-using application works with under these premises can trigger a crash.

The internal function is rewritten to instead and more appropriately use an ordinary loop instead of the recursive approach. This way, the stack use will remain the same no matter how many files that are skipped.

CVE-2020-8286

libcurl offers 'OCSP stapling' via the CURLOPT_SSL_VERIFYSTATUS option. When set, libcurl verifies the OCSP response that a server responds with as part of the TLS handshake. It then aborts the TLS negotiation if something is wrong with the response. The same feature can be enabled with --cert-status using the curl tool. As part of the OCSP response verification, a client should verify that the response is indeed set out for the correct certificate. This step was not performed by libcurl when built or told to use OpenSSL as TLS backend.
This flaw would allow an attacker, who perhaps could have breached a TLS server, to provide a fraudulent OCSP response that would appear fine, instead of the real one. Like if the original certificate actually has been revoked.

The OCSP response checker function now also verifies that the certificate id is the correct one.

For Debian 9 stretch, these problems have been fixed in version 7.52.1-5+deb9u13.

We recommend that you upgrade your curl packages.

For the detailed security status of curl please refer to its security tracker page at: https://security-tracker.debian.org/tracker/curl

NOTE: Tenable Network Security has extracted the preceding description block directly from the DLA security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.

Solution

Upgrade the affected packages.

See Also

https://lists.debian.org/debian-lts-announce/2020/12/msg00029.html

https://packages.debian.org/source/stretch/curl

https://security-tracker.debian.org/tracker/source-package/curl

Plugin Details

Severity: High

ID: 144497

File Name: debian_DLA-2500.nasl

Version: 1.6

Type: local

Agent: unix

Published: 12/21/2020

Updated: 1/31/2024

Supported Sensors: Frictionless Assessment Agent, Nessus Agent, Agentless Assessment, Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 4.4

CVSS v2

Risk Factor: Medium

Base Score: 5

Temporal Score: 3.9

Vector: CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N

CVSS Score Source: CVE-2020-8286

CVSS v3

Risk Factor: High

Base Score: 7.5

Temporal Score: 6.7

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Temporal Vector: CVSS:3.0/E:P/RL:O/RC:C

Vulnerability Information

CPE: p-cpe:/a:debian:debian_linux:curl, p-cpe:/a:debian:debian_linux:libcurl3, p-cpe:/a:debian:debian_linux:libcurl3-nss, cpe:/o:debian:debian_linux:9.0, p-cpe:/a:debian:debian_linux:libcurl4-gnutls-dev, p-cpe:/a:debian:debian_linux:libcurl3-dbg, p-cpe:/a:debian:debian_linux:libcurl3-gnutls, p-cpe:/a:debian:debian_linux:libcurl4-doc, p-cpe:/a:debian:debian_linux:libcurl4-nss-dev, p-cpe:/a:debian:debian_linux:libcurl4-openssl-dev

Required KB Items: Host/local_checks_enabled, Host/Debian/release, Host/Debian/dpkg-l

Exploit Available: true

Exploit Ease: Exploits are available

Patch Publication Date: 12/18/2020

Vulnerability Publication Date: 12/14/2020

Reference Information

CVE: CVE-2020-8284, CVE-2020-8285, CVE-2020-8286

IAVA: 2020-A-0581