GrepBoard/Manuals
605 manuals ·

usb2shell (CVE-2026-98232): Check the Running Kernel

·Tested on Debian 13·12 · Ubuntu 24.04·22.04 package lists (Docker) · 2026-12·Test scope ↓·5 steps

usb2shell (CVE-2026-98232) affects Linux 6.5 and later. Compare the running kernel's package version with the Debian and Ubuntu fixed versions, then reboot.

CVE-2026-98232 is a flaw in the kernel's SCSI code. When a USB storage device is plugged in, the automatic scan can read and write outside a 64-byte stack buffer. No mount or userspace access is needed. The researchers who disclosed it named it usb2shell and claim it leads to root command execution. The kernel CVE text says a QEMU test created a UID 0 owned marker file. An attacker needs physical access to a USB port; Ubuntu rates the CVSS 4.0 attack vector PHYSICAL and the priority medium. This page covers defense only. The vulnerable behavior was not reproduced. Kernel CNA record · Researcher page

[1] Check the affected range. The CNA record treats kernels 6.5 and later without the fix as affected, and lists the first fixed release per branch.

Upstream branchFirst fixed release
6.66.6.158
6.126.12.112
6.186.18.54
7.27.2.8
7.3 and later7.3

Kernels older than 6.5 (the 6.1 kernel in Debian 12, the 5.15 kernel in Ubuntu 22.04) do not contain the code. The researchers say a system is exposed when usb-storage or uas is built in or loaded automatically. Judge a distribution kernel by its package version, not the upstream number. The table above has no 6.8 line for Ubuntu 24.04, so use the distribution tracker versions below for 6.8.

[2] Get the name of the running kernel and read the version of that package. The installed kernel and the running kernel can differ, so start with uname.

console
$ uname -r

uname -r looks like 6.12.113+deb13-amd64 on Debian and 6.8.0-149-generic on Ubuntu. Put linux-image- in front of it to get the package name, then read the version from the package.

console
$ dpkg-query -W "linux-image-$(uname -r)"

The same field from the trixie package index (not from an installed server):

console
$ apt-cache show linux-image-6.12.113+deb13-amd64 | grep -E '^(Package|Version):'
output
Package: linux-image-6.12.113+deb13-amd64Version: 6.12.113-1

If dpkg-query finds no package, that does not mean the system is safe. It means you could not check. Cloud, OEM and self-built kernels use other package names. The Ubuntu tracker lists a separate fixed version for each kernel package, such as linux-aws, so do not judge those kernels by the generic version.

console
$ dpkg-query -W linux-image-6.12.113+deb13-amd64; echo "exit=$?"
output
dpkg-query: no packages found matching linux-image-6.12.113+deb13-amd64exit=1

dpkg-query shows the version of the package installed on disk. If a package with the same name was updated after the last boot, the running kernel may be older. Compare the boot time with the install and upgrade records for kernel packages.

console
$ uptime -s$ grep -hE ' (install|upgrade) linux-image-[0-9]' /var/log/dpkg.log

