CVE-2018-16840 Use after free in curl

Medium 4.3 Published Updated

A heap use-after-free in curl's easy handle cleanup allows attackers to potentially execute arbitrary code or cause a denial of service.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2018-16840?

CVE-2018-16840 is a medium-severity use after free vulnerability in Canonical Ubuntu Linux, published on 31 Oct 2018. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-416

Which versions are affected by CVE-2018-16840?

It affects 2 products.

Products include Canonical Ubuntu Linux, Haxx Curl.

How do I fix CVE-2018-16840?

Upgrade to a fixed version.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2018-16840 being exploited?

There is no known exploitation of CVE-2018-16840 in the wild and no public exploit code.

All Canonical Ubuntu Linux vulnerabilities

Sources

Also known as ALPINE-CVE-2018-16840, CLEANSTART-2026-IF41404, CURL-CVE-2018-16840, DEBIAN-CVE-2018-16840, GHSA-6vwf-m72q-cw8h.

Is CVE-2018-16840 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free