CVEfocus › CVE database › CVE-2018-16840

CVE-2018-16840

CVSS 4.3 MediumEPSS 3.4% (higher than 89% of CVEs)Published 2018-10-31Updated 2026-04-16Assigner: redhat

A heap use-after-free flaw was found in curl versions from 7.59.0 through 7.61.1 in the code related to closing an easy handle. When closing and cleaning up an 'easy' handle in the `Curl_close()` function, the library code first frees a struct (without nulling the pointer) and might then subsequently erroneously write to a struct field within that already freed struct.

CWE-416

What to do

Fixed builds are available from Alpine, Debian: see the table below for the fixed version per release.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

23Fixed
12Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 16.04curlNot affected
vulnerable_code_not_present
Debian 14curlFixed7.62.0-1DEBIAN-CVE-2018-16840
Debian 13curlFixed7.62.0-1DEBIAN-CVE-2018-16840
Debian 12curlFixed7.62.0-1DEBIAN-CVE-2018-16840
Red Hat Enterprise Linux 8curlNot affected
Red Hat Enterprise Linux 8libcurlNot affected
Red Hat Enterprise Linux 8libcurl-develNot affected
Red Hat Enterprise Linux 8libcurl-minimalNot affected
Red Hat Enterprise Linux 7curlNot affected
Red Hat Enterprise Linux 7libcurlNot affected
Red Hat Enterprise Linux 7libcurl-develNot affected
Red Hat Enterprise Linux 6curlNot affected
Red Hat Enterprise Linux 6libcurlNot affected
Red Hat Enterprise Linux 6libcurl-develNot affected
Red Hat Enterprise Linux 5curlNot affected
Alpine Linux 3.24curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.23curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.22curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.21curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.20curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.19curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.18curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.17curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.16curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.15curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.14curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.13curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.12curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.11curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.10curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.9curlFixed7.62.0-r0ALPINE-CVE-2018-16840
Alpine Linux 3.8curlFixed7.61.1-r1ALPINE-CVE-2018-16840
Alpine Linux 3.7curlFixed7.61.1-r1ALPINE-CVE-2018-16840
Alpine Linux 3.6curlFixed7.61.1-r1ALPINE-CVE-2018-16840
Alpine Linux 3.5curlFixed7.61.1-r1ALPINE-CVE-2018-16840

What the vendor says

As published in the CVE record by redhat, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.