Skip to main content
Vulnerability Database/CVE-2024-43873

CVE-2024-43873: Linux Kernel Use-After-Free Vulnerability

CVE-2024-43873 is a use-after-free vulnerability in the Linux Kernel vhost/vsock subsystem affecting seqpacket_allow initialization. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-43873 Overview

CVE-2024-43873 is a vulnerability in the Linux kernel's vhost/vsock subsystem involving the use of uninitialized memory [CWE-909]. The seqpacket_allow field is not initialized when a vsock socket is created. If features are never set via the vhost ioctl interface, the field is read in an uninitialized state. A secondary issue allows the VIRTIO_VSOCK_F_SEQPACKET feature flag to remain set internally even after a guest clears it, because set_features does not unconditionally reset seqpacket_allow. Local, authenticated users on an affected host can leverage this flaw to compromise confidentiality, integrity, and availability.

Critical Impact

Local attackers with access to vhost-vsock devices can trigger undefined behavior in the kernel, potentially leading to privilege escalation or host compromise from a virtualized context.

Affected Products

  • Linux Kernel (upstream stable branches prior to patched commits)
  • Debian LTS distributions shipping affected linux packages
  • Any distribution running a vhost_vsock enabled kernel without the fix backported

Discovery Timeline

  • 2024-08-21 - CVE CVE-2024-43873 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-43873

Vulnerability Analysis

The vulnerability resides in drivers/vhost/vsock.c, which implements the host-side vhost_vsock driver used to accelerate virtio-vsock communication between a hypervisor host and its guests. The driver maintains a per-device boolean seqpacket_allow that governs whether SEQPACKET-type vsock traffic may be processed on the device.

Two defects affect this field. First, when a new vhost_vsock device is allocated, seqpacket_allow is never explicitly set. If userspace opens the device and begins issuing operations before invoking VHOST_SET_FEATURES, the field is read while still uninitialized. Second, the original set_features handler only wrote to seqpacket_allow when the VIRTIO_VSOCK_F_SEQPACKET bit was asserted. Clearing the feature bit after it had been set did not reset the field, producing stale state that no longer matched the negotiated feature set.

Root Cause

The root cause is improper initialization of security-relevant state during object allocation, combined with conditional assignment in the feature negotiation path. The fix initializes seqpacket_allow to false after allocation and assigns it unconditionally in set_features based on the current feature bitmap, eliminating both the uninitialized read and the stale state window.

Attack Vector

Exploitation requires local access and the ability to open /dev/vhost-vsock or trigger vhost_vsock operations from within a guest VM. An attacker with these privileges can observe kernel behavior that depends on an uninitialized stack or heap byte, potentially influencing packet routing decisions or causing kernel-side logic errors. The CVSS vector reflects a local attack path with low attack complexity requiring low privileges.

No verified public exploit code is available for this issue. Technical details can be reviewed in the upstream commits referenced in the Vendor Advisory URLs.

Detection Methods for CVE-2024-43873

Indicators of Compromise

  • Unexpected kernel warnings or KASAN reports mentioning vhost_vsock_set_features or seqpacket_allow
  • Virtual machines exhibiting unexplained vsock SEQPACKET traffic acceptance after guests clear the feature bit
  • Unprivileged processes opening /dev/vhost-vsock on hosts where only hypervisor services should hold the handle

Detection Strategies

  • Audit kernel versions across hypervisor hosts and compare against the fixed commits (1e1fdcbd, 3062cb10, 30bd4593, ea558f10, eab96e87).
  • Enable kernel sanitizers such as KASAN or KMSAN in test environments to surface the uninitialized read during fuzzing of vhost ioctls.
  • Monitor auditd for open syscalls targeting /dev/vhost-vsock from processes outside the expected virtualization stack (e.g., qemu, libvirtd).

Monitoring Recommendations

  • Collect kernel log events (dmesg, journald) and forward them to a central analytics backend for anomaly detection.
  • Track package versions of linux-image-* via configuration management and alert on hosts running pre-patch kernels.
  • Baseline normal vhost ioctl patterns from hypervisor processes and alert on deviations originating from unexpected UIDs.

How to Mitigate CVE-2024-43873

Immediate Actions Required

  • Apply the vendor-supplied kernel update that includes the upstream fix for vhost/vsock seqpacket initialization.
  • Reboot affected hypervisor hosts after patching to load the corrected vhost_vsock module.
  • Restrict access to /dev/vhost-vsock to the minimum set of hypervisor service accounts using filesystem permissions and device cgroup policies.

Patch Information

The fix is available in the upstream Linux stable tree through commits 1e1fdcbd, 3062cb10, 30bd4593, ea558f10, and eab96e87. Debian LTS users should consult the Debian LTS Announcement for distribution-specific package versions.

Workarounds

  • Unload the vhost_vsock kernel module on hosts that do not require virtio-vsock communication using modprobe -r vhost_vsock.
  • Blacklist the module in /etc/modprobe.d/ to prevent reload across reboots on systems where vsock is not needed.
  • Enforce mandatory access control profiles (SELinux, AppArmor) that limit which processes can interact with vhost character devices.
bash
# Prevent vhost_vsock from loading on hosts that do not need it
echo 'blacklist vhost_vsock' | sudo tee /etc/modprobe.d/disable-vhost-vsock.conf
sudo modprobe -r vhost_vsock

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.