USB2Shell Linux Kernel Flaw Lets Malicious USB Devices Gain Root Access Without Login
About 4 min read
securitysoftwarehardwarepayments
A newly disclosed Linux kernel vulnerability, dubbed “USB2Shell,” allows a malicious USB storage device to execute commands as the root user on an unpatched system without any user interaction. The flaw is triggered the instant a USB device is plugged in, before a user logs in, unlocks the screen, or any mounting policies can take effect. Researchers at Drivesec demonstrated the attack on a test machine and explained how it works, why it matters, and what users should do to protect themselves.
The vulnerability resides in the kernel’s SCSI core, specifically in a function that enables the Command Duration Limits feature for ATA disks. When a USB device claims to support this feature, the kernel copies length values supplied by the device into a small buffer located on the kernel stack. The code fails to verify that the supplied lengths fit within the buffer, allowing an attacker‑controlled device to overflow the buffer by up to 64 bytes. By altering a single byte of stack memory, the attacker can gain the ability to write to any location in kernel memory. In the researchers’ proof‑of‑concept, they used this primitive to defeat Kernel Address Space Layout Randomization (KASLR), forge kernel data structures, and cause a chosen command to run as root the moment the USB device is unplugged.
The flaw was introduced in Linux kernel version 6.5 and is present in every subsequent release up to the point where the fix was applied. The fix was merged into the mainline kernel in September 2026 and published as CVE‑2026‑98232 in October 2026. Consequently, only systems that have not applied the update remain vulnerable. The vulnerability only affects machines that load the usb‑storage or uas driver, i.e., those that support USB mass‑storage devices, and that have a physically accessible USB port.
Drivesec tested the exploit on a Debian system running kernel 6.12.22 with KASLR enabled, using a Cynthion programmable USB platform. The attack succeeded intermittently; the researchers noted that the exploit is probabilistic but does not cause a crash when it fails, allowing repeated attempts. No real‑world incidents have been observed, and no victims have been identified. The U.S. government’s Known Exploited Vulnerabilities catalog does not list the bug, reflecting its limited exposure so far.
Distribution vendors handle the flaw differently because many backport fixes or features. Debian’s standard version 12 kernel never contained the vulnerable code, according to its security tracker. Red Hat backported the fix to its kernel series numbered 5.14. Users should verify the status of their specific distribution rather than relying solely on upstream version numbers. Drivesec provides a script that can check for the presence of the vulnerable code, but the script may miss vendor backports, so its output should be treated as indicative rather than definitive.
The discovery of USB2Shell is notable for its origin. The initial flagging was performed by Sashiko, an artificial‑intelligence code‑review system built by Google for the Linux kernel and released to the Linux Foundation. Sashiko reported the issue on the kernel mailing list, after which Drivesec independently identified the same flaw, authored the fix, and built a working exploit. Google reports that Sashiko has been credited in 528 kernel CVE fixes this year, though it cautions that the tool’s exact impact remains uncertain.
On Android devices, the vulnerability manifests only as a memory leak rather than full root compromise. Phone kernels from version 6.6 onward are affected, but the builds examined—including Google’s generic Android kernel and the kernel on a Samsung Galaxy A16—use a compiler safeguard that blocks the memory‑corruption step required for privilege escalation.
Practical concerns focus on any environment where strangers can access a USB port. Self‑service kiosks, payment terminals, in‑car infotainment systems, electric‑vehicle chargers, and smart‑home hubs are cited as examples where an open USB port could be abused. While no public compromises of such devices have been reported, the attack surface is real because the exploit works before any user‑level defenses engage.
The recommended mitigation is straightforward: update the Linux kernel to a version that includes the September 2026 fix for CVE‑2026‑98232, or backport the upstream commit if an official update is not yet available. For systems that cannot be updated immediately, administrators should consider disabling the usb‑storage and uas drivers where feasible, physically restricting access to USB ports, and monitoring for unusual kernel activity. The Drivesec script can help identify vulnerable systems, but verification against vendor‑specific patches remains essential.
In summary, USB2Shell is a serious kernel‑level flaw that grants immediate root execution to a crafted USB device on unpatched Linux systems. The vulnerability affects all kernel releases from 6.5 onward that retain the vulnerable SCSI code, but it has been patched for several months. Users and administrators should verify their kernel version, apply the fix, and consider physical and driver‑level hardening of USB ports to eliminate the narrow window of attack that this bug creates.
Over the weekend a research paper that was drafted with the help of Anthropic AI models was finally released. The paper ended a wave of alarm that had spread through the security community. …
Google announced today that it will push two separate Android updates before the close of the year. One of the updates is restricted to devices running Android 17, while the other will be di…
GameMaker, the development platform best known for powering Undertale and a host of other indie successes, has released a new set of contribution guidelines that place strict limits on the u…