A stack out-of-bounds bug in the Linux kernel’s SCSI core, tracked as CVE-2026-98232 and named USB2Shell by Italian security company Drivesec, lets a crafted USB storage device run commands as root on an unpatched machine before anyone logs in. Drivesec published its full write-up on November 30, 2026, almost three months after the fix went into the kernel.

How the bug works

The flaw is in scsi_cdl_enable(), which the kernel calls when a new SCSI device claims to be an ATA device with Command Duration Limits support, a feature added in Linux 6.5. The function reads a mode page into a 64-byte stack buffer using length fields from the device’s MODE SENSE reply. According to the CVE description in Debian’s security tracker, a device can report a total length shorter than its own header and block descriptors, so an unsigned subtraction wraps and the computed pointer lands outside the buffer.

During the automatic scan, the device can then clear bits in a stack byte it chooses, and the next MODE SELECT command sends up to 64 bytes of kernel stack back to it. Nothing has to be mounted. Drivesec says an attacker needs only brief physical access to a USB port.

USB2Shell Linux Kernel Flaw Lets Malicious USB Devices Gain Root Access Without Login

The exploit

Drivesec ran its proof of concept from a Cynthion USB device against a stock Debian 6.12.22+bpo-amd64 kernel with KASLR enabled. The leaked stack data breaks KASLR, and the chain builds fake kernel structures that turn the one-byte change into a controlled write. When the device is unplugged, the kernel runs a command the device supplied, as root. The exploit is probabilistic; in Drivesec’s demonstration, the third attempt ran whoami and uname as root, and the two misses caused no crash.

Who is affected

On Drivesec’s USB2Shell page, the conditions are Linux 6.5 or later without the fix, usb-storage or uas support built in or auto-loaded, and a reachable USB port. The company names car infotainment units, EV chargers, point-of-sale terminals, kiosks and industrial control panels as realistic targets. Android kernels from 6.6 onward still leak stack contents, but the Android GKI and Samsung Galaxy A16 kernels Drivesec checked use compiler bounds checks that keep the write inside the buffer.

Debian marks its 6.1-based bookworm kernel as not affected because the code is absent, and lists the trixie fix in 6.12.113-1 under DSA-6568-1.

Fixes and timeline

Upstream commit 3d676e458fe0, “scsi: core: Validate MODE SENSE lengths in scsi_cdl_enable()”, caps the length at the buffer size and checks the header and descriptor lengths before the page is used. Fixed stable releases are 6.6.158, 6.12.112, 6.18.54 and 7.2.8, and mainline is fixed in 7.3, the kernel Greg Kroah-Hartman says is likely to become the next LTS release. The 7.3.7, 6.18.66 and 6.12.120 stable kernels are past those cutoffs. Because vendors often backport patches without changing version numbers, Drivesec points administrators to vendor advisories and its usb2shell-check.sh script.

Drivesec found the bug on August 26, 2026 and reported it privately to the SCSI maintainers on September 2. The fix was committed on September 9, 2026, and the Linux CNA published the CVE on October 6, 2026. Drivesec’s page credits Sashiko AI Review with first reporting the bug on linux-scsi and says its own team found it independently.

Where patching has to wait, Drivesec advises not building or auto-loading usb-storage and uas on systems that don’t need mass storage, and using USB allow-listing through USBGuard or authorized_default=0 so unknown devices are never scanned. No attacks using the flaw have been reported.

Michael writes command guides and Bash scripting tutorials for Command Linux, with a focus on practical examples readers can use right away. He runs Debian on his servers and Arch on his laptop.