Osegi
Security·2 min read

USB2Shell: a Linux flaw that gives root from one USB stick

Plug in a crafted USB device, unplug it, and the Linux kernel runs the attacker's command as root. No click, no login, no mounted disk needed.

A USB flash drive plugged into a laptop running Linux, with a glowing red terminal prompt on the screen.
Image: Numerama

Plug in a rigged USB device, pull it out again, and the Linux kernel runs a command of the attacker's choosing with root rights. That is USB2Shell, a vulnerability unveiled on 30 November by Drivesec, an Italian cybersecurity company. It is tracked as CVE-2026-98232.

Nobody has to log in, open a file or click anything. The attacker only needs a few seconds of physical access to a USB port. Unlike remote bugs such as PHP2Shell or Java4Shell, nothing here travels over the network.

How does USB2Shell work?

The problem sits in code added in Linux 6.5: support for Command Duration Limits (CDL), which caps how long commands sent to some drives can run. When a USB storage device is plugged in, the kernel scans it automatically. If the device claims to support CDL, Linux asks for a configuration page, stores it in a small 64-byte memory area and sends it back.

The kernel trusted the lengths in the device's reply without checking them. A malicious device can lie about sizes, read up to 64 bytes of kernel memory and zero out a single byte wherever it likes. All of this happens during the automatic scan, before any disk shows up.

Each trick looks minor alone. The researchers chained them. The leak defeated KASLR, the protection that puts the kernel at a random address. Then they built fake kernel structures to turn the one-byte change into arbitrary writes to kernel memory. When the device is unplugged, the kernel runs the attacker's command as root.

Is there a fix?

Yes. Drivesec says it found the bug on 26 August and reported it privately on 2 September. The company wrote the patch itself, merged on 9 September. The CVE was published on 6 October. Drivesec also admits that an AI code review tool, Sashiko AI Review, had already spotted the bug on the developers' mailing list.

Affected systems run Linux 6.5 or newer, support USB storage and have an accessible port. Fixed versions are 6.6.158, 6.12.112, 6.18.54, 7.2.8 and 7.3. The researchers point to car infotainment systems, charging stations, payment terminals and in-flight entertainment screens, whose USB ports are often within public reach.

Apps worth a look

SUMO: the number puzzle

Tap the right tiles, add them up, hit the target. Easy to learn, hard to master. Free, for all ages.

Tags:usb2shelllinuxkernelcve-2026-98232drivesecusb

More from this day

See all →

More in: Security

See all →