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

Published Mar 18, 2024
·
Updated

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 gnew0 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.

Other sources

A flaw was found in the RPC library APIs of libvirt. The RPC server de-serialization 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 gnew0 function results in a crash due to the negative length being treated as a huge positive number. A local unprivileged user could use this flaw to perform a denial of service attack by causing the libvirt daemon to crash.

— Red Hat

Libvirt: negative gnew0 length can lead to unbounded memory allocation

— Microsoft

Affected Software

11 affected componentsFixes available
ubuntu/libvirt<6.0.0-0ubuntu8.19
6.0.0-0ubuntu8.19
ubuntu/libvirt<8.0.0-1ubuntu7.10
8.0.0-1ubuntu7.10
ubuntu/libvirt<9.6.0-1ubuntu1.1
9.6.0-1ubuntu1.1
ubuntu/libvirt<10.0.0-2ubuntu8.1
10.0.0-2ubuntu8.1
Microsoft cbl2 libvirt 7.10.0-10
Microsoft azl3 libvirt 10.0.0-5
Microsoft cbl2 libvirt 7.10.0-9
debian/libvirt<9.0.0-4+deb12u1
9.0.0-4+deb12u1
debian/libvirt<10.2.0-1
10.2.0-1
debian/libvirt<10.2.0-1
10.2.0-1
debian/libvirt
9.0.0-4+deb12u211.3.0-3+deb13u312.8.0-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade ubuntu/libvirt to a version that resolves this vulnerability.

    Fixed in 6.0.0-0ubuntu8.19
  2. Upgrade

    Upgrade ubuntu/libvirt to a version that resolves this vulnerability.

    Fixed in 8.0.0-1ubuntu7.10
  3. Upgrade

    Upgrade ubuntu/libvirt to a version that resolves this vulnerability.

    Fixed in 9.6.0-1ubuntu1.1
  4. Upgrade

    Upgrade ubuntu/libvirt to a version that resolves this vulnerability.

    Fixed in 10.0.0-2ubuntu8.1
  5. Upgrade

    Upgrade debian/libvirt to a version that resolves this vulnerability.

    Fixed in 9.0.0-4+deb12u1
  6. Upgrade

    Upgrade debian/libvirt to a version that resolves this vulnerability.

    Fixed in 10.2.0-1
  7. Upgrade

    Upgrade debian/libvirt to a version that resolves this vulnerability.

    Fixed in 9.0.0-4+deb12u2Fixed in 11.3.0-3+deb13u3Fixed in 12.8.0-1

Event History

Mar 18, 2024
Data Sourced
via Red Hat·01:44 PM
DescriptionSeverityAffected Software
Mar 20, 2024
CVE Published
via Ubuntu·12:00 AM
Mar 21, 2024
CVE Published
via MITRE·01:39 PM
Data Sourced
via MITRE·01:39 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:15 PM
DescriptionSeverityWeakness
Data Sourced
via OSV·02:15 PM
Affected Software
Apr 1, 2024
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2024-2494?

CVE-2024-2494 has been classified as a high severity vulnerability due to the potential for application crashes.

2

How do I fix CVE-2024-2494?

To mitigate CVE-2024-2494, upgrade to the patched versions of libvirt as specified in the vulnerability documentation.

3

What systems are affected by CVE-2024-2494?

CVE-2024-2494 affects specific versions of libvirt on Ubuntu and Debian systems.

4

What causes the issue in CVE-2024-2494?

CVE-2024-2494 is caused by improper memory allocation in the RPC server's deserialization code.

5

Is CVE-2024-2494 easily exploitable?

Exploitation of CVE-2024-2494 is feasible in scenarios where malicious input can be passed to the affected libvirt APIs.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203