USB2Shell (CVE-2026-98232): a USB stick can get root on an unpatched Linux machine before anyone logs in. How to check yours
USB2Shell (CVE-2026-98232) is a bug in the Linux kernel’s SCSI code that a crafted USB device reaches as soon as it’s plugged in. Nobody has to log in, mount the drive or click anything. Drivesec published a write-up on November 30 showing a programmable USB tool (a Cynthion) running a command of its choice as root on a Debian machine with kernel 6.12.22 and KASLR on.
The kernel fix landed in September and the CVE was published on October 6. Most distributions have a fixed kernel already. A machine is exposed when it hasn’t installed it, or installed it and never rebooted. The attacker needs a USB port, and I haven’t seen a report of it being used.
What the bug is
When a USB storage device is plugged in, the kernel scans it to find out what kind of disk it is. If the device says it’s an ATA disk that supports Command Duration Limits, the kernel’s scsi_cdl_enable() reads the device’s answer into a 64-byte buffer on the stack. It uses the lengths the device reports and doesn’t check them. A device that lies about those lengths can read up to 64 bytes of kernel stack and change one byte. Drivesec turned that one byte into root.
The scan runs before anything mounts. It happens on a locked screen and on a machine nobody’s signed in to. A rule that only stops users mounting drives acts after it.
The code arrived in Linux 6.5. Upstream fixed it in 6.6.158, 6.12.112, 6.18.54, 7.2.8 and 7.3.
Where the fixes are
| Distribution | Status on December 1 |
|---|---|
| Ubuntu 26.04 | Fixed in 7.0.0-42.42 |
| Ubuntu 24.04 | Fixed in 6.8.0-149.149. The 7.0 HWE kernel is fixed in 7.0.0-42.42~24.04.1 |
| Ubuntu 22.04 | The default 5.15 kernel isn’t affected. The 6.8 HWE kernel is fixed in 6.8.0-149.149~22.04.1 |
| Debian 13 (trixie) | Fixed in 6.12.113-1 (DSA-6568-1) |
| Debian 12 (bookworm) | The default 6.1 kernel isn’t affected. The linux-6.12 backport is fixed in 6.12.113-1~deb12u1 (DLA-4850-1) |
| RHEL 9 | Fixed in 5.14.0-741.24.1.el9_9 (RHSA-2026:100662). Rocky 9.9 has it in 5.14.0-741.28.1.el9_9 |
| RHEL 10 | Fixed in 6.12.0-264.19.1.el10_3 |
| RHEL 8 | Not affected |
Don’t go by the version number on RHEL. RHEL 9’s kernel says 5.14, older than 6.5. Red Hat backported Command Duration Limits into it, and the bug came with it. My Rocky 9.8 VM (5.14.0-687.64.1.el9_8) has the vulnerable function and no fix.
Check one machine
Look for the fix in the running kernel’s changelog. On Ubuntu:
zgrep -cE 'CVE-2026-98232|Validate MODE SENSE lengths in scsi_cdl_enable' /usr/share/doc/linux-modules-$(uname -r)/changelog.Debian.gz
On Debian the changelog is in /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz. On RHEL, Rocky and Alma:
rpm -q --changelog kernel-core-$(uname -r) | grep -cE 'CVE-2026-98232|Validate MODE SENSE lengths in scsi_cdl_enable'
Anything above 0 means the kernel you’re running has the fix. If it says 0, check whether your kernel has the vulnerable code:
sudo grep -cw scsi_cdl_enable /proc/kallsyms
0 there means your kernel doesn’t have the code. Debian 12’s 6.1 kernel is one of those.
Check whether a USB stick can reach it. It needs a USB port and a USB storage driver the kernel can load:
ls -d /sys/bus/usb/devices/usb*
modprobe -n -v usb-storage
No usb entries means there’s no USB controller. That’s normal on a Hyper-V VM. If modprobe prints an insmod line, the driver loads when a stick goes in. USBGuard keeps an unknown device from getting a driver. So does setting authorized_default to 0 on the USB root hubs.
The stopgap
On machines that can’t take the fixed kernel yet and don’t need USB drives, stop the two USB storage drivers from loading. Put this in /etc/modprobe.d/usb2shell.conf:
install usb-storage /bin/true
install uas /bin/true
Then reload udev and unload the drivers if they’re already in:
sudo udevadm control --reload
sudo modprobe -r uas usb_storage
Don’t skip the udevadm line. udev loads drivers through its own cached copy of the modprobe settings. On my Ubuntu VM, after I removed the block again, a USB stick got no driver for 45 seconds until I reloaded udev. modprobe -r fails while a drive is plugged in. Until that drive comes out or the machine reboots, the loaded driver takes new drives too.
USB keyboards, mice and headsets keep working. USBGuard is the option for machines where people need USB drives, since it can allow the ones you know.
What I found in the lab
Hyper-V VMs have no USB, so I plugged a fake USB stick into my Ubuntu 26.04 VM. It’s a mass-storage gadget on the kernel’s dummy_hcd controller. The bug needs the stick to get a driver first, and the gadget shows whether it does. It doesn’t send the malicious answers.
- On kernel
7.0.0-38, which predates Ubuntu’s fix, the stick loadedusb-storageanduasand showed up as a disk. - With the two modprobe lines in place, the stick showed up on the USB bus and got no driver and no disk.
- With only the
usb-storageline,uasfailed to load too, because it depends onusb-storage. I’d still list both. - After I took the block off, the stick worked again only once udev was reloaded.
My Rocky 9.8 VM had the vulnerable function on 5.14.0-687.64.1 and no fix in its changelog. The Rocky 9.9 kernel, 5.14.0-741.28.1, lists CVE-2026-98232. Rocky’s kernel has no gadget support, so the fake stick only ran on Ubuntu. With the two modprobe lines on Rocky, loading either driver by name or by its USB device alias ran /bin/true and loaded nothing.
What RFF’s Device Control does about it
RFF’s Device Control has two ways to block USB storage on Linux. A block for standard users is a polkit rule that stops them mounting drives. The kernel scans the stick before that rule ever applies. A block for everyone writes install usb-storage /bin/true, and that keeps uas out too. It didn’t unload a driver that was already loaded, though, or reload udev when the block came off. Linux agent 1.3.243 does both.
Doing it with RFF
The RFF Script Library has two new Linux entries. USB2Shell (CVE-2026-98232) - USB Storage Kernel Exposure Check (Linux) reads the running kernel’s changelog, checks that the vulnerable function is in the kernel, and reports EXPOSED only when a USB storage driver can load and devices are authorized automatically. It also says when a fixed kernel is installed but not running. Block USB storage drivers (USB2Shell stopgap) writes the two modprobe lines, reloads udev, unloads the drivers, and can be undone. I ran both on the lab VMs. On kernel 7.0.0-38 the check said EXPOSED, the block kept the stick from getting a driver, and Undo brought it back.
Start free and you can run the USB2Shell check on every Linux machine at once.
RFF is free for your first 100 endpoints: getrff.com.
Sources
- Drivesec: usb2shell (the write-up, the Cynthion proof of concept, the timeline)
- CVE-2026-98232 record (the kernel’s description, introduced in 6.5, fixed versions)
- Ubuntu: CVE-2026-98232 (fixed kernels for 26.04, 24.04 and the 22.04 HWE kernel)
- Debian security tracker: CVE-2026-98232 (bookworm not affected, DSA-6568-1, DLA-4850-1)
- Red Hat: CVE-2026-98232 (Important, RHEL 8 not affected, RHSA-2026:100662 for RHEL 9)
- The Hacker News (the stopgaps, Sashiko’s part in finding it)
- Upstream fix (scsi: core: Validate MODE SENSE lengths in scsi_cdl_enable())
Comments
Comments use GitHub Discussions, so you'll need a GitHub account to post. Corrections are especially welcome.