View all Worklets
LinuxLinux

Disable the Bluetooth Kernel Module to Mitigate CVE-2026-31512 on Linux

Blocks the Bluetooth kernel module from loading on Linux servers to mitigate the CVE-2026-31512 L2CAP out-of-bounds read

Worklet Details

What the CVE-2026-31512 Bluetooth module block Worklet does

This Automox Worklet™ stops modprobe from loading the bluetooth kernel module to mitigate CVE-2026-31512 on Linux servers. It's a temporary workaround until you install a fixed kernel. Where your distribution ships a fixed kernel, installing it is the preferred fix.

The Worklet writes a modprobe configuration file, /etc/modprobe.d/automox-cve-2026-31512-bluetooth.conf, with two directives. The blacklist bluetooth line stops modprobe from loading the module automatically through its aliases. The install bluetooth /bin/false line tells modprobe to run /bin/false in place of loading the module, so a request to load bluetooth fails.

Blocking the module disables every Bluetooth peripheral on the server, including keyboards, mice, and headsets. That's why the Worklet targets servers. It doesn't unload a module that's already in memory, and it doesn't reboot the server. Each run writes UTC-timestamped log lines to the Activity Log, whether the run passes or fails.

Why block the Bluetooth kernel module for CVE-2026-31512

CVE-2026-31512 is an out-of-bounds read in the Linux kernel Bluetooth L2CAP component, in the l2cap_ecred_data_rcv function. Tenable detects it with Nessus plugin 309774 and rates it Medium. Red Hat's stated mitigation is to prevent the bluetooth module from loading.

Kernel fix status for CVE-2026-31512 by release, from the Red Hat, Debian, and Ubuntu security trackers:

  • Debian 11, 12, and 13, Ubuntu 22.04, and Ubuntu 24.04 on the 6.8 GA kernel: fixed kernels are available

  • Ubuntu 20.04 on a 5.15 kernel other than GKE: fixed kernels are available through Ubuntu Pro

  • RHEL 7 through 10, Ubuntu 18.04, and Ubuntu 20.04 on a 5.4 kernel: no kernel fix

Use this Worklet when you need the bluetooth module blocked on Linux servers that have no fixed kernel, or as a stopgap while you schedule a kernel update. One policy covers RHEL, Ubuntu, and other systemd-based distributions. Servers that already deny the module get no change. The first remediation records the configuration file's prior state, so you can roll the change back once a fixed kernel is in place.

