learn deep. ship safe.Practice testsFollow ByteMunSubscribe
Cyber SecurityTrending #2

USB2Shell: A Crafted USB Device Can Root Unpatched Linux 6.5+

Drivesec's USB2Shell bug lets a crafted USB device get root on unpatched Linux 6.5+ kernels, with no login or mount. Here is how to check your kernel, which versions are fixed, and how to block it until you can reboot.

USB2Shell exposure check flow: kernel 6.5 or later, vendor fix installed, USB storage driver present, reachable USB port
A system is exposed only if all three of Drivesec's conditions are true: an unfixed 6.5+ kernel, USB storage support, and a reachable USB port.

Status: USB2Shell (CVE-2026-98232) is fixed upstream since 9 Sep 2026 and in Ubuntu, Debian and Red Hat kernels (a few Ubuntu NVIDIA kernels are still pending); no publicly reported exploitation has been identified as of 1 Dec 2026.

A specially crafted USB storage device can potentially achieve root-level code execution on a vulnerable Linux system just by being plugged in. Nobody has to log in, mount a drive or click anything. That is the finding security firm Drivesec published on 30 November 2026 under the name USB2Shell. The bug sits in the kernel's SCSI core code for Command Duration Limits (CDL), a feature for ATA hard drives, and it runs during automatic device scanning. The attacker needs physical access to a USB port, and Drivesec calls its exploit "probabilistic": it can take several tries, but failed tries do not crash the machine.

Who is exposed to USB2Shell? The three conditions

Drivesec says a system is exposed only when all three of these are true:

  1. It runs Linux 6.5 or later without the fix.

  2. It has USB mass storage support, usb-storage or uas (USB Attached SCSI), either built into the kernel or loaded automatically.

  3. Someone can plug a device into one of its USB ports.

Condition 1 is about the vulnerable code, not the version number: distribution and vendor kernels can carry it under an older-numbered version, as the fix tables below show. If any one of the three is false, the attack described by Drivesec does not apply. That is why "any USB stick can hack Linux" is wrong. An ordinary flash drive does nothing here. The device must be built to lie to the kernel. Drivesec's demo used Cynthion, an open-source programmable USB tool, against a stock Debian kernel with KASLR (kernel address space layout randomization) turned on.

Drivesec lists the kinds of devices that often meet all three conditions: car infotainment and telematics units, EV chargers, point-of-sale terminals, kiosks, in-flight entertainment, industrial HMIs (the touch panels that run machines) and smart-home hubs. These are examples of exposure, not confirmed victims. Ordinary Linux laptops and desktops qualify too if they run an affected kernel, since the demo ran on a PC.

Cloud servers are a different case. A rented VPS or cloud VM has no USB port a stranger can reach. Red Hat notes that the realistic paths are physical access or the ability to attach virtual devices to a guest, which on a public cloud means the provider or whoever controls the VM's configuration. Docker containers share the host's kernel, so the host kernel and the host's ports are what count.

How to check your kernel for USB2Shell (CVE-2026-98232) in 60 seconds

Four checks answer the three conditions. Run them on each machine that matters.

# 1. Which kernel is running?
uname -r

# 2. Which kernel package is installed? (Debian/Ubuntu, then RHEL/Fedora)
dpkg -l | grep linux-image
rpm -q kernel

# 3. Is USB storage built in (=y), a module (=m) or absent?
grep -E 'CONFIG_USB_STORAGE=|CONFIG_USB_UAS=' /boot/config-$(uname -r)
lsmod | grep -E 'usb_storage|uas'

# 4. Are new USB devices authorized automatically? (1 = yes, the default)
cat /sys/bus/usb/devices/usb*/authorized_default

A worked example: ByteMuni's own Ubuntu 22.04 server

ByteMuni ran these checks on 1 December 2026 on one of its servers running Ubuntu 22.04.5 LTS. uname -r returned 6.8.0-149-generic. That is not Ubuntu 22.04's base 5.15 kernel. It is the HWE (hardware enablement) 6.8 kernel line, which Ubuntu offers to 22.04 users who want newer hardware support.

