USB2Shell Linux flaw can grant root access before login
A crafted USB device can exploit an unpatched Linux kernel before login, but the fix is already available and no real-world attacks are known.
A crafted USB device can make an unpatched Linux machine run an attacker's command as root without anyone logging in, mounting a drive or clicking anything, researchers at Drivesec have demonstrated. The vulnerability is known as USB2Shell and is tracked as CVE-2026-98232.1
Why it matters
The flaw sits in the Linux kernel's SCSI code, where a feature called Command Duration Limits is processed when a USB storage device is scanned. A malicious device can claim to be an ATA disk that supports the feature, then provide length values that are not checked against the size of a small stack buffer.1
That happens during the automatic scan triggered when the device is plugged in. A locked screen, a logged-out session or a rule against mounting unknown drives does not stop the kernel from processing the device. Drivesec says its test could read up to 64 bytes of kernel stack memory and change a single byte.1
The researchers turned that limited memory corruption into a root command on one test machine, defeating kernel address randomisation and building fake kernel data structures. The exploit was probabilistic and did not work every time; no real-world attacks have been found.1
The vulnerable code was introduced in Linux 6.5 and fixed upstream in September. Distribution versions do not map neatly to that number because vendors backport security fixes. Debian's standard version 12 kernel, for example, did not contain the flawed code, while Red Hat shipped the fix in a kernel with a different version number.1
What to do
Install a kernel update containing the fix or backport the upstream patch. If a machine does not need USB storage, administrators can disable the usb-storage and uas drivers. USB allow-listing tools such as USBGuard, or the authorised_default=0 setting, can reduce exposure while systems are being updated.1
The practical risk is greatest where strangers can reach an exposed USB port, including kiosks, payment terminals, vehicle systems, EV chargers and smart-home hubs. Those are examples of possible targets, not confirmed victims.1
Our opinion
USB2Shell is a useful reminder that “don’t plug in an unknown drive” is not a complete defence when the kernel inspects hardware before a user has logged in. It is also not a reason to panic: the fix has been available since September, the exploit is probabilistic and no attacks have been reported. The sensible response is to check the kernel supplied by your distribution, apply its fix and restrict unused USB storage support.1
This image is an abstract representation of server hardware and does not depict a USB2Shell exploit. Photo by panumas nikhomkhai on Pexels.2