Usb2shell: Root on Linux from a USB Plug-In

Hacker News by 4 min read 13x views
Usb2shell: Root on Linux from a USB Plug-In

Share Post

The Cynthion USB equipment (left) attacks a inventory Debian 6.12.22+bpo-amd64 kernel; the target's kernel log is on the right. The archetypal two attempts young female and retry without a crash, the third runs whoami and uname as root.

Why "usb2shell"?#

This twelvemonth brought a motion of "2shell" and "4shell" bugs, among them PHP2Shell, Java4Shell, wp2shell and KindaRails2Shell. Those are distant bugs in extensively deployed software. usb2shell is the bodily version: alternatively 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, manufacturing HMIs and smart-home hubs.

Who is affected#

A scheme is exposed whenever all of these are true:

  • it runs Linux 6.5 or afterward without the fix;
  • it has USB bulk retention assistance (usb-storage or uas), built in or loaded automatically;
  • someone can plug a equipment into one of its USB ports.

No person communication or mount is needed, the bug fires during the automatic equipment 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 afterward are affected and the equipment motionless gets kernel stack contents back, but the builds we checked (Android GKI, and the Samsung Galaxy A16 shipping kernel) use compiler limits checks that keep the compose inner the buffer.

How to inspect your devices#

Download the checker, peruse it, and run it:

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

Distributions and equipment vendors frequently backport fixes without changing the type number. If the checker flags your kernel, inspect your vendor's advisory for CVE-2026-98232 or appearance for the fix commit in your origin 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 decrease exposure:

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

The bug#

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

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

len = min_t(size_t, sizeof(buf), data.length - data.header_length - data.block_descriptor_length); /* can cover -> 64 */ buf_data = buf + data.header_length + data.block_descriptor_length; /* can item former buf */

So a equipment can create the kernel dispatch it up to 64 bytes of kernel stack, and apparent 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 equipment plugged into a PC alongside a inventory Debian 6.12.22+bpo-amd64 kernel.

The leak allows us to interrupt KASLR and the sequence builds counterfeit kernel structures to rotate the one-byte overwrite into a controlled write. When the equipment is unplugged, the kernel runs a command supplied by the device, as root. While the utilize is probabilistic, no collision is triggered on unsuccessful executions.

Timeline#

DateEvent
2026-08-26Drivesec's investigation squad finds the bug
2026-08-28Root command implementation on bodily hardware
2026-09-02Drivesec reports the matter privately to the scsi maintainers
2026-09-04Drivesec sends the place 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 archetypal reported the bug on linux-scsi, Drivesec's investigation squad established it independently, wrote the fix and built the utilize chain.

Drivesec

Our day job: intrusion evaluation at Drivesec.

Drivesec is an Italian innovation business specializing in the cybersecurity of connected products and IoT/OT systems. Born from cognition in the automotive and manufacturing sectors, it helps manufacturers build safety into the complete merchandise lifecycle, combining specialized expertise, evaluation and regulatory compliance.

Drivesec is committed to uninterrupted funding in know-how, additionally developed through key collaborations alongside universities and foremost investigation institutes.

Discover more

References#

Other Article Hacker News
↑
Close Right Ads
Close Left Ads