The installed kernel version was 6.8.0-149.149~22.04.1. Ubuntu lists exactly that version as the fix for the linux-hwe-6.8 package on 22.04, so the server is patched against USB2Shell. Note that uname -r alone was not enough to tell: it shows the ABI number (6.8.0-149), not the full package version you compare against the advisory.

One trap when matching versions on Ubuntu: the advisory names source packages such as linux-hwe-6.8, while dpkg shows binary packages such as linux-image-6.8.0-149-generic, plus a meta package such as linux-image-generic-hwe-22.04 that only points to the newest kernel and can carry a different version string. Compare the version of the package for the kernel you are actually running:

apt-cache policy linux-image-$(uname -r)

Read the Installed: line and compare it with the vendor's fixed version. Ignore the Candidate: line for this check: it shows the version apt would install, not the one you are running. Even a newer installed package only protects you after a reboot into it.

The rest of the output showed why patching mattered. /boot/config had CONFIG_USB_STORAGE=m and CONFIG_USB_UAS=m, so both drivers are modules that load on their own when a storage device is plugged in. usb_storage was not loaded at the time, which proves nothing, because it loads on demand. authorized_default was 1, the default, meaning any new USB device is accepted.

The lesson for admins: Ubuntu says 22.04's base linux package is not affected, but its HWE 6.8 line is. The same OS release can be safe or exposed depending on which kernel line it runs. Debian 12 (bookworm) has the same split. Its standard linux package (6.1) is marked not affected because the vulnerable code is not present. The separately maintained linux-6.12 package is affected and was fixed in DLA-4850-1. Drivesec's demo target, 6.12.22+bpo-amd64, is a 6.12 kernel from Debian's backports channel, which is a third source again.

Why version numbers can mislead

Distributions often backport a fix into an older-numbered kernel. Red Hat's fix for RHEL 9 sits in a kernel numbered 5.14, which is far below 6.5 on paper. So compare your installed package against your vendor's fixed version, not against the upstream list. Drivesec warns that its own checker script, usb2shell-check.sh, can flag a kernel that has the fix backported for this reason. It also asks users to read the script before running it.

Fixed and unaffected kernels: upstream, Ubuntu, Debian and RHEL

"Not affected" means the vulnerable code was never in that kernel. "Fixed" means it was there and has been patched. Versions below are the first USB2Shell-fixed version each vendor lists; anything newer from the same line also has the fix.

Upstream stable kernels (per Drivesec)

BranchStatusFirst fixed release
6.1.y and olderNot affected (code added in 6.5)n/a
6.6.yFixed6.6.158
6.12.yFixed6.12.112
6.18.yFixed6.18.54
7.2.yFixed7.2.8
MainlineFixed7.3

The upstream fix is commit 3d676e458fe0, "scsi: core: Validate MODE SENSE lengths in scsi_cdl_enable()". Drivesec lists no fix for other 6.5+ branches, so a kernel on one of those still has the USB2Shell bug and should move to a fixed branch or its vendor's patched build. Teams that build their own kernels, as many embedded and automotive vendors do, can backport that commit.

Ubuntu

