---
id: 10165
canonical_url: "https://phying.com/item/10165"
title: "MbedTLS Security Audit"
type: "vulnerability"
cve: null
cvss: null
severity: "unknown"
vendor: null
product: null
affected_versions: null
source_domain: "blog.quarkslab.com"
source_url: "https://blog.quarkslab.com/mbedtls-security-audit.html"
published_at: "2026-10-19T22:00:00Z"
snapshot_at: "2026-10-27T14:57:21Z"
archived_by: "Phying News (https://phying.com/item/10165)"
lang: "en"
---

# MbedTLS Security Audit

*Published on: 2026-10-19 · Source: [blog.quarkslab.com](https://blog.quarkslab.com/mbedtls-security-audit.html)*

Posted Tue 20 October 2026   
Authors [Julio Loayza Meneses](https://blog.quarkslab.com/author/julio-loayza-meneses.html), [Angèle Bossuat](https://blog.quarkslab.com/author/angele-bossuat.html)   
Category [ Cryptography ](https://blog.quarkslab.com/category/cryptography.html)   
Tags [audit](https://blog.quarkslab.com/tag/audit.html), [OSTIF](https://blog.quarkslab.com/tag/ostif.html), [TLS](https://blog.quarkslab.com/tag/tls.html), [cryptography](https://blog.quarkslab.com/tag/cryptography.html), [vulnerability](https://blog.quarkslab.com/tag/vulnerability.html), [mbedtls](https://blog.quarkslab.com/tag/mbedtls.html), [software](https://blog.quarkslab.com/tag/software.html), [2026](https://blog.quarkslab.com/tag/2026.html)

* * *

At the request of the [Open Source Technology Improvement Fund](https://ostif.org/) (OSTIF), Quarkslab performed a security audit of [mbedTLS](https://www.trustedfirmware.org/projects/mbed-tls/), evaluating the security of the changes in version 4.0.

* * *

# Introduction

[Mbed TLS](https://www.trustedfirmware.org/projects/mbed-tls/) is a widely deployed open-source TLS, DTLS, and X.509 library maintained by Trusted Firmware, targeting constrained and embedded environments. It is used as the cryptographic backbone of products across the IoT, automotive, and industrial sectors, and forms the TLS layer for projects such as the Trusted Firmware family.

Version 4.0 represents the most significant architectural change in the project's history. The cryptographic layer has been extracted into a standalone library, TF-PSA-Crypto, which implements the [PSA Cryptography API v1.2](https://arm-software.github.io/psa-api/crypto/1.2/) as specified by Arm. The Mbed TLS repository now consumes TF-PSA-Crypto as a submodule, and the configuration space has been split across two header files: `mbedtls_config.h` for the TLS and X.509 options, and `psa/crypto_config.h` for the cryptographic primitives. All RNG callbacks have been removed in favor of a mandatory call to `psa_crypto_init()` before any operation.

The Open Source Technology Improvement Fund (OSTIF) commissioned Quarkslab to perform a security audit of this new architecture. 

# Scope

The primary objectives of this audit are:

  * _Architectural transition review._ Assess the security implications of the Mbed TLS 3.x to 4.0 split, focusing on the trust boundary between the TLS layer and TF-PSA-Crypto, the correctness of the PSA API integration, and whether the removal of the legacy crypto paths introduces new attack surface.

  * _PSA API usage correctness._ Verify that key attributes (usage flags, permitted algorithms, lifetimes) are correctly set and enforced throughout the TLS and X.509 code paths, and that the mandatory `psa_crypto_init()` dependency is properly documented and enforced.

  * _Memory safety._ Identify memory corruption vulnerabilities in the SSL/DTLS context management (in particular, session serialization and resumption), the X.509 parsing subsystem, and the PSA key store.

  * _Default configuration posture._ Review the security of the default build configuration, including enabled cipher suites, protocol versions, key exchange algorithms, and compile-time options that may expose users to risk without explicit opt-in.

  * _Protocol compliance._ Identify deviations from the TLS 1.2 (RFC 5246), TLS 1.3 (RFC 8446), and DTLS specifications that have security consequences.




The engagement covers:

  * _Mbed TLS_ at commit `0fe989b6b514192783c469039edd325fd0989806`.
  * _TF-PSA-Crypto_ (integrated submodule) at commit `29160dd877d29658279fd683b2ae57b320ddcf09`.



The complete technical report, including our findings and recommendations, is available in Quarkslab's [public reports repository](https://github.com/quarkslab/public-reports).

# Findings

The table below summarizes the findings of the audit. A total of 5 vulnerabilities were identified: 1 of high severity, 1 of low severity, and 3 informational ones.

ID | Title | Severity | Perimeter | HIGH-1 | CID Buffer Overflow in `mbedtls_ssl_context_load()` | High | `library/ssl_tls.c:5002`  
---|---|---|---  
LOW-4 | `mbedtls_pk_verify()` accepts BER-encoded signatures | Low | `tf-psa-crypto/extras/pk.c`  
INFO-2 | No Anti-Replay Protection for TLS 1.3 0-RTT Early Data | Info | `include/mbedtls/ssl.h:5166`  
INFO-3 | Mismatch in CMAC cipher support between the documentation and the implementation. | Info | TF-PSA-Crypto documentation  
INFO-5 | `compat.sh` DTLS 1.2 tests fail on the `mbedtls-test` Docker image due to IPv6 `localhost` resolution | Info | mbedtls-test Docker images, `compat.sh`  
  
> **Note:** All relevant findings have since been resolved. 

# Conclusion

The audit identified a few vulnerabilities with only two non-informational ones, and the auditors were overall very satisfied with the quality of the product in general, and this version's changes in particular.

The _high_ and _low_ vulnerabilities are related to a heap buffer overflow and potential signature malleability, respectively, with the second one being identified thanks to the integration of integration of Project Wycheproof test vectors into the test suite.

An informational finding documents the absence of any anti-replay protection for TLS 1.3 0-RTT early data, a known limitation that is currently not surfaced in the public-facing documentation in a way that prevents inadvertent misuse. Auditors have proposed improvements to the existing fuzzing harnesses and corpora, along with an integration of the #anv test suite into the CI/CD pipeline.

We would like to thank the Mbed TLS maintainers for their responsiveness and collaboration throughout the audit process, as well as the OSTIF team for their continuous support.

Further details can be found in our [report](https://github.com/quarkslab/public-reports/blob/main/Reports/26-05-2730-REP_v1.0-1.pdf).

# Further reading

  * [OSTIF blog post](https://ostif.org/mbed-tls-audit-complete/)



* * *

If you would like to learn more about our security audits and explore how we can help you, [get in touch with us](https://content.quarkslab.com/talk-to-our-experts-blog)!

---
> 📦 **Full-Text Markdown Snapshot** archived by [Phying News](https://phying.com/item/10165) · Original source: [blog.quarkslab.com](https://blog.quarkslab.com/mbedtls-security-audit.html)
