Sponsored

Supercharge Your Digital Workflow

Premium privacy-first software and marketing utilities.

Explore Tools →

USB2Shell (CVE-2026-98232): How a Malicious USB Device Gains Root Access on Locked Linux Machines

USB2Shell (CVE-2026-98232): How a Malicious USB Device Gains Root Access on Locked Linux Machines

USB2Shell (CVE-2026-98232): How a Malicious USB Device Gains Root Access on Locked Linux Machines

Locking your screen is usually enough to stop a casual passerby from accessing your computer—but on an unpatched Linux machine, a single malicious USB device can bypass that defense completely. Security researchers at Drivesec have published a proof-of-concept exploit dubbed USB2Shell, targeting a Linux kernel vulnerability tracked as CVE-2026-98232.

The flaw allows a specially crafted USB device to execute arbitrary commands as root the moment it is plugged in—requiring no user login, no clicks, and no drive mounting. While the upstream Linux kernel fixed the bug in September 2026 and no real-world attacks have been reported, any unpatched Linux desktop, kiosk, server, or embedded appliance with an accessible USB port remains exposed.

⚠️ Physical Access = Instant Root Risk: Because the Linux kernel automatically probes USB storage devices as soon as they are connected, USB2Shell triggers before authentication. Even a locked workstation or an unattended server in a shared rack is vulnerable if running an unpatched affected kernel.

🔍 What Happened: Inside the USB2Shell Proof of Concept

Drivesec demonstrated the attack using a programmable USB hardware tool (Cynthion) plugged into a PC running a standard Debian kernel (6.12.22+bpo-amd64) with Kernel Address Space Layout Randomization (KASLR) enabled. Instead of relying on BadUSB keyboard emulation—which fails on a locked screen—USB2Shell attacks the kernel's storage subsystem directly:

  1. Automatic Probing: The moment the malicious USB device is inserted, the Linux kernel's USB mass-storage driver scans it.
  2. Memory Leak & KASLR Bypass: The device impersonates an ATA disk supporting Command Duration Limits (CDL) and sends crafted responses that leak up to 64 bytes of kernel stack memory, defeating KASLR.
  3. Controlled Kernel Write: Using the leaked addresses, the exploit chain leverages an out-of-bounds stack write to corrupt kernel structures and gain controlled execution.
  4. Silent Root Execution: When the USB device is unplugged, the kernel executes the attacker's payload as root. Notably, failed attempts do not crash the system, allowing an attacker to retry silently without leaving obvious kernel panic logs.

⚙️ The Technical Reason: Missing Length Checks in scsi_cdl_enable()

The root cause of CVE-2026-98232 lies in the Linux kernel's SCSI core inside drivers/scsi/scsi.c, specifically within the scsi_cdl_enable() function. Command Duration Limits (CDL)—a feature introduced in Linux kernel 6.5—allows the OS to manage how long storage commands may take.

When a newly connected USB storage device claims to support CDL, the kernel copies a feature mode page from the device into a small 64-byte stack buffer without properly validating the MODE SENSE length fields. By supplying forged length values, a malicious USB device triggers an unsigned length underflow, resulting in both a 64-byte kernel stack disclosure and an out-of-bounds byte write at an attacker-chosen offset.

What About Android? While Android kernels based on Linux 6.6 or newer can expose stack data through the same code path, Drivesec noted that compiler bounds checks on tested Android GKI and Samsung kernels prevented the out-of-bounds write, blocking root execution.

📋 Affected Linux Distributions & Patch Status

The upstream fix (commit 3d676e458fe0: "scsi: core: Validate MODE SENSE lengths in scsi_cdl_enable()") was merged in September 2026 and backported to maintained stable branches. Because enterprise vendors backport fixes without changing base version numbers, always verify your distribution's specific security advisory:

Distribution Affected Scope Current Status
Ubuntu 24.04 (6.8) & 26.04 (7.0) + HWE kernels Patched (22.04 / 5.15 not affected)
Debian 12 Backports (6.12) & 13 "Trixie" Patched in 6.12.113 (Debian 12 6.1 not affected)
Red Hat (RHEL) RHEL 9 (backported) & RHEL 10 Patched (RHEL 8 not affected)
Embedded / Custom Kernels 6.5+ (esp. 6.6.35+, 6.10+) not updated since Sept 2026 High Risk — Apply upstream patch or mitigate

🛡️ How to Protect Your Linux Systems Now

  1. Update Your Linux Kernel Immediately: Run your distribution's standard package manager (apt, dnf, etc.) to install the latest patched kernel and reboot. For custom or embedded builds, backport upstream commit 3d676e458fe0.
  2. Blacklist USB Storage Drivers Where Unneeded: On servers, kiosks, or workstations that do not require USB flash drives, disable the usb-storage and uas kernel modules to eliminate the attack surface completely.
  3. Enforce USB Allow-Listing (USBGuard): Deploy USBGuard or set authorized_default=0 in the kernel USB subsystem so unauthorized devices are blocked before the kernel probes them or loads a driver.
  4. Secure Physical Ports: Combine software controls with physical port locks or BIOS/UEFI USB restrictions on publicly accessible machines, lab terminals, and data center racks.

USB2Shell is a clear reminder that physical security and kernel hygiene go hand in hand. Even with a locked screen and no network access, an open USB port on an unpatched Linux machine can hand an attacker full root control in seconds—making timely kernel updates and strict USB allow-listing essential defenses.

🚀

Supercharge Your Digital Workflow

Sponsored

Get the premium offline software suite for KDP, Etsy, and TPT.

Tags: enTechTrends

Contact Us

Ready to grow your business? Get in touch with our team of experts today.

Contact Form

Name

Email *

Message *