Double Free Vulnerability in Mbed TLS

mbedtls Updated 02 Oct 2025

Summary

20/12/2021
N/A
Yes i
Critical
9.8

CVE-2021-44732: Mbed TLS before 3.0.1 has a double free in certain out-of-memory conditions, as demonstrated by an mbedtls_ssl_set_session() failure. Affects mbedtls across 5 version ranges.

< 2.16.12-r0 >= 3f8d78411a26e833db18d9fbde0e2f0baeda87f0, < 8b3f26a5ac38d4fdccbc5c5366229f3e01dafcc0 < 8b3f26a5ac38d4fdccbc5c5366229f3e01dafcc0 < cf4667126010c665341f9e50ef691b7ef8294188 < d65aeb37349ad1a50e0f6c9b694d4b5290d60e49

Fixed in 2.16.12-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

Mbed TLS is an open-source cryptographic library that provides secure communication protocols, such as SSL/TLS, for embedded systems. It is widely used in various applications, including IoT devices and network communication. The library is designed to be portable, efficient, and easy to use. However, a double free vulnerability has been discovered in Mbed TLS versions before 3.0.1.

Vulnerability Detail

The double free vulnerability in Mbed TLS occurs in certain out-of-memory conditions when the mbedtls_ssl_set_session() function fails. This vulnerability can be exploited by an attacker to cause a denial-of-service (DoS) condition or potentially execute arbitrary code. The double free vulnerability arises when the same memory address is freed twice, leading to memory corruption and potential security issues.

How To Fix

Minimum fixed version

2.16.12-r0

This is the first release that contains the fix.

sudo apk add --upgrade mbedtls

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 essential to apply the provided fix by upgrading to the patched version of Mbed TLS.

Conclusion

The double free vulnerability in Mbed TLS can lead to a denial-of-service condition or potential code execution. It is crucial to upgrade to the fixed version of Mbed TLS (3.0.1 or later) to mitigate the risk of exploitation. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for mbedtls →

Share this vulnerability

FAQ

Mbed TLS is an open-source cryptographic library used for implementing secure communication protocols, such as SSL/TLS, in embedded systems.

A double free vulnerability occurs when the same memory address is freed twice, leading to memory corruption and potential security issues.

This vulnerability can be exploited by an attacker to cause a denial-of-service (DoS) condition or potentially execute arbitrary code.

To fix this vulnerability, it is recommended to upgrade to Mbed TLS version 3.0.1 or later.

There is no known workaround for this vulnerability. It is essential to apply the provided fix by upgrading to the patched version of Mbed TLS.

Related vulnerabilities

Recent vulnerabilities recorded for mbedtls.

How To Fix

Minimum fixed version

2.16.12-r0

This is the first release that contains the fix.

sudo apk add --upgrade mbedtls

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