A recent discovery has unveiled a significant vulnerability in the Linux kernel, allowing specially crafted USB devices to execute commands with root privileges without user interaction. This flaw, identified by Drivesec researchers, has been labeled USB2Shell. It exploits a loophole in the Linux kernel’s automatic USB device scanning process.
Understanding the USB2Shell Vulnerability
The vulnerability resides in the Linux kernel’s SCSI core, specifically in a function related to Command Duration Limits for ATA disks. When a USB device is connected, the kernel scans it immediately, copying data into a buffer without verifying the provided length values. This oversight permits a malicious device to read and alter kernel stack memory, potentially leading to unauthorized command execution.
This flaw affects Linux versions 6.5 and later, persisting in systems with USB mass storage support enabled via usb-storage or uas drivers. The issue was rectified in the kernel in September, identified as CVE-2026-98232 in October, but unpatched systems remain at risk.
Impact and Mitigation Strategies
Despite the potential severity, no real-world exploits have been reported. The vulnerability’s probabilistic nature means failed attempts do not crash the system, allowing attackers multiple tries. The flaw primarily threatens systems with publicly accessible USB ports, such as kiosks and payment terminals.
To mitigate the risk, users should update their systems with the latest kernel patches. Alternatively, disabling the usb-storage and uas drivers or implementing USB allow-listing mechanisms like USBGuard can provide interim protection. Drivesec provides a script to check system vulnerability, but its results may not account for vendor-specific fixes.
The Role of AI in Identifying Vulnerabilities
Interestingly, the flaw was initially flagged by Sashiko, an AI code-review tool developed by Google for the Linux Foundation. While Sashiko identified the issue, Drivesec independently discovered and exploited the vulnerability. This marks one of many contributions by Sashiko, credited with identifying numerous CVE fixes this year.
The flaw’s implications extend to Android devices as well, where it results in a memory leak rather than root access. Systems running kernel version 6.6 and onward leak kernel memory but are protected against memory alteration by compiler checks.
In conclusion, while no known exploitations have occurred, the USB2Shell vulnerability underscores the importance of timely system updates and robust security practices, particularly for devices with vulnerable USB ports.
