CVE-2024-4418: Libvirt: stack use-after-free in virnetclientioeventloop()

Published May 2, 2024
·
Updated

A race condition leading to a stack use-after-free bug was found in libvirt. Due to a bad assumption in the virNetClientIOEventLoop() method, the data pointer to a stack-allocated virNetClientIOEventData structure ended up being used in virNetClientIOEventFD callback while the data pointer's stack frame was concurrently being "freed" when returning from virNetClientIOEventLoop().

Quoting libvirt maintainer Daniel P. Berrangé: The 'virtproxyd' daemon can be used to trigger requests which could potentially exercise the bug. If libvirt is configured with fine grained access control, this could in theory let a user escape their otherwise limited access. A local unprivileged user can access virtproxyd without authenticating. Remote users would need to authenticate before they could exercise it.

Other sources

A race condition leading to a stack use-after-free flaw was found in libvirt. Due to a bad assumption in the virNetClientIOEventLoop() method, the data pointer to a stack-allocated virNetClientIOEventData structure ended up being used in the virNetClientIOEventFD callback while the data pointer's stack frame was concurrently being "freed" when returning from virNetClientIOEventLoop(). The 'virtproxyd' daemon can be used to trigger requests. If libvirt is configured with fine-grained access control, this issue, in theory, allows a user to escape their otherwise limited access. This flaw allows a local, unprivileged user to access virtproxyd without authenticating. Remote users would need to authenticate before they could access it.

Ubuntu

Libvirt: stack use-after-free in virnetclientioeventloop()

Microsoft

Affected Software

4 affected componentsFixes available
ubuntu/libvirt<10.0.0-2ubuntu8.2
10.0.0-2ubuntu8.2
debian/libvirt
5.0.0-4+deb10u15.0.0-4+deb10u27.0.0-3+deb11u29.0.0-410.3.0-310.4.0-1
Microsoft cbl2 libvirt 7.10.0-10
Microsoft azl3 libvirt 10.0.0-5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 10.0.0-2ubuntu8.2
  2. Upgrade

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

    Fixed in 5.0.0-4+deb10u1Fixed in 5.0.0-4+deb10u2Fixed in 7.0.0-3+deb11u2Fixed in 9.0.0-4Fixed in 10.3.0-3Fixed in 10.4.0-1

Event History

May 2, 2024
Data Sourced
via Red Hat·12:29 PM
DescriptionSeverityAffected Software
May 5, 2024
CVE Published
via Ubuntu·12:00 AM
May 8, 2024
CVE Published
via MITRE·03:03 AM
Data Sourced
via MITRE·03:03 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:15 AM
DescriptionSeverityWeakness
May 13, 2024
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverity
May 31, 2024
Data Sourced
via Launchpad·01:31 PM
Description

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2024-4418?

CVE-2024-4418 is classified as a high-severity vulnerability due to the potential for exploitation via a race condition and use-after-free error.

2

How do I fix CVE-2024-4418?

To mitigate CVE-2024-4418, upgrade libvirt to version 10.0.0-2ubuntu8.2 for Ubuntu or one of the specified versions for Debian.

3

What platforms are affected by CVE-2024-4418?

CVE-2024-4418 affects libvirt on Ubuntu and Debian systems.

4

What is the attack vector for CVE-2024-4418?

The attack vector for CVE-2024-4418 involves exploiting a race condition that leads to unexpected behavior in libvirt's networking functionalities.

5

Is there a workaround for CVE-2024-4418?

There are no known workarounds for CVE-2024-4418, so the recommended action is to apply the available security updates.

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