← All articles

USB2Shell flaw puts unpatched Linux systems at USB risk

USB2Shell flaw puts unpatched Linux systems at USB risk

USB2Shell is a Linux kernel flaw that can let a crafted USB device run an attacker’s command with root access, meaning the highest level of control, before anyone logs in. Researchers at Drivesec demonstrated the attack on one test machine, where it did not always work. No real-world attacks or victims have been identified.

The vulnerability is in the Linux kernel, the core software that manages a computer’s hardware and system resources. It was fixed in September and published as CVE-2026-98232 in October. Only systems that have not received the relevant fix remain exposed.

The problem sits in the kernel’s SCSI core, the part that handles communication with certain storage devices. A function there enables Command Duration Limits, a storage feature. When a USB device falsely presents itself as an ATA disk that supports this feature, the kernel copies information supplied by the device into a small area of temporary memory called the kernel stack. The device controls length values that determine how much data is copied, but the code did not check those values against the buffer’s size.

That processing starts during the automatic USB scan performed as soon as a storage device is connected. As a result, a locked screen, a logged-out session or a rule that blocks mounting unknown drives does not prevent the initial interaction. The device is already communicating with privileged kernel code before those protections apply.

According to the kernel advisory, a malicious device can read up to 64 bytes of kernel stack memory and change one byte. In their test, the researchers turned that limited memory change into the ability to write to any location in kernel memory. They defeated KASLR, or Kernel Address Space Layout Randomization, a protection that randomizes where kernel code is placed, then created fake kernel data structures. The device ultimately caused its selected command to run as root when it was unplugged.

The vulnerable code was introduced in Linux 6.5 and remains present in every release from 6.5 onward until the fix is applied. A system also needs USB mass storage support, provided through the usb-storage or uas driver, and a USB port that an attacker can physically reach. Drivesec’s technical write-up describes an attack against Debian running kernel 6.12.22 with KASLR enabled, using a Cynthion, a small programmable USB tool.

There is no published success rate. Drivesec described the exploit as probabilistic, meaning it does not succeed every time. Failed attempts do not trigger a crash, so an attacker can try again. The demonstration was run against one test machine, and the researchers did not report attacks against systems in the wild.

Upstream Linux version numbers do not directly identify every affected distribution because Linux distributors backport, or apply selected changes to older versions, including security fixes. Debian’s standard version 12 kernel never contained the vulnerable code, according to its security tracker. Red Hat delivered the fix in a kernel numbered 5.14. Administrators should therefore check their own distribution’s security advisory instead of relying only on the upstream 6.5 version number.

The main remedy is to install a kernel containing the fix or apply the upstream fix commit. If an immediate update is not possible, administrators can prevent the usb-storage and uas drivers from loading on machines that do not need USB storage. They can also require approval before a driver loads for a USB device, using allow-listing tools such as USBGuard or the authorized_default=0 setting.

Drivesec provides a checking script, but the researchers warn that it can fail to recognise a fix backported by a vendor. Its output should therefore be treated as an indication, not proof that a system is vulnerable or safe.

The flaw was first reported on the Linux kernel mailing list by Sashiko, an artificial intelligence code-review system built by Google and provided to the Linux Foundation. Drivesec said it independently found the same issue, wrote the fix and developed the working exploit. The researchers said Sashiko did not write the exploit. Google said a project retrospective credited Sashiko with 528 Linux kernel CVE fixes this year, while cautioning that it is too early to make strong claims about how much credit the system deserves.

The situation differs on Android. Researchers found a memory leak rather than root access. Phone kernels on version 6.6 and newer are affected and can disclose some kernel memory, but the builds examined by the researchers, including Google’s generic Android kernel and the kernel on a Samsung Galaxy A16, use a compiler check that blocks the memory-changing step.

As of publication, the flaw had not been added to the U.S. government’s Known Exploited Vulnerabilities catalog. A physical attack is difficult to conduct against many machines, and the fix has been available since September. The practical concern is equipment with publicly reachable USB ports, including self-service kiosks, payment terminals, car infotainment units, EV chargers and smart-home hubs. None of those product categories has been shown to be compromised; they are examples of locations where an exposed port could matter.

For businesses reviewing this kind of infrastructure risk, AEU-I describes its service as security-first IT, infrastructure and consulting.

Users should install operating-system updates through their Linux distributor or ask the person responsible for the machine to confirm that the kernel fix is included. Do not connect an unknown USB device, even when the screen is locked. On computers that never need USB storage, ask an administrator to disable the relevant USB storage support. In workplaces and public equipment, require USB devices to be approved before they can be used. Treat any vulnerability-checking script as a clue and verify the installed distribution’s own security information.

Also available in: DeutschItalianoShqip