USB2Shell: a Linux kernel bug lets a malicious USB device run commands as root with no login
Drivesec showed a crafted USB 'disk' can get root on unpatched Linux 6.5+ systems through a SCSI bug (CVE-2026-98232). Fixes exist; no attacks have been seen.
Researchers at Drivesec have demonstrated USB2Shell, an attack in which a specially built USB device gains root code execution on an unpatched Linux machine just by being plugged in. Nobody needs to log in, mount a drive or click anything.
The bug
The flaw, tracked as CVE-2026-98232, sits in the kernel's SCSI core, in code that handles the Command Duration Limits feature. A device that presents itself as an ATA disk supporting this feature can return length values that the kernel never checks against a small buffer on the stack. That lets the device read up to 64 bytes of kernel stack memory and change one byte.
Drivesec says it turned that small primitive into an arbitrary kernel write on a Debian test machine running kernel 6.12.22 with KASLR enabled, using a programmable USB tool. In the demo the attacker's command runs when the device is unplugged.
What is affected
- Kernels from Linux 6.5 onward that include the vulnerable code and have usb-storage or UAS support.
- Machines with a USB port an attacker can physically reach.
The upstream fix landed in September 2026. According to the report, Debian 12's kernel never contained the flawed code, and Red Hat has shipped a fix for its kernel. Google's AI code reviewer first flagged the problem; Drivesec wrote the exploit and patch.
Risk in context
This requires physical access, and there are no reports of exploitation and no CISA KEV listing. It matters most for kiosks, shared workstations, industrial and automotive systems, and laptops left unattended.
Mitigations
Update to a kernel with the fix. Where that is not yet possible, unload or blacklist the usb-storage and uas modules if they are not needed, or use USBGuard or authorized_default=0 to block unknown devices.
Who's affected
Linux systems on kernel 6.5 or later with USB storage support and physically accessible ports.
What to do
Install your distribution's patched kernel, block usb-storage/uas where not needed, and use USBGuard or similar device authorization on exposed machines.