CVE-2024-50302·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: HID: core: zero-initialize the report buffer Since the report buffer is used by all kinds of drivers in various ways, let's zero-initialize it during allocation to make sure that it can't be ever used to leak kernel memory via specially-crafted report.
- Severity
- medium
- Software
- Kernel
- Fixed in
- 6.11.8
- Published
- 2024-11-19
Affected versions
From: 6.7
Until: 6.11.8
Fixed in: 6.11.8
How to fix this CVE
Update the Linux kernel to a patched version from your distribution. The fix adds zero-initialization of HID report buffers in the core HID layer. A reboot is required after kernel update.
sudo apt update && sudo apt install --only-upgrade linux-image-generic
# Verify: uname -r (should show patched version)
sudo reboot
# Check Ubuntu security notices: https://ubuntu.com/security/CVE-2024-50302Defensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
Local exploitation via crafted HID device interactions. The attacker opens and reads from HID device files (/dev/hidraw*) or uses the HIDIOCSFEATURE/HIDIOCGFEATURE ioctls to trigger report buffer allocation. Since the buffer is not zeroed, the read returns stale kernel heap data. In targeted attacks, this is chained with USB-based attacks or used by already-compromised local accounts for KASLR bypass.WAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
WAF rules cannot mitigate kernel memory disclosure vulnerabilities. Compensating controls include:
- Restrict access to /dev/hidraw* devices via udev rules
- Use kernel hardening: CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
- Limit local user access to the system
- Disable unused HID drivers via module blacklistingHow to check if you are affected
- Check if your kernel includes the fix: grep -r 'zero-initialize.*report' /usr/src/linux*/drivers/hid/ 2>/dev/null || echo 'Check kernel changelog'
- Check kernel version against distribution security advisories
- List loaded HID modules: lsmod | grep hid
- Check for suspicious HID device access: ls -la /dev/hidraw* && stat /dev/hidraw*
- Monitor for unusual ioctl calls to HID devices: ausearch -sc ioctl -f /dev/hidraw 2>/dev/null
- Verify kernel hardening: cat /proc/cmdline | grep init_on_alloc
Indicators of compromise
- Unusual access patterns to /dev/hidraw* devices from non-interactive processes
- Large volumes of HID ioctl calls (HIDIOCGFEATURE) from user-space processes
- Processes reading from HID devices that are not expected to use HID hardware
- KASLR bypass indicators followed by privilege escalation
FAQ
Is this exploitable remotely?
No. This requires local access to the system and the ability to interact with HID devices. However, it can be chained with USB-based attacks (malicious USB devices) or used by an attacker who already has local access to leak kernel memory for further exploitation.
Why is a CVSS 5.5 vulnerability in CISA KEV?
Despite the moderate CVSS score, this vulnerability is confirmed to be exploited in targeted attacks as part of exploit chains. Information leaks that defeat KASLR are critical enablers for kernel exploitation, making this a high-value primitive for attackers.
Does CONFIG_INIT_ON_ALLOC_DEFAULT_ON prevent this?
Yes. If the kernel is compiled with CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y (or booted with init_on_alloc=1), heap allocations are zero-initialized, preventing the information leak. Most modern distribution kernels do not enable this by default due to performance impact.
Are containers affected?
Containers share the host kernel, so if the host kernel is vulnerable and the container has access to HID devices (which is uncommon), exploitation is possible. In most container deployments, HID devices are not exposed.
Is this related to other USB/HID CVEs?
The Linux kernel's USB and HID subsystem has had several vulnerabilities. This specific issue is about uninitialized memory, separate from the UVC parser bugs (CVE-2024-53104) or USB audio issues (CVE-2024-53197), though they share the common theme of insufficient input validation in USB device handling.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/05ade5d4337867929e7ef664e7ac8e0c734f1aaf
- https://git.kernel.org/stable/c/177f25d1292c7e16e1199b39c85480f7f8815552
- https://git.kernel.org/stable/c/1884ab3d22536a5c14b17c78c2ce76d1734e8b0b
- https://git.kernel.org/stable/c/3f9e88f2672c4635960570ee9741778d4135ecf5
- https://git.kernel.org/stable/c/492015e6249fbcd42138b49de3c588d826dd9648
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-50302. Free for 1 server.
Get started free