Each record lists the date, time, action, package, old version and new version. The record below has the same format. It comes from installing and reinstalling a small package (tree) in a container. A reinstall is logged as upgrade even when the version is the same. [--log in dpkg(1)](https://manpages.debian.org/trixie/dpkg/dpkg.1.en.html)

console
$ grep -hE ' (install|upgrade) tree' /var/log/dpkg.log
output
…2026-11-30 22:19:14 upgrade tree:amd64 2.2.1-1 2.2.1-1

If the last record for the package that matches uname -r is later than the boot time, do not rely on the dpkg-query version. Reboot and check again. No record does not mean the package was not updated; it means nothing was found in this file. Older records may have moved to /var/log/dpkg.log.1 or a compressed file.

On Ubuntu 24.04, /proc/version_signature shows the running kernel's version in a form such as Ubuntu 6.8.0-149.149-generic … (only the format was checked on a real system). Drop the trailing -generic and compare 6.8.0-149.149 with the version in step [3]. Do not rely on this value alone for packages whose version ends in a suffix such as ~24.04.1, including HWE kernels.

[3] Compare the version you read with the fixed version. The first fixed versions below come from each tracker.

DistributionPackageFixed versionSource
Debian 13 trixielinux6.12.113-1Debian tracker (DSA-6568-1)
Debian 12 bookwormlinux (6.1, default kernel)not affected (code not present)Debian tracker
Debian 12 bookwormlinux-6.12 (linux-image-6.12-amd64)6.12.113-1~deb12u1Debian tracker (DLA-4850-1)
Ubuntu 24.04linux6.8.0-149.149Ubuntu CVE record
Ubuntu 24.04linux-hwe-7.07.0.0-42.42~24.04.1Ubuntu CVE record
Ubuntu 26.04linux7.0.0-42.42Ubuntu CVE record
Ubuntu 22.04linux (5.15, default kernel)not affectedUbuntu CVE record
Ubuntu 22.04linux-hwe-6.86.8.0-149.149~22.04.1Ubuntu CVE record

Do not guess the kernel line from a metapackage name. The same linux-image-amd64 points to 6.12 on trixie and to 6.1 (candidate 6.1.192-3) on bookworm.

console
$ apt-cache depends linux-image-amd64 | sed -n 1,2p
output
linux-image-amd64  Depends: linux-image-6.12.118+deb13-amd64

Compare versions with dpkg --compare-versions, not string order. Inside the same 6.12 line, 90 is older than 113, but it sorts after it as a string.

console
$ [[ 6.12.90-1 > 6.12.113-1 ]] && echo "string order: 6.12.90-1 sorts after 6.12.113-1"; dpkg --compare-versions 6.12.90-1 lt 6.12.113-1 && echo "dpkg: 6.12.90-1 is older than 6.12.113-1"
output
string order: 6.12.90-1 sorts after 6.12.113-1dpkg: 6.12.90-1 is older than 6.12.113-1

Several kernel packages from the trixie index compared with 6.12.113-1. ge means the fixed version or newer, lt means older.

console
$ for p in linux-image-6.12.90+deb13-amd64 linux-image-6.12.111+deb13-amd64 linux-image-6.12.113+deb13-amd64 linux-image-6.12.118+deb13-amd64; do v=$(apt-cache show "$p" | awk "/^Version:/{print \$2; exit}"); if dpkg --compare-versions "$v" ge 6.12.113-1; then r=ge; else r=lt; fi; echo "$p $v $r"; done
output
linux-image-6.12.90+deb13-amd64 6.12.90-1 ltlinux-image-6.12.111+deb13-amd64 6.12.111-1 ltlinux-image-6.12.113+deb13-amd64 6.12.113-1 gelinux-image-6.12.118+deb13-amd64 6.12.118-1 ge

Ubuntu 24.04 works the same way. uname -r shows 6.8.0-149-generic without the trailing .149, so compare the full package version (6.8.0-149.149).

console
$ for p in linux-image-6.8.0-134-generic linux-image-6.8.0-147-generic linux-image-6.8.0-149-generic linux-image-6.8.0-151-generic; do v=$(apt-cache show "$p" | awk "/^Version:/{print \$2; exit}"); if dpkg --compare-versions "$v" ge 6.8.0-149.149; then r=ge; else r=lt; fi; echo "$p $v $r"; done
output
linux-image-6.8.0-134-generic 6.8.0-134.134 ltlinux-image-6.8.0-147-generic 6.8.0-147.147 ltlinux-image-6.8.0-149-generic 6.8.0-149.149 gelinux-image-6.8.0-151-generic 6.8.0-151.151 ge

On Debian 12 servers that use the linux-6.12 line, compare with 6.12.113-1~deb12u1 in the same way.

[4] If the version is older than the fixed one, update the kernel and reboot. A plain apt-get upgrade can hold back a new kernel package that has a different name, so read the plan first and allow new packages. The details are in the Debian 13.8 update guide.

console
$ sudo apt-get update$ sudo apt-get -s --with-new-pkgs upgrade$ sudo apt-get --with-new-pkgs upgrade

After the install, the old kernel keeps running until the reboot. Reboot in a maintenance window, then repeat steps [2] and [3]. The boot time should be later than the kernel's install or upgrade time, and the running kernel's package version should be the fixed one or newer. If only a package with the same name was updated, uname -r may not change. To see whether a new kernel is waiting, see needrestart after an Ubuntu security update.

[5] Reduce exposure only while you must wait. These are not fixes, and the commands below were not tested here. On a remote server, secure console access (IPMI, KVM or the cloud console) first.

First check whether usb-storage and uas are loaded or built in.

console
$ lsmod | grep -E '^(usb_storage|uas) '$ grep -E 'usb-storage|/uas' /lib/modules/$(uname -r)/modules.builtin

Blocking automatic loading does not work for built-in drivers or modules that are already loaded. For modules, create a file in /etc/modprobe.d/.

/etc/modprobe.d/usb2shell-block.conf
install usb-storage /bin/falseinstall uas /bin/false

blacklist tells modprobe to ignore a module's own device aliases; the man page does not say it stops loading by name. install module command runs the command instead of inserting the module. modprobe.d(5) This setting disables USB storage, so do not apply it to servers that boot from USB or use USB backup or root devices. To undo it, delete the file and reboot.

The other option is the kernel's USB authorization. Writing 0 to authorized_default of a host controller usbX leaves newly connected devices unauthorized until root authorizes them. Value 2 authorizes by default only devices on internal ports. Kernel documentation

Record the current values before you change them. Run these commands as root.

console
# grep . /sys/bus/usb/devices/usb*/authorized_default# for host in /sys/bus/usb/devices/usb*; do echo 0 > "$host/authorized_default"; done

The documentation says only devices that root authorizes can be used, so a newly connected USB keyboard or mouse does not work until you authorize it. To undo the change, write the original value you recorded back to each controller (do not assume they were all 1). This value is the default for newly connected devices, so authorize a device that is already blocked by writing 1 to /sys/bus/usb/devices/<device>/authorized. The documentation's example writes the value from a boot script (rc.local) and authorizes devices with udev. Making the setting persistent was not tested. USBGuard, an allow-list tool, says it works on top of the same kernel feature; it was not tested either.

Where the check goes wrong

  • uname -r inside a container shows the host kernel. Judge a container by the kernel of its host.
  • The checker script on the researcher page was not downloaded or run, and this guide does not use it. Do not pipe a downloaded script straight into a shell.
  • The fixed-version table was read on 2026-12-01. Versions can change, so look at the trackers again before you apply it.

#linux-kernel#cve#usb#debian#ubuntu