Usb2shell:通过插入 USB 在 Linux 上获取 root 权限
Usb2shell: Root on Linux from a USB Plug-In

原始链接: https://usb2shell.com/

CVE-2026-98232 是 Linux SCSI 核心中的栈越界漏洞,位于 `scsi_cdl_enable()`,在自动扫描新连接的 USB 存储设备时触发。Linux 6.5 及更高版本受影响;修复版本为 6.6.158、6.12.112、6.18.54、7.2.8 和 7.3。恶意 USB 设备可泄露最多 64 字节内核栈并覆盖一个栈字节;研究人员在真实 USB 端口上利用原版 Debian 内核实现了 root 命令执行,即使启用 KASLR,也仅需短暂物理访问。无需用户交互或挂载。Android 仅因编译器边界检查而受影响为泄露。可通过更新、阻止 `usb-storage`/`uas` 在不受信任端口加载或使用 USB 允许列表来缓解。缺陷源于 Linux 6.5 新增的 CDL 支持中未检查的模式页长度。建议更新。

黑客新闻 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Usb2shell:从插入 USB 获得 Linux root 权限 ( usb2shell.com ) 20 分 由 matanyall 1 小时前 | 过往 | 收藏 | 1 条评论 帮助 dvh 19 分钟前 [–] >curl -fsSLO https://usb2shell.com/tools/usb2shell-check.sh >less usb2shell-check.sh >sh usb2shell-check.sh 我笑了。使用 "less -nU" 以防止黑底黑字攻击向量。也许。 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

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.

Discover more

References#

联系我们 contact @ memedata.com