Use-After-Free in NVIDIA CUDA Driver Allows for Container Escape and Host Privilege Escalation
Overview
A high-severity use-after-free vulnerability was disclosed in the NVIDIA GPU display driver for Linux. This flaw can be exploited by a local attacker to cause denial of service, escalate privileges, and execute arbitrary code on the host operating system. The vulnerability exists within the driver's memory management component that handles CUDA-related operations. In a multi-tenant cloud environment, such as a Kubernetes cluster with shared GPU nodes, a malicious container with GPU access could exploit this flaw. By sending a specially crafted sequence of memory allocation and deallocation requests to the driver via the `/dev/nvidia` device files, an attacker can trigger a condition where the driver attempts to use a pointer to memory that has already been freed. This can be leveraged to corrupt kernel memory, leading to a container breakout and full privilege escalation to root on the host node. The discovery, credited to Google's Project Zero, underscores the security risks of sharing powerful hardware accelerators between untrusted workloads and the importance of maintaining a patched infrastructure stack in AI/ML environments.
Affected Systems
Testing Guide
1. On a host machine, check the currently installed NVIDIA driver version by running the `nvidia-smi` command. 2. Compare the displayed driver version with the patched versions listed in the official NVIDIA security bulletin for CVE-2024-0073. 3. If the installed version is older than the patched version, the system is vulnerable. 4. (Advanced) In a controlled test environment, attempt to run a proof-of-concept exploit for the CVE against a container with GPU access to confirm exploitability.
Mitigation Steps
1. **Patch Drivers**: Immediately update all NVIDIA drivers on host machines to the versions specified in the NVIDIA security bulletin (550.78 or newer). 2. **Restrict GPU Access**: In multi-tenant environments, avoid assigning GPU resources to untrusted or publicly exposed workloads where possible. 3. **Use Sandboxed Runtimes**: Employ container runtimes with stronger kernel isolation, such as gVisor or Kata Containers, to provide an additional layer of defense against kernel-level exploits, though this can complicate GPU passthrough. 4. **Monitor Host Integrity**: Implement host-level intrusion detection and integrity monitoring to detect anomalous activity or unauthorized privilege escalation.
Patch Details
The vulnerability was addressed in the NVIDIA GPU Display Driver versions 550.78, 545.29.06, 535.161.07, and 470.239.06.