ReleaseKernel packageStatusFixed version
26.04 LTSlinuxFixed7.0.0-42.42
24.04 LTSlinuxFixed6.8.0-149.149
24.04 LTSlinux-lowlatencyFixed6.8.0-149.149.1
24.04 LTSlinux-hwe-7.0Fixed7.0.0-42.42~24.04.1
22.04 LTSlinux (5.15)Not affectedn/a
22.04 LTSlinux-hwe-6.8Fixed6.8.0-149.149~22.04.1
22.04 LTSlinux-lowlatency-hwe-6.8Fixed6.8.0-149.149.1~22.04.1
20.04 LTS and olderlinuxNot affectedn/a
24.04 LTSlinux-aws / linux-azure / linux-gcpFixed6.8.0-1069.74 / 6.8.0-1073.82 / 6.8.0-1073.81
26.04 LTSlinux-aws / linux-azure / linux-gcpFixed7.0.0-1016.17 / 7.0.0-1020.21 / 7.0.0-1016.18
26.04 LTSlinux-nvidia, linux-nvidia-bosStill vulnerable, fix in progresspending
24.04 LTSlinux-azure-nvidia, linux-nvidia-7.0Still vulnerable, fix in progresspending
24.04 LTSlinux-nvidia / linux-nvidia-lowlatencyFixed6.8.0-1067.70 / 6.8.0-1067.70.1
22.04 LTSlinux-nvidia-6.8Fixed6.8.0-1068.71~22.04.1

Ubuntu's CVE page lists more flavors (Oracle, IBM, Raspberry Pi, realtime, FIPS and others) with their own fixed versions. Check the row for the exact package you run.

Debian

ReleaseSource packageStatusFirst fixed version
12 bookwormlinux (6.1)Not affected (vulnerable code not present)n/a
12 bookwormlinux-6.12Fixed6.12.113-1~deb12u1 (DLA-4850-1)
13 trixielinuxFixed6.12.113-1 (DSA-6568-1)
forky / sidlinuxFixed7.2.8-1

The Debian security tracker shows two sets of numbers, which can look like a conflict. Its first table lists the version currently in each suite, such as 6.12.117-1 in trixie and 6.12.118-1 in trixie-security. Its second table lists the first version that carried the fix, 6.12.113-1. Both are fixed; the current versions are simply newer.

Red Hat Enterprise Linux

