USB2Shell Flaw Allows Rogue USBs to Escalate to Root Access on Linux

Linux systems are at risk from a newly discovered vulnerability dubbed “USB2Shell,” which lets malicious USB storage devices run root-level commands immediately upon connection—no login, click, or mount required. The issue lies in the Linux kernel’s SCSI core, specifically within a function handling “Command Duration Limits,” a storage feature the kernel enables when a device claims to support it. A crafted USB device that misrepresents how much data it needs can overflow a buffer on the kernel’s stack using its own provided length values—without any checks against expected size limits.

How the Attack Works

Once an affected system boots up, even sessions with locked screens or users logged out are vulnerable. That’s because the risky code path triggers during the kernel’s initial USB scan upon device insertion. During that scan, the kernel reads data lengths from the device and copies them into a fixed-size stack buffer. If the USB device lies about these lengths, it can overwrite stack memory—stealing up to 64 bytes and even flipping a single byte of kernel control data.

Through this small write, attackers can bypass key protections like Kernel Address Space Layout Randomization (KASLR), forge kernel structures, and hijack control flow. In tests on a Debian system running Linux kernel 6.12.22, researchers used a compact programmable USB tool to pull off such an exploit, gaining root privileges once the device was unplugged. The exploit doesn’t always succeed, but when it fails, it typically leaves no visible crash—offering repeated chances to try.

Scope, Fixes, and Mitigations

This flaw comes baked into Linux kernels starting with version 6.5 and forward. It exists when usb-storage or uas drivers are enabled, and whenever USB ports are exposed. However, many Linux distributions backport fixes, so the vulnerability depends less on version numbers than on whether specific patches are applied. For example, standard Debian 12 kernels never included the flawed code, and Red Hat released a fix in a backported kernel version numbered 5.14.

The issue was officially logged as CVE-2026-98232 in October, though the fix was merged in September. Systems can be protected by updating the kernel or backporting the upstream patch. For machines that can’t immediately update, disabling the usb-storage and uas modules, using device allow-listing tools like USBGuard, or setting “authorized_default=0” can limit exposure. A detection script from the researchers exists but may miss vendor backports—so it’s helpful but not definitive.

What Triggered Discovery & Real-World Threats

This vulnerability was first flagged by Google’s AI-assisted code review tool Sashiko, which alerted the Linux community. Independent security team Drivesec also discovered the flaw, built the patch, and developed a working exploit—Sashiko didn’t generate the exploit. On Android devices with kernels version 6.6 and above, only a memory leak—or read-only kernel memory exposure—was observed; no root access was achieved. In tests on Google’s generic kernel builds and a Samsung Galaxy A16, the block against modifying memory kept full takeover from being possible.

So far, there’s no evidence this flaw has been exploited in the wild. It hasn’t been added to the U.S. Known Exploited Vulnerabilities catalog. Devices most at risk include those with USB ports accessible to strangers—self-service kiosks, payment terminals, smart-home hubs, EV chargers, and infotainment systems—though no actual compromises have been reported.

Why it matters: USB2Shell exposes how automatic hardware interactions—before login or user action—can bypass critical security layers. Physical access becomes a higher risk and traditional protections like locked screens are bypassed. Going forward, the balance between convenience and security for removable hardware needs rethinking.