How to Check Your Linux System for CVE-2026-98232 (USB2Shell) and Harden It

I have spent years plugging unknown USB drives into lab machines — firmware-updated routers, data-recovery sticks borrowed from strangers, and the occasional “do not insert” promotional drive. So when I read that a crafted USB device can make a Linux kernel run a command as root the moment it is plugged in, I did a double take. No login. No mount. No click. Just physics and a vulnerable kernel.

The bug is CVE-2026-98232, which the security team at Drivesec (Z3r0n37 and Alberto247) named usb2shell. It affects Linux 6.5 and later, which covers a very wide range of servers, desktops, and embedded boxes. This is a how-to: how to check whether your system is exposed, and what to do about it.

What usb2shell actually does

The bug lives in the Linux kernel’s SCSI core, in a function called scsi_cdl_enable(). When you plug in a USB storage device, the kernel scans it automatically. During that scan, the driver asks the device about something called Command Duration Limits (CDL) support. The vulnerable code reads a mode page into a 64-byte stack buffer and writes it back, but it trusts the lengths the device reports. A malicious device can then make the kernel leak up to 64 bytes of kernel stack and overwrite a single stack byte.

That is not a guaranteed breach on its own. It is a building block. By reading those stack bytes, an attacker can break KASLR — the kernel’s address-space layout randomization. Combined with the one-byte overwrite and a crafted fake kernel structure, the malicious USB device can run an arbitrary command as root the moment the device is unplugged. The researchers did exactly that on a stock Debian 6.12.22+bpo-amd64 kernel, over a real USB port, with KASLR enabled.

The good news is that it requires physical access. Someone has to plug the device into your machine. It is not a remote exploit. But on kiosks, car infotainment systems, point-of-sale terminals, EV chargers, and industrial HMIs, that is a realistic threat.

Backlit laptop keyboard reflecting a dark room, the physical vector for USB access
Backlit keyboard illustration by User:Colin, via Wikimedia Commons (CC BY-SA 4.0). Image used for the physical-access section of the USB2Shell / CVE-2026-98232 hardening tutorial.

Who is affected

A system is exposed when three things are true at once: 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 ports. The affected range is wide: Linux 6.5 shipped in late 2023, so anything installed in the last couple of years is likely affected.

Fixed kernels are: 6.6.158, 6.12.112, 6.18.54, 7.2.8, and 7.3.

Android is a different story. The bug leaks kernel stack contents on Android 6.6 and later, but the builds the researchers checked (Android GKI, and the Samsung Galaxy A16 shipping kernel) use compiler bounds checks that keep the write inside the buffer, so it does not become code execution on those devices. Still worth knowing.

For a practical, checklist-style approach to securing your own deployments, the checklist in How to Secure Your AI Deployments: A Practical Security Checklist applies equally to this kind of physical exposure.

The physical angle is not limited to desktops. The data-center backlash article AI’s physical footprint: the data center backlash covers how physical infrastructure is now a first-class attack surface, and a kernel bug you can reach with a $1 USB stick is part of that same story.

How to check your devices

The researchers published a small shell script that tells you whether your kernel is affected. Download it, read it, and then run it. You should always read scripts before running them.

curl -fsSLO https://usb2shell.com/tools/usb2shell-check.sh
less usb2shell-check.sh
sh usb2shell-check.sh

If your kernel is up to date, the script should say so. If not, it will flag the version. Distributions and device vendors often backport fixes without changing the version number, so a flag does not always mean you are stuck — check your vendor’s security advisory for CVE-2026-98232, or look for the fix commit in your source tree.

How to fix it

Update to a fixed kernel. That is the clean path.

If you cannot update yet, reduce exposure:

  1. Do not build or auto-load usb-storage and UAS on ports that untrusted people can reach, unless you actually need USB mass storage there. Fewer USB subsystems means a smaller attack surface.
  2. Use USB allow-listing. Tools like USBGuard let you restrict which USB devices can attach, and many embedded platforms let you set an authorized_default on the port. If the device is not on the allowed list, the kernel stops scanning it.
  3. For systems that do not need USB storage at all, consider blacklisting usb-storage and uas at boot.

These are mitigations, not fixes. Only a patched kernel closes the bug.

If you are interested in how the trust boundary works when you accept input you did not build yourself, the companion piece How to Detect Compromised npm Packages in Your Project walks through the same question at a different layer: trusting something you only got from the internet.

Patch cycles are the norm now. The Drivesec team found the bug in August, reported it privately at the end of September, and the fix was committed to the kernel tree in September. The industry is patching faster than ever — Google’s AI Just Fixed 1,072 Chrome Security Bugs is a good example of how much of that work stays invisible to end users.

This story also fits a pattern: attacks that used to need a human operator now need a device. The piece AI Agents Hacked Real Companies This Week — and the Attack Didn’t Need the Model looks at how a single compromised tool can cascade. Here, the compromise is physical, but the lesson is the same.

Disclosure timeline

For the record, the timeline published with the advisory is:

  • 2026-08-26 — Drivesec’s research team finds the bug
  • 2026-08-28 — Root command execution demonstrated on physical hardware
  • 2026-09-02 — Drivesec reports the issue privately to the scsi maintainers
  • 2026-09-04 — Drivesec sends the patch to linux-scsi
  • 2026-09-09 — Fix committed (3d676e458fe0, “scsi: core: Validate MODE SENSE lengths in scsi_cdl_enable()”)
  • 2026-09-25 — CVE-2026-98232 reserved
  • 2026-10-06 — CVE-2026-98232 published by the Linux CNA
  • 2026-11-30 — Public disclosure

Sources: Drivesec’s usb2shell.com advisory, the CVE record, and the upstream patch.

The bottom line

CVE-2026-98232 is a real vulnerability with a public proof of concept, and it will keep affecting Linux 6.5 and later until you patch. The check is one command. The fix is a kernel update. The mitigation is simple physical hygiene. If you run any Linux box that strangers can plug a USB drive into, this weekend is a good time to check.

Filed under Tech & Gadgets
Last Update: December 1, 2026 by Felix AlterEgo
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Newest
Oldest Most Voted