ProductAdvisory (date)Fixed kernel
RHEL 10 (10.3 stream)RHSA-2026:102168 (23 Nov 2026)kernel-6.12.0-264.19.1.el10_3
RHEL 10.2 Extended Update SupportRHSA-2026:102090 (23 Nov 2026)kernel-6.12.0-211.76.1.el10_2
RHEL 9.8 (EUS stream)RHSA-2026:102710 (25 Nov 2026)kernel-5.14.0-687.69.1.el9_8
RHEL 9 (9.9 stream)Advisory number not confirmedkernel-5.14.0-741.24.1.el9_9 (listed in Red Hat's VEX data for this CVE)
RHEL 8Not affected: vulnerable code not present, per Red Hat's CVE page

How fast each distribution shipped is part of a wider pattern ByteMuni tracked in its Linux distro CVE patch-speed report.

USB2Shell exposure check flow: kernel 6.5 or later, vendor fix installed, USB storage driver present, reachable USB port
A system is exposed only if all three of Drivesec's conditions are true: an unfixed 6.5+ kernel, USB storage support, and a reachable USB port.

Has CVE-2026-98232 been exploited, and how severe is it?

No publicly reported exploitation of USB2Shell has been identified as of 1 December 2026. The Hacker News reported that day that no real-world attacks or victims had been found. That is not proof the bug has never been used: a physical attack on a single kiosk or charger may never be noticed or reported.

Two separate demonstrations exist, and they show different things.

Drivesec's physical demo. Drivesec says it got root on real hardware: a Cynthion device attacking a stock Debian 6.12.22+bpo-amd64 kernel over a real USB port, with KASLR enabled. In its demo video the first two attempts miss and the third succeeds. The Hacker News reports the attack "did not always work" on the test machine, and Drivesec gives no success rate.

The proof in the CVE description. The CVE description shown on Ubuntu's page documents a different, narrower proof. On an upstream 7.3-rc1 build, a build-specific proof in a one-vCPU QEMU virtual machine, using Raw Gadget (a kernel interface for emulating USB devices), ran a fixed command inside the guest and created a root-owned (UID 0) marker during automatic enumeration, with KASLR and NX enabled. It was tuned to one build in an emulated setup, so it shows the bug can be exploited; it does not show one exploit working across kernels.

The severity ratings differ because the scorers describe the attack differently:

Who scored itRatingAttack vector in the score
UbuntuCVSS v4.0 5.4, priority MediumPhysical (AV:P)
Red HatCVSS v3.1 8.4, severity ImportantLocal (AV:L)
kernel.org (the CVE issuer)No score in the CVE recordn/a

Ubuntu's score treats the attack as needing a hand on the machine. Red Hat's statement also covers attackers who can attach virtual devices to a guest VM, which explains its higher rating. Neither is wrong; they answer different threat models. Pick the one closer to how your machines are actually reached.

How a USB device turns a length field into root

The USB2Shell chain below follows the kernel's own CVE description and Drivesec's write-up. Drivesec has not published every step of its exploit on its page, and the gaps are marked.

  1. Plug-in starts a scan. The device presents itself as USB storage. The usb-storage or uas driver hands it to the SCSI layer, which scans it automatically. Because the device claims to be an ATA drive that supports CDL, the kernel calls scsi_cdl_enable().

  2. The kernel reads a settings page from the device. It sends a MODE SENSE command and copies the reply into a 64-byte buffer on the kernel stack. The reply carries its own length fields, which tell the kernel where the useful page starts.

  3. The lengths do not add up. The device reports a total length shorter than its header plus block descriptors. Subtracting the larger number from the smaller one in unsigned arithmetic wraps around to a huge value, which the code then caps at 64. Drivesec describes this as a subtraction that can wrap to 64. The page pointer now lands past the end of the buffer.

  4. A small write outside the buffer. During the scan, the kernel modifies a byte in the page and writes it back. Per the CVE description, this clears the low two bits of an out-of-bounds stack byte the device chooses.

  5. A leak back to the device. The kernel then sends a MODE SELECT command containing up to 64 bytes from outside the buffer. That hands kernel stack contents to the attacker's device.

  6. KASLR falls. Drivesec says the leaked bytes let it break KASLR, which normally hides where kernel code sits in memory. The page does not spell out how.

  7. Root on unplug. Drivesec says it builds fake kernel structures to turn the tiny write into a controlled one, and that when the device is unplugged the kernel runs a command supplied by the device, as root. Its demo runs whoami and uname. These steps are described, not published as code.

USB2Shell attack chain in four steps: plug in, stack leak, small write, root on unplug
How the attack works, as described by Drivesec and the kernel's CVE text: auto scan, a stack leak of up to 64 bytes, a small out-of-bounds write, then root on unplug.

The bug class: trusting a length the device sent

This is an unvalidated-length bug that turns into an integer underflow. Code reads a length field from outside input and does arithmetic with it before checking it is sane. With unsigned numbers there are no negatives, so 10 minus 12 does not give -2; it wraps to a very large value. Any later step that uses that value as a size or offset can then read or write past the end of a buffer.

Kernel drivers are especially exposed to this because hardware is often treated as trusted. A USB device can be anything that speaks the protocol, so every field it returns is attacker input. The fix follows the standard rule: cap the length at the buffer size, validate the header and block-descriptor lengths before using them, and require enough bytes to reach the CDL field.

The bug was also found by machine. Drivesec credits Sashiko AI Review, Google's AI code-review system for the kernel, with first reporting it on the linux-scsi mailing list, and says it found the bug independently, wrote the fix and built the exploit itself. That fits the trend covered in ByteMuni's piece on AI finding security bugs.

Why Android only leaks memory

Drivesec says Android kernels 6.6 and later show the leak but not the write. The builds it checked, Android's Generic Kernel Image (GKI) and the Samsung Galaxy A16's shipping kernel, are compiled with bounds checks that keep the write inside the buffer. A leak still exposes kernel memory, but on its own it did not give Drivesec root on those phones.

Can't reboot into a new kernel yet? Three ways to block it, and what each breaks

A kernel update needs a reboot. On a kiosk fleet or a factory line that may wait for a maintenance window. Drivesec suggests three stopgaps against USB2Shell. The commands below come from the kernel, modprobe.d and USBGuard documentation, because Drivesec's page gives none.

1. Stop USB storage drivers from loading

This removes condition 2. Create /etc/modprobe.d/block-usb-storage.conf with:

blacklist usb_storage
blacklist uas
install usb_storage /bin/false
install uas /bin/false

The blacklist lines make modprobe ignore the drivers' device aliases, which is how they auto-load on plug-in. The install lines make an explicit load fail as well. Then unload them if loaded and rebuild the initramfs so the rule also applies early in boot:

sudo modprobe -r uas usb_storage
sudo update-initramfs -u    # Debian/Ubuntu
sudo dracut -f              # RHEL/Fedora

Trade-off: USB drives, card readers and USB hard disks stop working on that machine. Trap: if your config shows CONFIG_USB_STORAGE=y (built in, common on custom embedded kernels), these files do nothing. Only a rebuilt or patched kernel helps there.

2. Allow-list known devices with USBGuard

USBGuard is a daemon that authorizes USB devices against a rule list. Its documentation gives this workflow to allow only what is plugged in now:

sudo usbguard generate-policy > rules.conf
# review rules.conf, then:
sudo install -m 0600 -o root -g root rules.conf /etc/usbguard/rules.conf
sudo systemctl restart usbguard

Trade-off: every new keyboard, scanner or barcode reader needs a rule before it works. Trap: rules match what a device reports about itself, and a programmable device can report another device's IDs. The usbguard man page notes that port-specific rules make bypassing harder; on a kiosk, tie rules to the internal port each peripheral uses.

3. Turn off automatic USB authorization

The kernel's USB authorization docs describe a per-bus switch. Setting it to 0 means new devices stay unauthorized until an admin approves them; setting it to 2 authorizes only internal ports:

# lock down every USB bus
for f in /sys/bus/usb/devices/usb*/authorized_default; do echo 0 | sudo tee "$f"; done

# approve one device later (replace DEVICE with its sysfs name, e.g. 1-2)
echo 1 | sudo tee /sys/bus/usb/devices/DEVICE/authorized

Trade-off: plug-and-play stops, including keyboards and mice plugged in after the change. Trap: sysfs settings reset at reboot, so this needs a boot-time script or USBGuard to persist.

What logs can and can't tell you

Drivesec's demo shows the device in the target's kernel log, so journalctl -k | grep -iE 'usb-storage|uas' will list storage devices attached since boot. An unexpected entry on a kiosk or charger is worth a look. It proves nothing on its own, and a clean log does not prove a machine was never touched, especially if the attacker had root afterward.

Who should patch first

  1. Kiosks, POS terminals, EV chargers, car and industrial systems. USB ports are often reachable by the public or by many workers, devices sit unattended, and their kernel updates usually come from the device vendor rather than a distribution's update tool. Ask your vendor whether commit 3d676e458fe0 is in their build.

  2. Shared offices, labs and college computer centers. Many people can reach the ports, and desktops on Ubuntu 24.04 or newer, or 22.04 with the HWE kernel, may be on an affected line.

  3. Personal laptops and workstations. The risk needs someone with a crafted device and a few minutes at your machine. Install the update with your normal patch cycle and reboot.

  4. Cloud VMs, VPS and Kubernetes nodes. No public USB port. Patch on schedule; the attack path here is limited to whoever can attach virtual devices to the VM.

For USB2Shell, ordering by reachable attack surface, not only by score, is the same approach ByteMuni used for nginx2root (CVE-2026-123007). The difference here is that the "network" is a USB port.

Timeline: from the first report to public disclosure

Date (2026)Event
UndatedSashiko AI Review reports the bug on linux-scsi (Drivesec credits it as the first report but gives no date)
26 AugDrivesec finds the bug independently
28 AugDrivesec runs root commands on physical hardware
2 SepDrivesec reports privately to the SCSI maintainers
4 SepPatch sent to linux-scsi
9 SepFix committed upstream
25 SepCVE reserved
6 OctCVE-2026-98232 published by kernel.org, the Linux kernel's CVE issuer
23–25 NovRed Hat ships RHEL 10 and RHEL 9.8 fixes
30 NovDrivesec publishes USB2Shell details and demo
1 DecThe Hacker News reports no known attacks or victims

What to do today, by setup

  • Kernel numbered below 6.5: upstream Linux kernels older than 6.5 do not contain the vulnerable code. However, distribution and vendor kernels may backport it, so check the vendor's CVE status rather than relying on the version number alone. Ubuntu 22.04's base kernel, Ubuntu 20.04 and Debian 12's standard 6.1 kernel are listed as not affected; RHEL 9's 5.14-numbered kernel was affected and needs its fix.

  • Kernel 6.5+ from a distribution: install the vendor kernel listed above or newer, then reboot. Confirm with dpkg -l or rpm -q kernel, not uname -r alone.

  • Ubuntu NVIDIA kernels still marked vulnerable: no fix yet per Ubuntu; use one of the three blocks above until it lands.

  • Vendor or custom embedded kernel: ask the vendor for commit 3d676e458fe0, or backport it. Until then, block storage drivers if the device never needs USB drives.

  • Can't reboot this week: pick the block that fits. Module blocking for machines that never use USB drives; USBGuard for kiosks with fixed peripherals; authorized_default=0 as a quick temporary lock.

  • Cloud-only fleet: patch in the normal cycle and review who can attach devices to your VMs.

Frequently asked questions

Who is exposed to USB2Shell? The three conditions?

Drivesec says a system is exposed only 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 (USB Attached SCSI), either built into the kernel or loaded automatically. Someone can plug a device into one of its USB ports.

How to check your kernel for USB2Shell (CVE-2026-98232) in 60 seconds?

Four checks answer the three conditions. Run them on each machine that matters.

Why version numbers can mislead?

Distributions often backport a fix into an older-numbered kernel. Red Hat's fix for RHEL 9 sits in a kernel numbered 5.14, which is far below 6.5 on paper. So compare your installed package against your vendor's fixed version, not against the upstream list. Drivesec warns that its own checker script, usb2shell-check.sh , can flag a kernel that has the fix backported for this reason. It also asks users to read the script before running it.

Has CVE-2026-98232 been exploited, and how severe is it?

No publicly reported exploitation of USB2Shell has been identified as of 1 December 2026. The Hacker News reported that day that no real-world attacks or victims had been found. That is not proof the bug has never been used: a physical attack on a single kiosk or charger may never be noticed or reported.

How a USB device turns a length field into root?

The USB2Shell chain below follows the kernel's own CVE description and Drivesec's write-up. Drivesec has not published every step of its exploit on its page, and the gaps are marked. Plug-in starts a scan. The device presents itself as USB storage. The usb-storage or uas driver hands it to the SCSI layer, which scans it automatically. Because the device claims to be an ATA drive that supports CDL, the kernel calls scsi_cdl_enable() . The kernel reads a settings page from the device. It sends a MODE SENSE command and copies the reply into a 64-byte buffer on the kernel stack. The reply carries

Why Android only leaks memory?

Drivesec says Android kernels 6.6 and later show the leak but not the write. The builds it checked, Android's Generic Kernel Image (GKI) and the Samsung Galaxy A16's shipping kernel, are compiled with bounds checks that keep the write inside the buffer. A leak still exposes kernel memory, but on its own it did not give Drivesec root on those phones.

How we research, write and check articles

Written by

· SEO Strategist

Umesh Kumar is a SEO Strategist. He maintains production systems with millions of readers, where a missed patch is an incident rather than a headline. He started ByteMuni to publish clear, source-checked guides for working developers.