lefteros_by SomniusX
EL ↗Say hello

LEFTEROS / PERSONAL NOTES

USB2SHELL: a crafted USB device can get root on Linux

2 December 2026 / Lefteris Iliadis / SomniusX

USB2SHELL: a crafted USB device can get root on Linux

This year we've had PHP2Shell, Java4Shell, wp2shell and a few more "2shell" bugs. All of them were remote: you send a crafted request and get a shell. The new one, USB2SHELL (CVE-2026-98232), is the physical version. You don't send anything over the network. You plug a crafted USB device into the machine.

It was published on 30 November by two researchers from the Italian company Drivesec, Z3r0n37 and Alberto247, on their own site, and heise covered it on 2 December. The fix was committed upstream on 9 September, so this is mostly a question of whether your kernel already has it.

What happens when you plug it in

When Linux sees a new USB storage device, it scans it automatically. No user has to log in, nothing has to be mounted, nobody has to click anything. During that scan, if the device says it's an ATA disk with Command Duration Limits (CDL, a feature added in Linux 6.5), the kernel calls scsi_cdl_enable(). That function asks the device for a "mode page" with a MODE SENSE command, copies it into a 64-byte buffer on the kernel stack, and writes it back.

The problem: the lengths in the device's reply were used without checks. A device that reports header lengths that don't add up makes an unsigned subtraction wrap around, and the pointer ends up past the end of the buffer. In the researchers' words, the device can then read up to 64 bytes of kernel stack and clear one stack byte at an offset it chooses.

That sounds small. The researchers turned it into a full exploit, demonstrated on a stock Debian kernel: the leak breaks KASLR, the chain builds fake kernel structures that turn the one-byte write into a controlled write, and when the device is unplugged, the kernel runs a command supplied by the device, as root. heise adds that it also gets past the NX bit. The researchers call this brief access; it still has to cover both the plug-in and the unplug. The exploit is probabilistic, but a failed attempt doesn't crash the machine. In their demo video the first two tries miss quietly and the third runs whoami and uname as root.

Diagram: the USB2SHELL chain from plugging in the device to a root command on unplug
The chain as Drivesec describes it on usb2shell.com.
Still from the researchers' demo video: the attack device's log on the left, the target's kernel log on the right
From the researchers' demo: a Cynthion USB device against a stock Debian 6.12.22+bpo-amd64 kernel with KASLR on. From usb2shell.com.

Who is exposed

According to the researchers, a system is exposed when all three of these 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,
  • someone can plug a device into one of its USB ports.

That last point is why this matters more than "it needs physical access" suggests. The researchers list car infotainment and telematics units, EV chargers, point-of-sale terminals, kiosks, in-flight entertainment, industrial HMIs and smart-home hubs: Linux boxes with USB ports that strangers can reach, often with nobody watching. A laptop on your desk is the easy case.

On Android the bug is only a leak. Android kernels from 6.6 on are affected and the device still gets kernel stack contents back, but the builds the researchers checked use compiler bounds checks that keep the write inside the buffer.

Table: stable kernel branches and the first release with the fix
First fixed release per branch, from usb2shell.com. Fix commit 3d676e458fe0.

How to check, and why the version isn't enough

The researchers publish a checker script. Download it, read it, then run it. But it only compares kernel versions. Distributions backport fixes without changing the upstream version number, so a Debian, Ubuntu or RHEL kernel with an "old" number may already be fixed, and a vendor kernel on a device may not be fixed even if it looks recent.

So the reliable answer comes from your vendor: look for CVE-2026-98232 in your distribution's security tracker, or for commit 3d676e458fe0 ("scsi: core: Validate MODE SENSE lengths in scsi_cdl_enable()") in the kernel source you build from.

The scores don't agree either. Red Hat rates it 8.4, Important. Ubuntu gives it 5.4, Medium. NVD hadn't scored it yet when heise wrote about it. Same bug, same fix, two very different numbers. If a stranger can reach your USB ports, use the higher number.

What to do

  1. Update the kernel and reboot. This is the real fix.

  2. If you can't update yet, stop the attack surface from loading where you don't need USB storage. On a server, kiosk or appliance that never takes a USB stick:

    # /etc/modprobe.d/no-usb-storage.conf
    install usb-storage /bin/false
    install uas /bin/false
    

    Then rmmod uas usb-storage (or reboot). This only works if they're modules; if your kernel has them built in, you need a fixed kernel. If your distribution puts these modules in the initramfs, rebuild it (update-initramfs -u or dracut -f). And don't do this on a machine that boots from a USB disk: it won't boot.

  3. Allow-list USB devices with USBGuard, or set authorized_default=0 on the USB controllers, so the kernel doesn't scan devices nobody approved. You then have to authorise every device, keyboards included, so test it before using it on a machine you can only reach at its console.

  4. Look at the boxes you don't think of as computers. POS terminals, kiosks, chargers, HMIs. Ask their vendors whether their firmware has the fix. That's where an exposed USB port is most likely.

What I take from it

A sign reading: It has been 0 days since no new Linux exploit
The sign on the wall this year.

Two things. First, "requires physical access" isn't the comfort it used to be when Linux runs in so many public places. A USB port in a shopping mall kiosk is an attack surface. Second, look at how it was found: Sashiko AI Review reported the bug on the linux-scsi list in July, and Drivesec found it independently, wrote the fix and built the exploit. Automated review is finding real kernel bugs now, and the pace of "2shell" headlines suggests the counter on the sign won't move much.

Sources: usb2shell.com (Drivesec, 30 November 2026), heise online (2 December 2026), Red Hat CVE page, the fix commit.