Newshot

usb2shell: Root on Linux from a USB Plug-In

Original text(via Lobsters)

Why "usb2shell"?

This year brought a wave of "2shell" and "4shell" bugs, among them PHP2Shell, Java4Shell, wp2shell and KindaRails2Shell. Those are remote bugs in widely deployed software. usb2shell is the physical version: instead of a crafted request, the attacker plugs in a crafted USB device.

Plenty of Linux systems have USB ports that strangers can reach: car infotainment and telematics units, EV chargers, point-of-sale terminals, kiosks, in-flight entertainment, industrial HMIs and smart-home hubs.

Who is affected

A system is exposed when all of these are true:

  • it runs Linux 6.5 or later without the fix;
  • it has USB mass storage support (usb-storage or uas), built in or loaded automatically;
  • someone can plug a device into one of its USB ports.

No user interaction or mount is needed, the bug fires during the automatic device scan.

Stable branchFirst fixed release
6.6.y6.6.158
6.12.y6.12.112
6.18.y6.18.54
7.2.y7.2.8
mainline7.3

On Android the bug is a leak only. Android kernels on 6.6 and later are affected and the device still gets kernel stack contents back, but the builds we checked (Android GKI, and the Samsung Galaxy A16 shipping kernel) use compiler bounds checks that keep the write inside the buffer.

How to check your devices

Download the checker, read it, and run it:


        curl -fsSLO https://usb2shell.com/tools/usb2shell-check.sh
less usb2shell-check.sh
sh usb2shell-check.sh
      

Distributions and device vendors often backport fixes without changing the version number. If the checker flags your kernel, check your vendor's advisory for CVE-2026-98232 or look for the fix commit in your source tree.

How to fix it

Update to a fixed kernel, or backport the upstream commit 3d676e458fe0 ("scsi: core: Validate MODE SENSE lengths in scsi_cdl_enable()") to your vendor kernel.

If you can't update yet, these reduce exposure:

MitigationEffect
Don't build or auto-load usb-storage / uas where mass storage isn't neededRemoves the attack surface
USB allow-listing (USBGuard, authorized_default=0 )Stop scanning unauthorized devices

The bug

Command Duration Limits (CDL) support was added in Linux 6.5. When the kernel scans a new SCSI device that says it is an ATA device with CDL support, it calls scsi_cdl_enable(). That function reads a mode page from the device into a 64-byte stack buffer and writes it back.

The lengths in the device's reply were used without checks:


        len = min_t(size_t, sizeof(buf),
            data.length - data.header_length -
            data.block_descriptor_length);   /* can wrap -> 64 */
buf_data = buf + data.header_length +
        data.block_descriptor_length;         /* can point past buf */
      

So a device can make the kernel send it up to 64 bytes of kernel stack, and clear one stack byte at an offset it picks. All of this happens during the automatic scan, before userspace sees any disk.

Proof of concept

The PoC we built runs on a Cynthion USB device plugged into a PC with a stock Debian 6.12.22+bpo-amd64 kernel.

The leak allows us to break KASLR and the chain builds fake kernel structures to turn the one-byte overwrite into a controlled write. When the device is unplugged, the kernel runs a command supplied by the device, as root. While the exploit is probabilistic, no crash is triggered on failed executions.

Timeline

DateEvent
2026-08-26Drivesec's research team finds the bug
2026-08-28Root command execution on physical hardware
2026-09-02Drivesec reports the issue privately to the scsi maintainers
2026-09-04Drivesec sends the patch to linux-scsi
2026-09-09Fix committed ( 3d676e458fe0 )
2026-09-25CVE-2026-98232 reserved
2026-10-06CVE-2026-98232 published by the Linux CNA
2026-11-30Publication

Credits

While Sashiko AI Review first reported the bug on linux-scsi, Drivesec's research team found it independently, wrote the fix and built the exploit chain.

Our day job: penetration testing at Drivesec.

Drivesec is an Italian technology company specializing in the cybersecurity of connected products and IoT/OT systems. Born from experience in the automotive and industrial sectors, it helps manufacturers build security into the entire product lifecycle, combining technical expertise, testing and regulatory compliance.

Drivesec is committed to continuous investment in know-how, also developed through key collaborations with universities and leading research institutes.

References

  • CVE record: https://www.cve.org/CVERecord?id=CVE-2026-98232
  • Upstream fix: 3d676e458fe0
  • Stable backports: 39491a1ae930, 60b0b8ce803e, 6233d0b3ef46, 99a6e4a9176d
  • Checker: usb2shell-check.sh

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by Lobsters
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