CVE-2024-53104·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: media: uvcvideo: Skip parsing frames of type UVC_VS_UNDEFINED in uvc_parse_format This can lead to out of bounds writes since frames of this type were not taken into account when calculating the size of the frames buffer in uvc_parse_streaming.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.12.1
- Published
- 2024-12-02
Affected versions
From: 6.12
Until: 6.12.1
Fixed in: 6.12.1
How to fix this CVE
Update the Linux kernel to version 6.12.1 or later, which adds a check to skip frames of type UVC_VS_UNDEFINED during format parsing. If an immediate kernel update is not feasible, disable the uvcvideo kernel module to eliminate the attack surface entirely. Organizations should also enforce USB device policies to prevent unauthorized peripherals from being connected to servers.
# Check current kernel version
uname -r
# Update package lists and install latest kernel
sudo apt update && sudo apt upgrade -y linux-image-generic linux-headers-generic
# If running HWE kernel (common on Ubuntu LTS)
sudo apt install --install-recommends linux-generic-hwe-$(lsb_release -rs) -y
# Reboot to load the patched kernel
sudo reboot
# After reboot, verify the new kernel is loaded
uname -r
# Temporary mitigation: disable UVC driver without reboot
sudo modprobe -r uvcvideo
echo 'blacklist uvcvideo' | sudo tee /etc/modprobe.d/blacklist-uvcvideo.confDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
This vulnerability is exploited through the USB physical access vector. An attacker must connect a malicious USB device (or compromise an existing USB peripheral) that presents itself as a UVC-compliant video device. The crafted device sends specially formed USB video streaming descriptors containing frames with type UVC_VS_UNDEFINED (value 0x00). During enumeration, the kernel's uvc_parse_streaming function calculates a buffer size that does not account for these undefined frame types, but uvc_parse_format then attempts to write data for them, causing a heap buffer overflow. This is a local privilege escalation path: an attacker with physical access to a USB port can achieve arbitrary kernel memory writes, leading to full root compromise. The attack has been observed in targeted surveillance operations where a seemingly innocuous USB device is connected to a target machine.WAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
A Web Application Firewall cannot mitigate CVE-2024-53104. This vulnerability operates entirely within the Linux kernel's USB subsystem and does not involve any network traffic, HTTP requests, or web application layer interaction. The attack vector is physical access via USB, which is outside the scope of any network-based security control.
Recommended compensating controls:
- Enforce USB device authorization policies using USBGuard (usbguard daemon) to whitelist only known devices
- Disable the uvcvideo kernel module on servers that have no legitimate need for USB cameras
- Implement physical security controls to restrict USB port access on production servers
- Enable kernel lockdown mode (integrity or confidentiality) to limit kernel module loading
- Use grsecurity or SELinux policies to restrict device enumeration capabilities
- Monitor dmesg and kernel logs for unexpected USB device enumeration eventsHow to check if you are affected
- { "step": 1, "title": "Check if the vulnerable kernel module is loaded", "command": "lsmod | grep uvcvideo", "description": "If the uvcvideo module is loaded, the system has an active attack surface for this CVE. Servers typically should not have this module loaded unless they use USB webcams." }
- { "step": 2, "title": "Verify current kernel version against patched versions", "command": "uname -r", "description": "Compare the running kernel version against the fixed version 6.12.1+. Note that many distributions backport fixes, so also check your distro's security advisory for the specific package version that includes the patch." }
- { "step": 3, "title": "Check installed kernel packages for patch status", "command": "apt list --installed 2>/dev/null | grep linux-image || rpm -qa | grep kernel-core", "description": "List installed kernel packages to determine whether a patched version has been installed. Cross-reference the package version with your distribution's CVE tracker for CVE-2024-53104." }
- { "step": 4, "title": "Audit recent USB device connections in kernel logs", "command": "dmesg | grep -iE 'usb|uvc' | tail -30", "description": "Review kernel messages for any unexpected USB device enumeration events. Look for UVC devices that should not be present on a server, which could indicate an exploitation attempt." }
- { "step": 5, "title": "Check systemd journal for USB events over the past week", "command": "journalctl -k --since '7 days ago' | grep -iE 'new (usb|high speed|full speed|low speed)' | tail -20", "description": "Search the persistent journal for USB device connection events that may have occurred outside the current boot's dmesg buffer. Unexpected USB enumerations on headless servers warrant investigation." }
- { "step": 6, "title": "Verify USB device authorization policy", "command": "cat /sys/bus/usb/devices/usb*/authorized_default 2>/dev/null; systemctl is-active usbguard 2>/dev/null || echo 'USBGuard not installed'", "description": "Check whether USB device authorization is configured. A value of 1 for authorized_default means all USB devices are automatically authorized, increasing risk. USBGuard provides granular device-level control." }
- { "step": 7, "title": "Scan for signs of kernel memory corruption", "command": "dmesg | grep -iE 'BUG|KASAN|slab-out-of-bounds|heap-buffer-overflow|general protection fault' | tail -20", "description": "Check kernel ring buffer for memory corruption indicators. KASAN reports or BUG entries related to slab/heap overflows near UVC code paths could indicate exploitation attempts." }
Indicators of compromise
- { "type": "kernel_log", "value": "uvcvideo: Found UVC format with unexpected frame type", "description": "Kernel log entry indicating the UVC driver encountered a frame with an undefined type during device enumeration" }
- { "type": "kernel_log", "value": "slab-out-of-bounds write in uvc_parse_format", "description": "KASAN detection of the heap overflow in the vulnerable function, indicating active exploitation" }
- { "type": "kernel_log", "value": "BUG: unable to handle page fault in uvc driver", "description": "Kernel page fault in UVC driver code paths, which may indicate memory corruption from exploitation" }
- { "type": "device_event", "value": "USB device with unexpected UVC streaming descriptor type 0x00", "description": "A USB device presenting UVC Video Streaming descriptors with frame type 0x00 (UVC_VS_UNDEFINED)" }
- { "type": "module_load", "value": "uvcvideo module loaded on headless server", "description": "The UVC video module being loaded on a server with no legitimate camera use is suspicious and warrants investigation" }
FAQ
Can this vulnerability be exploited remotely over the network?
No. CVE-2024-53104 requires physical access to a USB port or the ability to compromise a USB peripheral already connected to the target machine. There is no network-based attack vector. However, in cloud environments, USB passthrough configurations could theoretically extend the attack surface.
Is this vulnerability actively exploited in the wild?
Yes. Google's Threat Analysis Group confirmed CVE-2024-53104 has been used in targeted attacks. The vulnerability was flagged by CISA in their Known Exploited Vulnerabilities catalog and has been linked to surveillance operations where physical access to the target device was available.
Are cloud servers and VPS instances affected?
Cloud VMs typically do not have USB passthrough enabled, which means the uvcvideo module cannot be triggered by external devices. However, the vulnerable code is still present in unpatched kernels. Organizations should still patch to eliminate the vulnerability, as hypervisor escape scenarios or USB passthrough configurations could create exposure.
Does disabling the uvcvideo module fully mitigate the risk?
Yes, blacklisting and unloading the uvcvideo kernel module eliminates the attack surface entirely. Run 'sudo modprobe -r uvcvideo' to unload it immediately, and add 'blacklist uvcvideo' to /etc/modprobe.d/ to prevent it from loading on boot. This is the recommended interim mitigation for servers that do not use USB cameras.
Which kernel versions are affected?
The vulnerability was introduced in the UVC driver and affects kernels up through version 6.12. The fix was applied in version 6.12.1. However, most Linux distributions backport security fixes to their supported kernel versions, so the specific fixed package version varies by distro. Check your distribution's security tracker for the exact patched package.
What is the CVSS score and why is it rated High rather than Critical?
CVE-2024-53104 has a CVSS score of 7.8 (High). Despite enabling arbitrary kernel memory writes and full privilege escalation, it requires local/physical access to exploit, which limits the attack scope compared to remotely exploitable vulnerabilities. The High rating reflects the significant impact (complete system compromise) balanced against the restricted access vector.
Should I prioritize patching this on my web servers?
For internet-facing servers in data centers or cloud environments, this is lower priority than remote code execution vulnerabilities because it requires physical USB access. However, you should still include it in your regular patching cycle. For on-premises servers, co-located hardware, or edge devices with accessible USB ports, treat this as high priority.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/1ee9d9122801eb688783acd07791f2906b87cb4f
- https://git.kernel.org/stable/c/467d84dc78c9abf6b217ada22b3fdba336262e29
- https://git.kernel.org/stable/c/575a562f7a3ec2d54ff77ab6810e3fbceef2a91d
- https://git.kernel.org/stable/c/622ad10aae5f5e03b7927ea95f7f32812f692bb5
- https://git.kernel.org/stable/c/684022f81f128338fe3587ec967459669a1204ae
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-53104. Free for 1 server.
Get started free