Critical Heap Use-After-Free Vulnerability in Curl Package

curl Updated 02 Oct 2025

Summary

31/10/2018
N/A
Yes i
Critical
9.8

ALPINE-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. Affects curl versions < 7.62.0-r0. Fixed in 7.62.0-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Curl is a widely used command-line tool and library for transferring data with URLs. It supports various protocols including HTTP, HTTPS, FTP, and more, making it essential for web-related tasks. The library is known for its versatility and ease of use, but it is also susceptible to vulnerabilities that can compromise applications relying on it. This specific vulnerability affects multiple versions of Curl across various Alpine Linux distributions.

Vulnerability Detail

A heap use-after-free flaw was discovered in Curl versions from 7.59.0 through 7.61.1. This vulnerability arises in the Curl_close() function, where the library code frees a struct without nullifying the pointer. As a result, it may erroneously write to a field within the already freed struct, leading to potential memory corruption, crashes, or even arbitrary code execution. The severity of this vulnerability is underscored by its CVSS score of 9.8, indicating a critical risk to affected systems.

How To Fix

Minimum fixed version

7.62.0-r0

This is the first release that contains the fix.

sudo apk add --upgrade curl

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can avoid using the affected versions of Curl until they can upgrade to a patched version. Additionally, consider using alternative libraries for data transfer that do not have this vulnerability.

Conclusion

The heap use-after-free vulnerability in Curl poses a critical risk to applications using affected versions. It is essential for users to update to the patched version to mitigate potential security threats. Utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.

See every vulnerability recorded for curl →

Share this vulnerability

FAQ

A heap use-after-free vulnerability occurs when a program continues to use a pointer after the memory it points to has been freed. This can lead to unpredictable behavior, crashes, or security breaches.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. By uploading your manifest file, such as package-lock.json, you can check for vulnerabilities without needing to install any software.

Exploitation of this vulnerability can lead to memory corruption, application crashes, or even arbitrary code execution, which poses significant security risks to affected systems.

If immediate updates are not possible, consider using alternative libraries for data transfer or implementing strict memory management practices to reduce the risk of exploitation.

Detailed information about this vulnerability can be found in the CVE database and through security advisories related to Curl and Alpine Linux.

Related vulnerabilities

Recent vulnerabilities recorded for curl.

How To Fix

Minimum fixed version

7.62.0-r0

This is the first release that contains the fix.

sudo apk add --upgrade curl

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback