Technology

usb2shell (CVE-2026-98232): A USB Plug-In That Gets Root on Linux — What It Is and How to Fix It

By Asad Ali ·

13 min read

Cover image for the usb2shell article: a USB device plugged into a Linux computer, illustrating the CVE-2026-98232 kernel vulnerability.

A crafted USB device can run commands as root on an unpatched Linux machine running kernel 6.5 or later — with no login, no mount and no click. The catch, and the part the headlines skip, is that the attacker needs physical access to a USB port: this is not a remote attack. The flaw, named usb2shell and tracked as CVE-2026-98232, is already fixed in newer kernels, so the real question is whether your machines have the patch.

Security researchers at Drivesec, an Italian cybersecurity firm, disclosed the flaw on 30 November 2026. The Linux kernel team had already fixed it in September and the CVE record was published in October, so only systems that have not taken the update are exposed. No attacks in the wild have been reported, and the flaw is not in CISA's Known Exploited Vulnerabilities catalog as of 1 December 2026.

What usb2shell is

usb2shell is a flaw in the Linux kernel's SCSI storage code. When a USB storage device is plugged in, the kernel scans it automatically — before anyone logs in, before any file manager sees a disk, before any user does anything. A device that lies about its own capabilities during that scan can make the kernel hand back kernel memory and overwrite a byte of the kernel stack. On the researchers' test machine, that single byte was enough to turn into full root command execution.

The name follows a run of "2shell" bugs disclosed in 2026 — PHP2Shell, Java4Shell, wp2shell and KindaRails2Shell — but those were remote flaws in web software. usb2shell is the physical version of the same idea: instead of a crafted request over the network, the attack arrives through a USB device plugged into a port.

The flaw is rated CVSS 8.4 (High) by Red Hat, which rates it Important. The weakness is CWE-787, an out-of-bounds write. It was introduced in Linux 6.5, when support for Command Duration Limits (CDL) was added to the kernel, and it affects every release from 6.5 through 7.2.7 that has not been patched.

How a plug-in becomes root — the attack chainPlug in crafted USBno login, no clickKernel scans the devicescsi_cdl_enable() runsLeak breaks KASLR64-byte stack leakCommand runs as rooton unplug, as root→→→Physical access is required at step one. Every later step is automatic.The exploit is probabilistic — a failed attempt does not crash the machine.

How the bug works

Command Duration Limits is a feature that lets a storage device tell the operating system how long a command is allowed to take. Support for it was added to the Linux kernel in version 6.5. When the kernel scans a newly connected SCSI device that claims to be an ATA disk with CDL support, it calls a function named scsi_cdl_enable(). That function reads a mode page from the device into a 64-byte buffer on the kernel stack, and then writes it back.

The problem is that the lengths in the device's reply were used without validation. The device itself supplies three length values — the total length, the header length and the block descriptor length — and the kernel trusted them. A malicious device can supply values that make the length calculation underflow, so the kernel copies more than the buffer holds, and can point the write past the end of the buffer. In the researchers' words, a device can make the kernel send it up to 64 bytes of kernel stack memory, and clear one stack byte at an offset the device picks.

One byte sounds small, and it is — but it is enough when combined with the leak. The leaked stack contents reveal where the kernel is loaded in memory, defeating KASLR, the randomization that normally keeps kernel addresses unpredictable. With KASLR broken, the exploit chain builds fake kernel data structures that turn the single-byte overwrite into a controlled write to any kernel memory location. The final step is triggered when the device is unplugged: the kernel then runs a command supplied by the device, as root.

The researchers demonstrated this on a stock Debian machine running kernel 6.12.22+bpo-amd64, with KASLR switched on, using a Cynthion — a small programmable USB tool. In their demo video, the first two attempts miss and retry without a crash, and the third runs whoami and uname as root. The exploit is probabilistic: there is no published success rate, and a failed attempt does not crash the machine, so an attacker can simply retry. No exploit code has been published — the public material is the kernel fix commit, Drivesec's write-up, a demo video and a checker script, not a ready-to-run tool.

Who is actually at risk

A system is exposed only when all three of these conditions hold at the same time:

  • It runs Linux 6.5 or later without the fix applied.
  • It has USB mass storage support — the usb-storage or uas driver — built in or loaded automatically.
  • Someone can physically plug a device into one of its USB ports.

That third condition is the one that decides the real risk. A server locked in a rack room is barely exposed; a device with a USB port on a counter, a dashboard or a wall is exposed to anyone who walks past. That is why the disclosure names the same kinds of systems again and again: car infotainment and telematics units, EV chargers, point-of-sale terminals, kiosks, in-flight entertainment systems, industrial HMIs and smart-home hubs. These are Linux systems with USB ports that strangers can reach, often running kernels that are updated rarely, if ever.