How the Bluetooth modprobe.d block works

  1. Evaluation phase: Exits 0 as not applicable when /etc/modprobe.d doesn't exist. It then reads /lib/modules/$(uname -r) for the running kernel. If modules.builtin lists bluetooth.ko, the kernel has the driver built in rather than as a loadable module.

    For a built-in driver, the Worklet logs a WARN naming the kernel version and stating that a kernel update is required. It exits 0 with no remediation scheduled. If modules.dep has no bluetooth.ko entry and /sys/module/bluetooth doesn't exist, it logs not applicable and exits 0.

    For a loadable module, the Worklet finds the effective install bluetooth directive in kmod's file order. It reads .conf and .alias files from /etc/modprobe.d, /run/modprobe.d, /usr/local/lib/modprobe.d, /usr/lib/modprobe.d, and /lib/modprobe.d, in that priority order. A file in a higher-priority directory masks a file with the same name further down. The Worklet sorts the combined set by file name and uses only the first install bluetooth line it finds.

    That line must be install bluetooth /bin/false or install bluetooth /bin/true, and the Worklet also accepts the /usr/bin paths and an optional trailing comment. A blacklist bluetooth line on its own doesn't count, and neither does a deny chained to another shell command. The check runs across all five directories and again across /etc/modprobe.d, /run/modprobe.d, and /lib/modprobe.d only, because kmod versions before 29 don't read /usr/local/lib/modprobe.d. Both views must pass.

    If the check fails, the Worklet logs NON-COMPLIANT and exits 1 to schedule remediation. The log line names the file and line it found, or reports that it found no install-deny directive. When the block is in place but /sys/module/bluetooth exists, it logs a WARN that the module stays loaded until the server reboots, then exits 0 without scheduling remediation. Otherwise it logs COMPLIANT and exits 0.

  2. Remediation phase: Repeats the evaluation checks before it writes the block, so you can launch it directly with FixNow or Run Policy. It exits 0 with no change when /etc/modprobe.d is missing, no loadable module exists, or the block is already in place. On a kernel with bluetooth built in, it logs an ERROR and exits 1 with no change.

    The first time the Worklet remediates a server, it creates /var/lib/automox/workletcache/caec1bc0-11af-5ef8-a099-2352f877649a/ and records in prior-state.txt whether the target file already existed. If it did, the Worklet copies it to automox-cve-2026-31512-bluetooth.conf.bak in the same folder. The Worklet keeps that first record on later runs. It then writes a comment line, blacklist bluetooth, and install bluetooth /bin/false to /etc/modprobe.d/automox-cve-2026-31512-bluetooth.conf, replacing any earlier content.

    A post-write check runs the same compliance test. If an earlier-sorting modprobe.d file holds an install bluetooth line that doesn't deny loading, the Worklet logs Post-verify FAILED with that file and line, then exits 1. On success it logs Post-verify PASSED, adds a reboot WARN if the module is loaded, and exits 0.

    With dryrun=yes, the Worklet logs each planned change without writing anything. With rollback=yes, it reads prior-state.txt, then deletes the configuration file or restores the backup. Rollback exits 1 if the state record or the backup is missing.

    Before a rollback, remove the server's group from any policy that runs this Worklet with rollback=no. Otherwise, after the rollback, that policy's next scheduled run reports NON-COMPLIANT and writes the block again. To roll back, create a policy from this Worklet for the server's group and set rollback=yes at the top of its remediation code. Launch it with Run Policy: a blocked server evaluates compliant, so a scheduled run never calls its remediation.

Bluetooth module block requirements

  • Linux servers running RHEL 7 or later, Ubuntu 18.04 or later, or another systemd-based distribution

  • A running kernel that ships bluetooth as a loadable module. On kernels with bluetooth built in, the Worklet makes no change and logs that a kernel update is required.

  • Module loading through modprobe, with an /etc/modprobe.d directory on the server

  • Root privileges for the Automox agent, which writes to /etc/modprobe.d and /var/lib/automox/workletcache

  • Bash 4 or later and the standard utilities grep, uname, sort, basename, mktemp, date, cat, tee, mkdir, cp, and rm

  • A reboot window for servers where the bluetooth module is already loaded

  • Optional remediation variables dryrun and rollback, which default to no. Set either one to yes at the top of the remediation code of a policy created from this Worklet.

Expected Bluetooth module state after remediation

After remediation, /etc/modprobe.d/automox-cve-2026-31512-bluetooth.conf holds the block and modprobe refuses to load bluetooth. The remediation run logs Post-verify PASSED and exits 0. On a server where the module wasn't loaded, the next evaluation logs COMPLIANT and names the file and line that deny it.

If the module was loaded during remediation, the Activity Log shows a WARN to reboot. Stopping bluetoothd doesn't unload the kernel module. Until the server reboots, each evaluation logs a WARN to reboot and exits 0 without scheduling remediation again. After the reboot, Bluetooth keyboards, mice, and headsets on the server stop working, and evaluation logs COMPLIANT once /sys/module/bluetooth is gone.

View in app

Consider Worklets your easy button

What's a Worklet?

An Automox Worklet™ is a Bash or PowerShell automation that takes action on Windows, macOS, and Linux endpoints at scale. It handles everything from configuration and software management to named-CVE mitigations deployed within hours of disclosure, including vulnerabilities that have no patch yet, are configuration-based, or that a vendor won't fix.

Every Automox-published Worklet is human-reviewed, and customers control where, when, and how it runs.

Mitigation at AI speed

Disclosure to mitigation in minutes or hours

Frontier-model AI is finding vulnerabilities faster than most teams can track, and most of what it finds isn't immediately patchable. Finding isn't fixing. Worklets turn discovery into action.

  • Search by CVE or browse the Mitigations category
  • Review the Worklet before you deploy it
  • FixNow for urgent exposure
  • Verify execution through Activity Log and Policy Results
Mitigating Vulnerabilities with Automox