Linux kernel USB bug (CVE-2026-98232) gives root on plug-in

Drivesec, an Italian cybersecurity company, has published "usb2shell", its name for CVE-2026-98232, a bug in the Linux kernel's USB mass-storage path. A crafted USB device can make the kernel leak the contents of its stack and, through an exploit chain, run a command of the device's choosing as root. The name plays on this year's "2shell" and "4shell" bugs (PHP2Shell, Java4Shell, wp2shell, KindaRails2Shell), which were remote bugs in widely deployed software. usb2shell is the physical version: the attacker plugs in a crafted device instead of sending a crafted request.

The flaw sits in scsi_cdl_enable(). Command Duration Limits (CDL) support was added in Linux 6.5. When the kernel scans a new SCSI device that says it is an ATA device with CDL support, it calls this function, which reads a mode page from the device into a 64-byte stack buffer and writes it back. The lengths in the device's reply were used without checks. The length calculation can wrap to 64, and the buffer pointer can end up past the buffer. As a result, a device can make the kernel send it up to 64 bytes of kernel stack, and clear one stack byte at an offset the device picks. All of this happens during the automatic scan, before userspace sees any disk.

Drivesec built a proof of concept that runs on a Cynthion USB device plugged into a PC with a stock Debian 6.12.22+bpo-amd64 kernel. The leak lets the authors break KASLR, and the chain then builds fake kernel structures to turn the one-byte overwrite into a controlled write. When the device is unplugged, the kernel runs a command supplied by the device, as root. The exploit is probabilistic, but failed executions do not trigger a crash.

A system is exposed when three things are true: it runs Linux 6.5 or later without the fix; it has USB mass storage support (usb-storage or uas), built in or loaded automatically; and someone can plug a device into one of its USB ports. No user interaction or mount is needed, because the bug fires during the automatic device scan. Drivesec lists Linux systems with USB ports strangers can reach: car infotainment and telematics units, EV chargers, point-of-sale terminals, kiosks, in-flight entertainment, industrial HMIs and smart-home hubs.

Android is a special case. Android kernels on 6.6 and later are affected and the device still gets kernel stack contents back, but in the builds Drivesec checked (Android GKI and the Samsung Galaxy A16 shipping kernel), compiler bounds checks keep the write inside the buffer. On Android the bug is a leak only.

The fix is to update to a fixed kernel, or to backport upstream commit 3d676e458fe0 ("scsi: core: Validate MODE SENSE lengths in scsi_cdl_enable()") to a vendor kernel. Stable backports are 39491a1ae930, 60b0b8ce803e, 6233d0b3ef46 and 99a6e4a9176d. Drivesec offers a checker script, usb2shell-check.sh, to download, read and run. Because distributions and device vendors often backport fixes without changing the version number, a flagged kernel should be checked against the vendor advisory for CVE-2026-98232 or by looking for the fix commit in the source tree.

On credit: Sashiko AI Review first reported the bug on linux-scsi, while Drivesec's research team found it independently, wrote the fix and built the exploit chain.

Key facts

  • CVE-2026-98232 ("usb2shell") is a Linux kernel bug in scsi_cdl_enable(): a 64-byte stack buffer is filled using unchecked lengths from the USB device's reply, so the device can read up to 64 bytes of kernel stack and clear one stack byte at an offset it picks.
  • Drivesec's proof of concept on a Cynthion USB device against a stock Debian 6.12.22+bpo-amd64 kernel breaks KASLR and, when the device is unplugged, runs a device-supplied command as root.
  • Exposed: Linux 6.5 or later without the fix, with usb-storage or uas available, and a reachable USB port. No user interaction or mount is needed.
  • On Android (kernels 6.6 and later) the bug is a leak only in the builds checked, because compiler bounds checks keep the write inside the buffer.
  • The fix is upstream commit 3d676e458fe0, with stable backports 39491a1ae930, 60b0b8ce803e, 6233d0b3ef46 and 99a6e4a9176d; Drivesec offers a checker script.

Why it matters

Most of this year's "2shell" bugs were remote flaws in widely deployed software. This one needs physical access but little else: plugging in a crafted device is enough, with no click, no mount and no logged-in user, because the bug fires in the automatic device scan before userspace sees any disk. The reported result is root code execution on a stock Debian kernel. CDL support arrived in Linux 6.5, so the exposed range starts there.

Who it affects

Any system running Linux 6.5 or later without the fix, with USB mass storage support (usb-storage or uas) built in or loaded automatically, and a USB port someone can reach. Drivesec points to car infotainment and telematics units, EV chargers, point-of-sale terminals, kiosks, in-flight entertainment, industrial HMIs and smart-home hubs. Android kernels on 6.6 and later are affected too, but in the builds Drivesec checked (Android GKI and the Samsung Galaxy A16 shipping kernel) only the stack leak works.

How to use it

Drivesec's checker can be downloaded with curl -fsSLO https://usb2shell.com/tools/usb2shell-check.sh, read with less, then run with sh usb2shell-check.sh. If it flags your kernel, look up your vendor's advisory for CVE-2026-98232 or search the source tree for the fix commit, since backports often keep the old version number. To fix, update to a fixed kernel or backport upstream commit 3d676e458fe0 to the vendor kernel. Stable backports are 39491a1ae930, 60b0b8ce803e, 6233d0b3ef46 and 99a6e4a9176d. The page's list of interim mitigations is empty.

How solid is it

This is a first-party write-up by the company that found the bug, wrote the upstream fix and built the exploit, and it ties to a CVE and named kernel commits. The code excerpt and the proof of concept are described in enough detail to follow. The root exploit is shown only on a PC with a stock Debian 6.12.22+bpo-amd64 kernel. The authors are not named individually. No CVSS score or severity rating is given.

Risks and caveats

The exploit is probabilistic, though failed attempts do not crash the machine. The proof of concept is described only on a PC with a Debian kernel; no exploitation on other distributions or on embedded products is claimed. On Android the bug is a leak only in the builds checked. No fixed kernel version numbers are named, only commit hashes, and the Timeline section is empty, so no disclosure or release dates are given. No evidence of exploitation in the wild is mentioned. Whether the exploit code itself is published is not stated; a checker script is offered.

“When the device is unplugged, the kernel runs a command supplied by the device, as root.”

— Drivesec, usb2shell.com