System typeWhy it mattersExposure
Car infotainment / telematicsUSB ports in the cabin, long vehicle lifetime, slow updatesHigh — ports face passengers
EV chargersPublic, unattended, USB ports on the unitHigh — anyone can walk up
POS terminalsUSB ports on the counter, payment environmentHigh — public-facing hardware
KiosksSelf-service, unattended for hoursHigh — unsupervised access
Industrial HMIsFactory floor USB ports, rarely patched kernelsMedium — depends on floor access
Desktop / laptopPorts within reach of anyone at the deskMedium — needs physical access
Servers in a locked roomNo stranger can reach a portLow — physical access is the barrier
Android phonesKernels 6.6 and later are affected, but only as a leakLow — leak only, no root

Android deserves its own note. Android kernels on 6.6 and later are affected, and the device still gets kernel stack contents back — but the builds Drivesec checked (Android GKI, and the Samsung Galaxy A16 shipping kernel) use compiler bounds checks that keep the write inside the buffer. On Android the bug is a leak only, not a path to root.

What the headlines get wrong

Correction — read this before the scary version.

This is a local, physical-access flaw, not a remote one. It cannot be triggered over a network, by an email or by a website. The exploit is probabilistic, not guaranteed, and no attacks in the wild have been found. Not every Linux system is affected: Debian's standard version 12 kernel never contained the flawed code, and distributions backport both features and fixes, so an upstream version number alone does not tell you whether a given machine is exposed. Check your own distribution or vendor, not just the kernel number.

The confusion is understandable. "USB device gets root on Linux" sounds like every Linux machine on earth is one plug-in away from compromise. The reality is narrower and more specific: the machines that matter are the ones with exposed USB ports and old kernels — the charger on the street, the terminal on the counter, the screen in the car. A patched kernel, a locked room or a disabled USB storage driver each close the hole on their own.

There is also a version-number trap. The fix landed in upstream releases 6.6.158, 6.12.112, 6.18.54, 7.2.8 and mainline 7.3, but distributions ship their own numbered kernels with fixes backported. Red Hat, for example, delivered the fix in a kernel it numbers 5.14 — a number that looks older than 6.5 but contains the patch. Debian's standard version 12 kernel never contained the flawed code at all, according to its security tracker. So "my kernel is 6.1" or "my kernel is 5.14" tells you nothing by itself; the vendor's advisory is the source that counts.

Which kernels are fixed

The upstream fix is commit 3d676e458fe0 ("scsi: core: Validate MODE SENSE lengths in scsi_cdl_enable()"), committed on 9 September 2026. The first fixed release on each stable branch is:

BranchAffected versionsFirst fixed release
6.5.x – 6.6.x6.5 to 6.6.1576.6.158 or later
6.7.x – 6.12.x6.7 to 6.12.1116.12.112 or later
6.13.x – 6.18.x6.13 to 6.18.536.18.54 or later
6.19.x – 7.2.x6.19 to 7.2.77.2.8 or later
7.3.x and laterNoneNot affected

Upstream fixed releases are one thing; vendor kernels are another. Debian, Ubuntu, Red Hat and Amazon Linux have all shipped patched kernels for their supported releases, and the fix was also backported to the stable branches (commits 39491a1ae930, 60b0b8ce803e, 6233d0b3ef46 and 99a6e4a9176d). If you run a distribution kernel, install your vendor's update and reboot into it — that is the fix. Backporting the upstream commit into a vendor kernel is the alternative for devices whose vendor no longer ships updates.

How to check if you are affected

Start with the kernel version. On a Linux machine, uname -r shows the running kernel release; compare it with the fixed releases in the table above. Then check your distribution or device vendor's advisory for CVE-2026-98232, because a backported fix does not change the version number — the vendor advisory is the only reliable answer for distro kernels.

Drivesec also offers a checker script on its disclosure site. It inspects the running kernel and reports whether it looks vulnerable. Treat its result as a hint, not proof: because distributions backport fixes without changing the version number, the script can flag a kernel that your vendor already patched. Read the script before running anything from the internet, and confirm the result against your vendor's advisory or the fix commit in your kernel source tree.

For fleets of embedded devices — chargers, kiosks, terminals — the check is a product question, not a command: ask the vendor whether the shipped kernel contains the fix for CVE-2026-98232, and whether an update is available. If the vendor cannot answer, treat the device as unpatched.

How to fix it

