CVE-2018-16840
Description
A heap use-after-free vulnerability in curl 7.59.0 through 7.61.1 can cause crashes or potential code execution when closing an easy handle.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A heap use-after-free vulnerability in curl 7.59.0 through 7.61.1 can cause crashes or potential code execution when closing an easy handle.
Vulnerability
A heap use-after-free flaw exists in libcurl versions 7.59.0 through 7.61.1, inclusive [1][2]. The bug resides in the Curl_close() function when closing and cleaning up an 'easy' handle. The library code first frees a struct without nullifying the pointer and may subsequently write to a field within that already freed struct, leading to undefined behavior [2][3].
Exploitation
An attacker can trigger the vulnerability remotely by causing the application to close a crafted easy handle, for example through a specially crafted sequence of curl_easy_* calls [1][2]. No special authentication or user interaction beyond normal curl usage is required. The vulnerable code path is reachable when curl_easy_perform() is used, which internally creates and cleans up a multi handle [3].
Impact
Successful exploitation can result in a denial of service (application crash) or, potentially, arbitrary code execution [1][2]. The impact depends on heap layout and the ability to control the freed memory. The CVSS score is low, reflecting the difficulty of reliable exploitation [2].
Mitigation
Upgrade to curl version 7.62.0 or later, which was released on October 31, 2018, and includes the fix [2]. The patch can also be applied manually (commit 81d135d67155c5295b1033679c606165d4e28f3f) [2][3]. Users of affected distributions like Ubuntu should update to curl packages [1][4]. No workaround is available if upgrading is not possible.
AI Insight generated on May 24, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
16- osv-coords14 versionspkg:rpm/opensuse/curl&distro=openSUSE%20Tumbleweedpkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Desktop%2012%20SP3pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Desktop%2012%20SP4pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%2011%20SP4pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP4pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2011%20SP4pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP3pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP4pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2011%20SP4pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP3pkg:rpm/suse/curl&distro=SUSE%20Linux%20Enterprise%20Software%20Development%20Kit%2012%20SP4pkg:rpm/suse/curl-openssl1&distro=SUSE%20Linux%20Enterprise%20Server%2011-SECURITY
< 7.79.1-1.1+ 13 more
- (no CPE)range: < 7.79.1-1.1
- (no CPE)range: < 7.37.0-37.31.1
- (no CPE)range: < 7.60.0-4.3.1
- (no CPE)range: < 7.60.0-3.14.3
- (no CPE)range: < 7.37.0-70.38.1
- (no CPE)range: < 7.37.0-37.31.1
- (no CPE)range: < 7.60.0-4.3.1
- (no CPE)range: < 7.37.0-70.38.1
- (no CPE)range: < 7.37.0-37.31.1
- (no CPE)range: < 7.60.0-4.3.1
- (no CPE)range: < 7.37.0-70.38.1
- (no CPE)range: < 7.37.0-37.31.1
- (no CPE)range: < 7.60.0-4.3.1
- (no CPE)range: < 7.37.0-70.38.1
- The Curl Project/curlv5Range: from 7.59.0 to 7.61.1
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
6- security.gentoo.org/glsa/201903-03mitrevendor-advisoryx_refsource_GENTOO
- usn.ubuntu.com/3805-1/mitrevendor-advisoryx_refsource_UBUNTU
- www.securitytracker.com/id/1042013mitrevdb-entryx_refsource_SECTRACK
- bugzilla.redhat.com/show_bug.cgimitrex_refsource_CONFIRM
- curl.haxx.se/docs/CVE-2018-16840.htmlmitrex_refsource_MISC
- github.com/curl/curl/commit/81d135d67155c5295b1033679c606165d4e28f3fmitrex_refsource_CONFIRM
News mentions
0No linked articles in our index yet.