Usb2shell: Root on Linux from a USB Plug-In
usb2shell is a Linux kernel vulnerability triggered by a specially crafted USB device. It is called the physical version of a “shell” bug because an attacker must plug hardware into a USB port, rather than send a crafted network request. The article compares it with remote flaws such as PHP2Shell and Java4Shell. The bug runs when Linux automatically scans a new SCSI device that reports itself as an ATA device with Command Duration Limits support. The kernel reads a mode page into a 64-byte stack buffer, but does not properly validate lengths supplied in the device’s reply. That can expose kernel memory and overwrite one stack byte. The article says no user action or disk mount is needed. This matters for Linux devices with accessible USB ports, including kiosks, car systems, EV chargers and industrial equipment. A proof of concept used a Cynthion USB device to exploit a Debian system.
What is usb2shell, and why is it described as a physical version of a shell vulnerability?
usb2shell is a Linux kernel vulnerability triggered by a specially crafted USB device. It is called the physical version of a “shell” bug because an attacker must plug hardware into a USB port, rather than send a crafted network request. The article compares it with remote flaws such as PHP2Shell and Java4Shell.
The bug runs when Linux automatically scans a new SCSI device that reports itself as an ATA device with Command Duration Limits support. The kernel reads a mode page into a 64-byte stack buffer, but does not properly validate lengths supplied in the device’s reply. That can expose kernel memory and overwrite one stack byte.
The article says no user action or disk mount is needed. This matters for Linux devices with accessible USB ports, including kiosks, car systems, EV chargers and industrial equipment. A proof of concept used a Cynthion USB device to exploit a Debian system.
Which Linux systems are exposed, and what conditions must be true for them to be vulnerable?
The article lists car infotainment and telematics units, EV chargers, point-of-sale terminals, kiosks, in-flight entertainment, industrial HMIs and smart-home hubs as examples of Linux systems that may have USB ports strangers can reach. The examples are not automatically vulnerable; the stated conditions must all apply.
First, the system must run Linux 6.5 or later without the fix. Second, it must have USB mass-storage support, through usb-storage or uas, either built into the kernel or loaded automatically. Third, someone must be able to plug a device into one of its USB ports. If any condition is absent, the article’s exposure criteria are not met.
The article notes that Android is different: affected Android kernels on 6.6 and later still leak stack contents, but the builds checked used compiler bounds checks to keep the write within the buffer. Vendors may backport fixes without changing version numbers, so check the vendor advisory or source tree rather than relying on the version alone.
How can a USB device trigger the bug during an automatic scan, before anyone mounts or opens it?
When Linux discovers a new SCSI device during its automatic scan, it may check whether the device claims to be an ATA device with Command Duration Limits support. If it does, the kernel calls scsi_cdl_enable() to read a mode page. This happens before userspace sees a disk, according to the article.
The device controls the reply’s length fields. The vulnerable code uses those fields to calculate how much data to copy and where the data begins, without validating them first. The length calculation can wrap, while the calculated pointer can land beyond the 64-byte buffer. Those errors allow the device to influence a kernel memory read and a one-byte overwrite.
Because this processing occurs as part of automatic device discovery, no user interaction or mount is needed. Plugging in a crafted device can be enough to trigger the bug. The article’s proof of concept used a USB device to exploit this scan on a PC running Debian’s 6.12.22+bpo-amd64 kernel.
How much kernel memory can the device read, and what can it overwrite?
The kernel reads the device’s mode page into a 64-byte stack buffer. Because the reply’s length fields are used without proper checks, the length calculation can wrap and the pointer to the data can point past the buffer. The result is both a disclosure and a write, not just a malformed read.
The article says the device can receive up to 64 bytes of kernel stack contents. It can also clear one stack byte at an offset it picks. The article does not describe that single-byte change as an arbitrary write by itself; the researchers’ exploit chain used additional steps to turn it into a controlled write.
These effects occur during the automatic scan, before userspace sees a disk. The Android builds checked by the researchers still leaked stack contents, but compiler bounds checks kept the write inside the buffer. For the vulnerable Linux systems described, the one-byte overwrite is part of the risk alongside the memory leak.
How can a memory leak and a one-byte overwrite ultimately let the device run a command as root?
The article describes an exploit chain, rather than claiming that the one-byte overwrite alone immediately runs a command. First, the device’s leak reveals up to 64 bytes of kernel stack contents. The researchers say this leak lets them break KASLR, a kernel address-randomization protection.
Next, the chain builds fake kernel structures. Those structures let the researchers turn the one-byte overwrite into a controlled write. The proof of concept ran on a Cynthion USB device plugged into a PC with a stock Debian 6.12.22+bpo-amd64 kernel. When the USB device was unplugged, the kernel ran a command supplied by the device as root.
The article stresses that the exploit is probabilistic. It also says failed executions do not trigger a crash. The exploit demonstrates a possible path from the memory leak and overwrite to root command execution, but the article does not claim that every attempt will succeed or that every exposed system has been exploited.
What fixes the vulnerability, and what can operators do if they cannot update immediately?
The article’s primary fix is to update to a fixed kernel. For vendor kernels, it names upstream commit 3d676e458fe0, “scsi: core: Validate MODE SENSE lengths in scsi_cdl_enable(),” as the fix to backport. It also lists stable backport commits and advises checking a vendor’s advisory for CVE-2026-98232 or looking for the fix in the source tree.
To assess a system, operators can download, inspect and run the provided checker. A version number alone may not settle the question because distributions and device vendors can backport fixes without changing that number. The checker’s result should therefore be checked against vendor information or source code.
The article says, “If you can’t update yet, these reduce exposure,” but gives no measures after that line. Since its exposure criteria require someone to plug into a port, limiting access to USB ports is a reasonable interim inference, not a listed article recommendation. The article provides no further specific temporary mitigations.
What is the kernel stack, and why can a memory error there affect the whole system?
The article does not explain what a kernel stack is. In general computing terms, a stack is a region of memory used to hold temporary information for active function calls. A kernel stack is used while the operating system’s kernel performs work. This background helps explain why the bug’s buffer matters, but it is general knowledge rather than a definition given in the article.
In usb2shell, scsi_cdl_enable() reads a mode page into a 64-byte stack buffer. The device’s unchecked length fields can make the kernel send up to 64 bytes of stack contents back to the device and clear one stack byte at a chosen offset. The flaw therefore affects memory used during kernel operations, not just data on a disk.
The article’s researchers used the leak to break KASLR and combined the overwrite with fake kernel structures to achieve a controlled write. Their proof of concept ultimately ran a device-supplied command as root when unplugged. The exploit is probabilistic, and failed attempts do not crash the system, according to the article.
This brief was written by AI from the original reporting and checked by other models. Names, figures and quotes come from the source; read it for full context.
Read more in the JupiteX app
Pulse is free. New stories every 4 hours, each one broken into the questions that explain it.
Or read more news on the web