“USB2SHELL”: Manipulated USB drive grants root access on Linux | heise online

“USB2SHELL”: Manipulated USB drive grants root access on Linux

Attackers can exploit a Linux kernel vulnerability with manipulated USB hardware to gain root privileges.

listen Print view
Screenshot of the USB2SHELL logo with technical information and command lines

(Image: usb2shell.com / Bearbeitung heise medien)

3 min. read

Attackers can exploit a vulnerability in the Linux kernel’s SCSI core to gain root privileges. All they need to do is plug manipulated USB hardware into a vulnerable system. Updated kernels are already being distributed.

Security researchers vie for attention, so this vulnerability has been named “USB2SHELL” and given its own domain and website. The vulnerability is caused by a missing length check in the scsi_cdl_enable() function. The function uses responses to “MODE SENSE” requests, where a device can report smaller values than the actual mode headers and block descriptors require. An unsigned subtraction can therefore cause an underflow, making pointers run past the boundaries of a fixed 64-byte buffer on the stack. The kernel then leaks up to 64 bytes of foreign stack content to the device and deliberately modifies a byte outside the buffer. Ultimately, during an automatic scan — before a drive is mounted or anyone logs in to the device — a device can lay the groundwork for the kernel to run a command supplied by the device as root when it is unplugged, and even bypass Kernel Address Space Layout Randomization (KASLR) and the NX bit (a no-execute marker for memory regions) (CVE-2026-98232, NVD rating pending; Red Hat rates the flaw 8.4, or “Important,” on the CVSS scale, while Ubuntu assigns a CVSS score of 5.4 and rates the risk as “medium”). A demonstration video is intended to show that the first two exploit attempts fail without leaving significant traces, such as crashes, while the third runs “whoami” and “uname” with root privileges.

The security researchers using the handles Z3r0n37 and Alberto247, from Drivesec — the error was first reported by the automated Sashiko AI Review — developed an exploit that runs commands with root privileges on a Debian kernel with KASLR enabled when a carefully prepared USB device is plugged in. Attackers therefore need only brief access to a USB port to exploit the vulnerability and gain root access to the device. Linux kernel versions 6.5 and later are affected. On Android devices running kernel version 6.6 or later, the issue remains a data leak, according to the researchers, because compiler bounds checks block the write. Versions 6.6.158, 6.12.112, 6.18.54, 7.2.8 and 7.3 have already received fixes. Linux distributions are also backporting the available patch to their versions, so the version number alone does not indicate whether a kernel is vulnerable.

Videos by heise

The security researchers provide a test script on their website that users can run to check whether their Linux kernel has the vulnerability. However, it checks only the kernel version and therefore cannot tell whether the distribution in use has already provided a backport for a different kernel version. If you’re unsure, or are running a vulnerable kernel and can’t update it right away, you can either use USBGuard to restrict USB devices to an allowlist or keep the “usb-storage” and “uas” modules from loading or unload them.

(dmk)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.