The fix is simple to state and sometimes slow to deliver. Update to a kernel that contains the fix, then reboot into it. For a desktop or server on a supported distribution, that is a normal update. For an embedded device, it depends on the vendor shipping an update — which is why the mitigations below matter for devices that cannot be updated yet.

ActionWhat it does
Update to a fixed kernel and rebootRemoves the flaw entirely
Backport commit 3d676e458fe0 to your vendor kernelSame fix, for kernels without a vendor update
Do not build or auto-load usb-storage / uas where mass storage is not neededRemoves the attack surface — the bug cannot fire without the driver
USB allow-listing (USBGuard, or authorized_default=0)Stops the kernel scanning unauthorized devices
Physically block or disable exposed USB portsRemoves the physical access the attack needs

The two mitigations that cost nothing and work everywhere are the driver and the allow-list. If a machine never needs to read a USB stick, the usb-storage and uas drivers should not be loaded — without them, the vulnerable code never runs. USBGuard, or the kernel's authorized_default=0 setting, goes one step further: devices must be approved before the kernel loads a driver for them, so an unknown device is never scanned at all. For a kiosk, a charger or a terminal, that is the right default.

Timeline

Date (2026)Event
26 AugustDrivesec's research team finds the bug
28 AugustRoot command execution on physical hardware
2 SeptemberDrivesec reports the issue privately to the SCSI maintainers
4 SeptemberDrivesec sends the patch to the linux-scsi mailing list
9 SeptemberFix committed (3d676e458fe0)
25 SeptemberCVE-2026-98232 reserved
6 OctoberCVE-2026-98232 published by the Linux CNA
30 NovemberPublic disclosure by Drivesec

One credit in the timeline is unusual enough to note. The bug was first reported on the linux-scsi mailing list by Sashiko, an AI code-review system built for the Linux kernel. Drivesec states it found the same flaw independently, wrote the fix and built the exploit chain — the AI flagged the bug, it did not write the exploit.

Frequently Asked Questions

Can someone hack my Linux laptop with a USB stick?

Only if three things are true: the laptop runs an unpatched kernel 6.5 or later, it loads the usb-storage or uas driver, and the attacker can physically plug a device into it. Update your kernel and the answer becomes no. This is not a remote attack — nobody can trigger it over the internet.

Do I need to worry if I never plug in unknown USB devices?

Mostly no. The attack needs a malicious device in a physical port. If nobody else can reach your ports, the exposure is small. The risk is real for shared, public or unattended machines — kiosks, chargers, terminals, car infotainment — where a stranger can reach a port.

Is my Android phone affected?

Only as an information leak. Android kernels on 6.6 and later are affected, but the builds Drivesec checked use compiler bounds checks that stop the write, so the bug cannot be turned into root on Android. Keep your phone updated as normal; this flaw is not a reason to change how you use it.

How do I know if my kernel is patched?

Check your distribution or device vendor's advisory for CVE-2026-98232 — that is the reliable answer, because vendors backport fixes without changing the version number. The upstream fixed releases are 6.6.158, 6.12.112, 6.18.54, 7.2.8 and 7.3. A checker script exists on the disclosure site, but treat its result as a hint and confirm it against the vendor advisory.

What if my device cannot be updated?

Block the attack surface instead. Do not load the usb-storage or uas drivers where mass storage is not needed, and use USB allow-listing (USBGuard or authorized_default=0) so unauthorized devices are never scanned. Physically blocking exposed ports works too. Ask the vendor for a patched kernel — and if none comes, treat the device as permanently unpatched and isolate it.

Has this been used in real attacks?

No attacks in the wild have been reported, and CVE-2026-98232 is not in CISA's Known Exploited Vulnerabilities catalog as of 1 December 2026. The flaw was disclosed responsibly: found in August, fixed in September, published in October, and only described in public at the end of November.

Sources

Want a website or web app that works as hard as your ideas do? Talk to Asad Webs — we build web apps, AI-powered tools and fast, search-friendly websites for teams in the USA, UK, UAE, KSA and Spain.

Related reading: browse all free tools.

Category: Technology

Tags: technology

About Asad Ali

Asad Ali is a graphics designer with over 20 years of experience — designing since 2003 — and the founder of Asad Webs, based in Pakistan. He builds the free online tools on this site and writes the guides published here.

LinkedIn Facebook Website
KEEP READING

Next guide

NVDRIVER v0.1: The AI-Reverse-Engineered NVIDIA Driver in Rust — 23% Faster Claim, Checked →

Related articles

Join the conversation

No account needed. Comments appear only after approval. Your email address will not be published.

Be the first to share a useful question or thought.

You won’t be subscribed to any mailing list.
WELCOME BACK

Sign in

Access your orders, saved products and account.