What’s Vulnerable › Vulnerabilities
CVE-2018-16840
- Severity: critical (CVSS 9.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 3.4% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2018-10-31 · updated 2026-06-17
- Weakness: CWE-416
Description
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.
Affected products
- Canonical Ubuntu Linux: 14.04, 16.04, 18.04, 18.10
- curl: from 7.59.0 before 7.62.0 — fixed in 7.62.0
How to fix
Upgrade to a fixed version: curl 7.62.0. Check the vendor advisory for mitigations.
References
- http://www.securitytracker.com/id/1042013
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16840
- https://curl.haxx.se/docs/CVE-2018-16840.html
- https://github.com/curl/curl/commit/81d135d67155c5295b1033679c606165d4e28f3f
- https://security.gentoo.org/glsa/201903-03
- https://usn.ubuntu.com/3805-1/
- http://www.securitytracker.com/id/1042013
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16840
- https://curl.haxx.se/docs/CVE-2018-16840.html
- https://github.com/curl/curl/commit/81d135d67155c5295b1033679c606165d4e28f3f
- https://security.gentoo.org/glsa/201903-03
- https://usn.ubuntu.com/3805-1/
Get alerted when CVE-2018-16840 or the next vulnerability affects your stack