CVE-2024-21825 Memory corruption in llama.cpp

High 8.8 Published Updated

A heap-based buffer overflow in llama.cpp allows attackers to execute arbitrary code via a specially crafted GGUF file.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2024-21825?

CVE-2024-21825 is a high-severity memory corruption vulnerability in llama.cpp, published on 26 Feb 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

A heap-based buffer overflow vulnerability exists in the GGUF library GGUF_TYPE_ARRAY/GGUF_TYPE_STRING parsing functionality of llama.cpp Commit 18c2e17. A specially crafted .gguf file can lead to code execution. An attacker can provide a malicious file to trigger this vulnerability.

Weakness: CWE-787, CWE-190

Which versions are affected by CVE-2024-21825?

It affects 1 product.

Products include Ggml Llama.cpp.

How do I fix CVE-2024-21825?

No fix has been published for CVE-2024-21825 yet. Limit exposure of the affected software until one is available.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2024-21825 being exploited?

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

Sources

Also known as GHSA-5998-89hj-xhfc.

Is CVE-2024-21825 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free