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

> A local unprivileged user can crash the libvirt daemon by triggering an integer overflow in RPC deserialization, causing a denial of service.

- **Severity:** Medium 6.2 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Mar 2024
- **Updated:** 25 Feb 2026
- **Also known as:** AZL-37110, AZL-38665, BELL-CVE-2024-2494, CLSA-2025-1741032827, CLSA-2025-1741033614, DEBIAN-CVE-2024-2494, GHSA-h9fq-4hj4-g596, MGASA-2024-0114, RHSA-2024:3253, RLSA-2024:3253, SUSE-SU-2024:1078-1, SUSE-SU-2024:1083-1, SUSE-SU-2024:1100-1, UBUNTU-CVE-2024-2494, openSUSE-SU-2024:13796-1

## What is CVE-2024-2494?

CVE-2024-2494 is a medium-severity vulnerability in Red Hat Enterprise Linux 6, published on 21 Mar 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official 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.

Weakness: CWE-789 (Memory Allocation with Excessive Size Value)

## Which versions are affected by CVE-2024-2494?


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `SLOF` | Red Hat:enterprise_linux:8::appstream | All versions | 0:20210217-2.module+el8.10.0+20141+6faa2812 |
| `hivex` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.3.18-23.module+el8.9.0+18724+20190c23 |
| `hivex-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.3.18-23.module+el8.9.0+18724+20190c23 |
| `hivex-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.3.18-23.module+el8.9.0+18724+20190c23 |
| `hivex-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.3.18-23.module+el8.9.0+18724+20190c23 |
| `libguestfs` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-appliance` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-bash-completion` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-gfs2` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-gobject` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-gobject-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-gobject-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-inspect-icons` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-java` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-java-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-java-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-javadoc` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-man-pages-ja` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-man-pages-uk` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-rescue` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-rsync` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-tools` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-tools-c` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-tools-c-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libguestfs-winsupport` | Red Hat:enterprise_linux:8::appstream | All versions | 0:8.10-1.module+el8.10.0+19908+9938c7c9 |
| `libguestfs-xfs` | Red Hat:enterprise_linux:8::appstream | All versions | 1:1.44.0-9.module+el8.9.0+18724+20190c23 |
| `libiscsi` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.18.0-8.module+el8.9.0+18724+20190c23 |
| `libiscsi-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.18.0-8.module+el8.9.0+18724+20190c23 |
| `libiscsi-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.18.0-8.module+el8.9.0+18724+20190c23 |
| `libiscsi-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.18.0-8.module+el8.9.0+18724+20190c23 |
| `libiscsi-utils` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.18.0-8.module+el8.9.0+18724+20190c23 |
| `libiscsi-utils-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.18.0-8.module+el8.9.0+18724+20190c23 |
| `libnbd` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.6.0-5.module+el8.9.0+18724+20190c23 |
| `libnbd-bash-completion` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.6.0-5.module+el8.9.0+18724+20190c23 |
| `libnbd-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.6.0-5.module+el8.9.0+18724+20190c23 |
| `libnbd-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.6.0-5.module+el8.9.0+18724+20190c23 |
| `libnbd-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:1.6.0-5.module+el8.9.0+18724+20190c23 |

## How do I fix CVE-2024-2494?

Apply the vendor's patch.

## Is CVE-2024-2494 being exploited?

There is no known exploitation of CVE-2024-2494 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-2494 and fix it if it is affected.

What it is: CVE-2024-2494 is a medium-severity vulnerability in Red Hat Enterprise Linux 6, published on 21 Mar 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-2494 in the wild and no public exploit code.

Affected product: Red Hat Enterprise Linux 6. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-2494/ (Markdown: https://insights.sbomify.com/CVE-2024-2494/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-2494
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-2494
- OSV: https://osv.dev/vulnerability/CVE-2024-2494

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-2494/
Summaries are generated and may contain mistakes; the official description above is the record.
