Libvirt: negative g_new0 length can lead to unbounded memory allocation
A flaw was found in the RPC library APIs of libvirt. The RPC server deserialization code allocates memory for arrays before the non-negative length check is performed by the C API entry points. Passing a negative length to the g_new0 function results in a crash due to the negative length being treated as a huge positive number. This flaw allows a local, unprivileged user to perform a denial of service attack by causing the libvirt daemon to crash.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2024-2494
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 2 Nov 2026, 20:00 UTC · Revision 1
Source evidence
Libvirt: negative g_new0 length can lead to unbounded memory allocation
core-osv · Original sourcePublished 21 Mar 2024, 13:39 UTC
A flaw was found in the RPC library APIs of libvirt. The RPC server deserialization code allocates memory for arrays before the non-negative length check is performed by the C API entry points. Passing a negative length to the g_new0 function results in a crash due to the negative length being treated as a huge positive number. This flaw allows a local, unprivileged user to perform a denial of service attack by causing the libvirt daemon to crash.
osv:CVE-2024-2494
Complete source record
{
"id": "04df65a53bc6856963b4a815d5dc224642db2c820ce695d2cc02fe2aecb0156e",
"url": "https://osv.dev/vulnerability/CVE-2024-2494",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Libvirt: negative g_new0 length can lead to unbounded memory allocation",
"summary": "A flaw was found in the RPC library APIs of libvirt. The RPC server deserialization code allocates memory for arrays before the non-negative length check is performed by the C API entry points. Passing a negative length to the g_new0 function results in a crash due to the negative length being treated as a huge positive number. This flaw allows a local, unprivileged user to perform a denial of service attack by causing the libvirt daemon to crash.",
"evidence": "osv:CVE-2024-2494",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2024-2494",
"aliases": [
"CVE-2024-2494"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://gitlab.com/libvirt/libvirt",
"type": "GIT",
"events": [
{
"introduced": "21b0099b79eccb5e89cea037db6d58480ae02553"
},
{
"fixed": "8cb0572d7a791d7254274191201fe9fb4ca8c27f"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "9.0.0"
},
{
"fixed": "9.7.0"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
}
]
}
}
],
"versions": [
"v9.7.0-rc2",
"v9.7.0-rc1",
"v9.6.0",
"v9.6.0-rc2",
"v9.6.0-rc1",
"CVE-2023-3750",
"v9.5.0",
"v9.5.0-rc2",
"v9.5.0-rc1",
"v9.4.0",
"v9.4.0-rc2",
"v9.4.0-rc1",
"v9.3.0",
"v9.3.0-rc2",
"v9.3.0-rc1",
"v9.2.0",
"v9.2.0-rc2",
"v9.2.0-rc1",
"v9.1.0",
"v9.1.0-rc2",
"v9.1.0-rc1",
"v9.0.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-2494.json"
}
}
],
"modified": "2026-10-28T02:30:23.177216273Z",
"provider": "osv",
"references": [
"https://access.redhat.com/downloads/content/package-browser/",
"https://lists.debian.org/debian-lts-announce/2024/04/msg00000.html",
"https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/BKRQXPLPC6B7FLHJXSBQYW7HNDEBW6RJ/",
"https://access.redhat.com/errata/RHSA-2024:2560",
"https://access.redhat.com/errata/RHSA-2024:3253",
"https://access.redhat.com/security/cve/CVE-2024-2494",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/2xxx/CVE-2024-2494.json",
"https://nvd.nist.gov/vuln/detail/CVE-2024-2494",
"https://security.netapp.com/advisory/ntap-20240517-0009/",
"https://bugzilla.redhat.com/show_bug.cgi?id=2270115",
"https://gitlab.com/libvirt/libvirt/"
],
"provider_metadata": {
"cwe_ids": [
"CWE-789"
],
"cna_assigner": "redhat",
"unresolved_ranges": [
{
"extracted_events": [
{
"range": [
{
"fixed": "8100020240409073027.489197e6"
},
{
"fixed": "8100020240409073027.489197e6"
},
{
"fixed": "0:10.0.0-6.2.el9_4"
}
],
"source": "AFFECTED_FIELD",
"strategy": "InverseAffectedRanges"
}
]
}
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/2xxx/CVE-2024-2494.json"
}
},
"related_cves": [
{
"value": "CVE-2024-2494",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 489528,
"published_at": "2024-03-21T13:39:08.847+00:00"
}