Use-After-Free Vulnerability in curl

curl Updated 02 Oct 2025

Summary

11/06/2021
N/A
Yes i
High
8.1

CVE-2021-22901: curl 7.75.0 through 7.76.1 suffers from a use-after-free vulnerability resulting in already freed memory being used when a TLS 1.3 session ticket arrives over a connection. Affects curl across 2 version ranges.

< 7.77.0-r0 < 7f4a9a9b2a49547eae24d2e19bc5c346e9026479

Fixed in 7.77.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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

curl is a command-line tool and library for transferring data with URLs. It supports various protocols, including HTTP, HTTPS, FTP, and more. The vulnerability affects versions 7.75.0 through 7.76.1 of curl. This vulnerability allows a malicious server to exploit a use-after-free vulnerability in the client, potentially leading to remote code execution. The vulnerability occurs when a TLS 1.3 session ticket arrives over a connection, and already freed memory is used. This can occur in rare circumstances and can be exploited by the server to execute arbitrary code on the client.

Vulnerability Detail

The use-after-free vulnerability in curl occurs when a TLS 1.3 session ticket arrives over a connection, and already freed memory is used. This can happen when libcurl sets up support for TLS 1.3 session tickets on a connection using OpenSSL. Pointers to the transfer in-memory object are stored for later retrieval when a session ticket arrives. However, if the connection is used by multiple transfers, the first transfer object might be freed before the new session is established, leading to accessing a freed memory buffer. This can result in remote code execution if the server can craft memory content in the correct place.

How To Fix

Minimum fixed version

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

There is no known workaround for this vulnerability. It is recommended to update curl to the fixed version as soon as possible.

Conclusion

The use-after-free vulnerability in curl can be exploited by a malicious server to potentially execute arbitrary code on the client. It is crucial to update curl to version 7.77.0-r0 or later to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for curl →

Share this vulnerability

FAQ

curl is a command-line tool and library for transferring data with URLs. It supports various protocols, including HTTP, HTTPS, FTP, and more.

Versions 7.75.0 through 7.76.1 of curl are affected by this vulnerability.

A malicious server can exploit this vulnerability by sending a TLS 1.3 session ticket over a connection, causing already freed memory to be used. This can potentially lead to remote code execution on the client.

Yes, a fix is available in version 7.77.0-r0 of curl. It is recommended to update to this version or later to mitigate the vulnerability.

There are no known workarounds for this vulnerability. Updating to the fixed version is the recommended solution.

Related vulnerabilities

Recent vulnerabilities recorded for curl.

How To Fix

Minimum fixed version

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