6.2medium
Libvirt: negative g_new0 length can lead to unbounded memory allocation
- Severity
- 6.2medium CVSS:3.1 by redhat
- Exploit likelihood
- 0.35% (higher than 21% of CVEs)
- Published
- Last changed
- 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| libvirt | from 9.0.0 before 9.7.0 Not affected: from 0:10.0.0-6.2.el9_4 before * | CVE List |
| openshift-sandboxed-containers/osc-cloud-api-adaptor-rhel9 | Not specified Not affected: from 1.6.0-7 before * | CVE List |
| openshift-sandboxed-containers/osc-cloud-api-adaptor-webhook-rhel9 | Not specified Not affected: from 1.6.0-7 before * | CVE List |
| openshift-sandboxed-containers/osc-monitor-rhel9 | Not specified Not affected: from 1.6.0-4 before * | CVE List |
| openshift-sandboxed-containers/osc-must-gather-rhel9 | Not specified Not affected: from 1.6.0-12 before * | CVE List |
| openshift-sandboxed-containers/osc-operator-bundle | Not specified Not affected: from 1.6.0-62 before * | CVE List |
| openshift-sandboxed-containers/osc-podvm-builder-rhel9 | Not specified Not affected: from 1.6.0-13 before * | CVE List |
| openshift-sandboxed-containers/osc-podvm-payload-rhel9 | Not specified Not affected: from 1.6.0-7 before * | CVE List |
| openshift-sandboxed-containers/osc-rhel9-operator | Not specified Not affected: from 1.6.0-13 before * | CVE List |
| virt-devel:rhel | Not specified Not affected: from 8100020240409073027.489197e6 before * | CVE List |
| virt:rhel | Not specified Not affected: from 8100020240409073027.489197e6 before * | CVE List |
| virt:av/libvirt | Not specified | CVE List |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
NVD (es)
Se encontró una falla en las API de la librería RPC de libvirt. El código de deserialización del servidor RPC asigna memoria para las matrices antes de que los puntos de entrada de la API de C realicen la verificación de longitud no negativa. Pasar una longitud negativa a la función g_new0 provoca un bloqueo debido a que la longitud negativa se trata como un número positivo enorme. Esta falla permite que un usuario local sin privilegios realice un ataque de denegación de servicio provocando la falla del demonio libvirt.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-2494 changed 2026-11-25 | CVE Terms of Use |
| NVD | CVE-2024-2494 changed 2026-11-25 | Public domain |