# CVE-2024-2494: Libvirt: negative g_new0 length can lead to unbounded memory allocation

- Severity: Medium 6.2 (CVSS:3.1, scored by redhat) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.35%, higher than 21% of CVEs (2026-11-30)
- Published: 2024-03-21T13:39:08.847Z
- Modified: 2026-11-25T22:17:15.900Z
- Weaknesses: CWE-789
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: redhat

## Description

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.

(As written by CVE List.)

## Affected

- libvirt: from 9.0.0 before 9.7.0 (not affected: from 0:10.0.0-6.2.el9_4 before *)
- openshift-sandboxed-containers/osc-cloud-api-adaptor-rhel9: no versions given (not affected: from 1.6.0-7 before *)
- openshift-sandboxed-containers/osc-cloud-api-adaptor-webhook-rhel9: no versions given (not affected: from 1.6.0-7 before *)
- openshift-sandboxed-containers/osc-monitor-rhel9: no versions given (not affected: from 1.6.0-4 before *)
- openshift-sandboxed-containers/osc-must-gather-rhel9: no versions given (not affected: from 1.6.0-12 before *)
- openshift-sandboxed-containers/osc-operator-bundle: no versions given (not affected: from 1.6.0-62 before *)
- openshift-sandboxed-containers/osc-podvm-builder-rhel9: no versions given (not affected: from 1.6.0-13 before *)
- openshift-sandboxed-containers/osc-podvm-payload-rhel9: no versions given (not affected: from 1.6.0-7 before *)
- openshift-sandboxed-containers/osc-rhel9-operator: no versions given (not affected: from 1.6.0-13 before *)
- virt-devel:rhel: no versions given (not affected: from 8100020240409073027.489197e6 before *)
- virt:rhel: no versions given (not affected: from 8100020240409073027.489197e6 before *)
- virt:av/libvirt: no versions given

## References

- <https://access.redhat.com/errata/RHBA-2024:3964> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2024:2560> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2024:3253> (vendor-advisory)
- <https://access.redhat.com/security/cve/CVE-2024-2494> (vdb-entry)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2270115> (issue-tracking)
- <https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/BKRQXPLPC6B7FLHJXSBQYW7HNDEBW6RJ/>
- <https://lists.debian.org/debian-lts-announce/2024/04/msg00000.html>
- <https://security.netapp.com/advisory/ntap-20240517-0009/>

## Sources

- CVE List: [CVE-2024-2494](https://www.cve.org/CVERecord?id=CVE-2024-2494), CVE Terms of Use, modified 2026-11-25
- NVD: [CVE-2024-2494](https://nvd.nist.gov/vuln/detail/CVE-2024-2494), Public domain, modified 2026-11-25

---

Page: https://cve.day/CVE-2024-2494 · Whole record: https://cve.day/CVE-2024-2494.json · Rebuilt by cve.day 2026-11-25T22:32:17.625Z
