USB2Shell: How the Linux USB attack works and how to patch it

USB2Shell: How the Linux USB attack works and how to patch it

Sina Chehreghani, Head of Threat Intel and Threat Research, Securonix

 

A malicious USB device can give an attacker root access to a vulnerable Linux system before anyone signs in or mounts a drive. USB2Shell, tracked as CVE-2026-98232, targets the kernel’s automatic storage-device scan. A locked screen or disabled automount does not prevent the vulnerable code from processing the device.

The vulnerability sits in the Linux kernel’s SCSI storage subsystem, which also handles many USB storage devices. When a connected device identifies itself as an ATA disk supporting Command Duration Limits, the kernel calls scsi_cdl_enable() to process information about that capability.

The vulnerable function trusts length fields supplied by the device when locating data inside a 64-byte stack buffer. Malformed lengths can cause an unsigned arithmetic underflow and an access beyond the buffer. The resulting operations can disclose kernel stack memory and clear the low two bits of a byte outside the intended buffer. The patch validates those lengths before using them.

The Linux kernel CVE announcement documents a build-specific proof of concept that achieved privileged command execution with kernel address randomization and non-executable memory protections enabled. Exploitability still depends on the kernel build and environment; the demonstration does not establish identical behavior across every affected product.

Exposure requires a vulnerable kernel and a path for an attacker-controlled storage device to reach it. Accessible USB ports deserve attention, especially on unattended equipment. Red Hat also identifies the ability to attach emulated devices to a virtual machine as a relevant access path. Kiosks and industrial terminals therefore warrant inventory checks, without assuming every product in those categories is vulnerable.

The vulnerable code entered upstream Linux in version 6.5. Published upstream fix points include:

 

Upstream release line Release containing the fix
6.6.y 6.6.158
6.12.y 6.12.112
6.18.y 6.18.54
7.2.y 7.2.8
7.3 Included in 7.3; landed during 7.3-rc4

These identify where fixes entered those branches. Install a current, supported vendor build rather than selecting a package solely from this historical table.

Distribution package versions require a separate check. Ubuntu lists the standard Ubuntu 24.04 linux source package as fixed in 6.8.0-149.149, while the Ubuntu 22.04 HWE 6.8 stream is fixed in 6.8.0-149.149~22.04.1. Other kernel flavors have their own entries.

Debian marks its standard Debian 12 linux package as unaffected because the vulnerable code is absent. Its separate linux-6.12 package requires the applicable fix. An operating-system release name or the output of uname -r alone cannot settle exposure across those configurations.

 

For patch deployment:

  • Identify the running system and kernel. Record the distribution, kernel flavor, and architecture so the asset can be matched to its vendor advisory.

cat /etc/os-release
uname -r

For managed appliances, obtain the firmware build and kernel-fix status from the manufacturer.

  • Confirm the applicable fixed package. Check the vendor’s entry for CVE-2026-98232, including the specific kernel stream and support channel. For example, Red Hat’s RHEL 9 advisory RHSA-2026:100662 includes this vulnerability among its fixes. Extended-support streams may use different advisories.
  • Install the supported update. On conventional Debian or Ubuntu installations, refresh package metadata and review the available upgrades:

sudo apt update
sudo apt upgrade

Confirm that the transaction includes the corrected kernel for the installed flavor. Investigate held packages or missing repository updates before treating the system as patched. Ubuntu documents this package-update workflow.

On RHEL installations using the standard kernel package, the documented kernel-update command is:

sudo dnf upgrade kernel

Appliance and embedded-device owners should deploy the manufacturer’s corrected firmware through its supported update process.

  • Boot the fixed kernel and verify it. Schedule the restart through the system’s maintenance process. After rebooting, run uname -r again and reconcile the running build with the vendor’s fixed package. Retain that evidence in the remediation record; installing a kernel package leaves the previous kernel running until the new one is activated.

Systems awaiting updates need controls that prevent an untrusted device from reaching the storage-driver scan. Linux supports leaving newly attached USB devices unauthorized until explicitly approved. USBGuard can manage authorization policies, including blocking devices that match no approved rule. Configure and test enforcement during boot as well as normal operation.

Where USB storage serves no operational purpose, assess disabling the usb-storage and uas drivers with the operating-system or device vendor. Check dependencies before deployment, particularly where boot or recovery relies on USB storage. Module blacklisting also needs separate treatment when support is compiled into the kernel. The researchers identify removing this storage-driver path as an interim mitigation.

Restrict physical access to exposed ports while those changes are pending. Device allowlisting needs careful design because a programmable device can imitate identifiers and descriptors; a matching vendor or product identifier does not authenticate the hardware. Linux’s USB authorization documentation explicitly warns about that limitation.

For each affected asset, record the vendor advisory and the corrected kernel or firmware actually running. Where a manufacturer has yet to confirm a fix, retain the USB restrictions and assign an owner to obtain a remediation date. This leaves operations teams with a specific unresolved dependency to track through closure.

 

 

See Securonix in Action

See how Securonix brings together AI-powered threat detection, intelligent automation,
and advanced analytics to help organizations identify threats faster and respond with confidence.

Let us show you what’s possible.