# CVE-2025-49601: In MbedTLS 3.3.0 before 3.6.4, mbedtls_lms_import_public_key does not check that the input buffer is at least 4 bytes before reading a 32-bi


- **Severity:** Medium 4.8 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 4 Jul 2025
- **Updated:** 8 Jul 2025
- **Also known as:** ALPINE-CVE-2025-49601, DEBIAN-CVE-2025-49601, GHSA-h9v9-9rwj-pmq9, UBUNTU-CVE-2025-49601

## What is CVE-2025-49601?

CVE-2025-49601 is a medium-severity vulnerability in mbedtls, published on 4 Jul 2025. 

### Official description

In MbedTLS 3.3.0 before 3.6.4, mbedtls_lms_import_public_key does not check that the input buffer is at least 4 bytes before reading a 32-bit field, allowing a possible out-of-bounds read on truncated input. Specifically, an out-of-bounds read in mbedtls_lms_import_public_key allows context-dependent attackers to trigger a crash or limited adjacent-memory disclosure by supplying a truncated LMS (Leighton-Micali Signature) public-key buffer under four bytes. An LMS public key starts with a 4-byte type indicator. The function mbedtls_lms_import_public_key reads this type indicator before validating the size of its input.

Weakness: CWE-125 (Out-of-bounds Read)

## Which versions are affected by CVE-2025-49601?

It affects 1 product.


Products: Trustedfirmware Mbed Tls.

## How do I fix CVE-2025-49601?

Upgrade to a fixed version.

## Is CVE-2025-49601 being exploited?

There is no known exploitation of CVE-2025-49601 in the wild and no public exploit code.

## Other vulnerabilities in mbedtls

- [CVE-2026-34875](https://insights.sbomify.com/CVE-2026-34875/): Memory corruption in n/a (critical 9.8)
- [CVE-2024-49195](https://insights.sbomify.com/CVE-2024-49195/): Memory corruption in n/a (critical 9.8)
- [CVE-2024-45158](https://insights.sbomify.com/CVE-2024-45158/): Memory corruption in n/a (critical 9.8)
- [CVE-2024-45159](https://insights.sbomify.com/CVE-2024-45159/): Auth bypass in n/a (critical 9.8)
- [CVE-2023-45199](https://insights.sbomify.com/CVE-2023-45199/): Mbed TLS 3.2.x through 3.4.x before 3.5 has a Buffer Overflow that can lead to remote Code execution. (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-49601 and fix it if it is affected.

What it is: CVE-2025-49601 is a medium-severity vulnerability in mbedtls, published on 4 Jul 2025. 
Exploitation: There is no known exploitation of CVE-2025-49601 in the wild and no public exploit code.

Affected product: mbedtls. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-49601/ (Markdown: https://insights.sbomify.com/CVE-2025-49601/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-49601
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-49601
- OSV: https://osv.dev/vulnerability/CVE-2025-49601

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-49601/
Summaries are generated and may contain mistakes; the official description above is the record.
