Temporary nftables mitigation for CVE-2026-98432 (Linux IPv4 TCP IP-options use-after-free)
CVE-2026-98432 is a use-after-free in the Linux kernel's IPv4 TCP connection setup (CVSS 9.8). An attacker who can reach any IPv4 TCP port on the server can trigger it remotely, without logging in. It affects kernels 4.4 and later. The trigger is IP options in an incoming TCP SYN packet.
cve-2026-98432-mitigate.sh drops inbound IPv4 TCP packets that carry IP
options. Legitimate traffic essentially never carries IP options.
This is not a fix. Ubuntu describes this mitigation as one that "reduces the risk but does not fully prevent exploitation". The fix is your distribution's updated kernel, followed by a reboot. Use this script only until you can do that.
curl -fsSLO https://raw.githubusercontent.com/zenjabba/cve-2026-98432-mitigation/main/cve-2026-98432-mitigate.sh
less cve-2026-98432-mitigate.sh # read it before you run it as root
sudo bash cve-2026-98432-mitigate.sh --dry-run # show what it would do, change nothing
sudo bash cve-2026-98432-mitigate.sh # install
sudo bash cve-2026-98432-mitigate.sh status # check it at any time
The script creates one nftables table. It never runs flush ruleset and never
touches any other table:
table ip cve_2026_98432 {
chain prerouting {
type filter hook prerouting priority -300; policy accept;
ip protocol tcp ip hdrlength > 5 counter drop comment "CVE-2026-98432: IPv4 TCP with IP options"
}
}
prerouting hook at priority -300, rather than input. The rule
then also covers traffic that is forwarded or port-mapped to Docker, LXC or
Podman containers. Those containers share the host's kernel, so they are
just as vulnerable. UFW rules and Docker's DOCKER-USER chain do not see
that traffic.| File or unit | Purpose |
|---|---|
/etc/nftables.d/cve-2026-98432.nft | The rule. |
cve-2026-98432-nft.service | A systemd oneshot unit that loads the rule at boot, before networking starts. |
/etc/sysctl.d/90-cve-2026-98432.conf | Created only with --disable-mptcp. |
The script does not enable, start or restart nftables.service, and it does
not edit /etc/nftables.conf. On Debian and Ubuntu that file begins with
flush ruleset, which would wipe the rules that Docker, UFW, firewalld and
Tailscale manage. The script stops and reloads none of those tools.
install (default) | Loads the rule now and makes it persistent. |
status | Shows whether the rule is loaded, how many packets it has dropped, the boot unit's state, your kernel version and net.ipv4.tcp_migrate_req. Exits 0 if the mitigation is active and 1 if it is not. |
uninstall | Removes the table, the unit and the files the script added. Nothing else is changed. |
--dry-run | Prints every change the script would make and validates the rule with nft -c, without changing anything. |
--install-nft | If nft is missing, installs your distribution's nftables package with apt, dnf, yum or zypper. This is the only time the script uses the network. |
--disable-mptcp | Also sets net.mptcp.enabled=0. See the MPTCP section below. |
If nft is not installed and you do not pass --install-nft, the script
falls back to one iptables rule in the raw table, with its own boot unit,
cve-2026-98432-iptables.service:
iptables -t raw -I PREROUTING -p tcp -m u32 --u32 '0>>24&0x0f=6:15' -m comment --comment CVE-2026-98432 -j DROP
nftables is preferred. On a system that has neither nft nor iptables, the
script stops with exit code 2 and tells you to use --install-nft.
br_netfilter), because their packets never
pass through the host's prerouting hook. Those containers still run on the
host's kernel, so run the script inside them as well. Virtual machines have
their own kernels: patch or mitigate each VM separately.nftables.service, restarting or reloading
it flushes the whole ruleset. The boot unit is tied to it and loads the table
again automatically. One case is not covered: starting nftables.service for
the first time while the mitigation is already loaded. Afterwards, run
systemctl restart cve-2026-98432-nft. A hand-run nft flush ruleset or
nft -f /etc/nftables.conf also removes the table. status always shows the
real state.iptables-restore,
netfilter-persistent, iptables-services) or reloading a firewall manager
that flushes the raw table (CSF, firewalld with the iptables backend) can
remove the rule. Restore it with
systemctl restart cve-2026-98432-iptables. If you save your rules while the
rule is loaded, the saved file contains it too, and uninstall does not
edit saved files.net.ipv4.tcp_migrate_req=1, or a BPF sk_reuseport migrate program,
opens a second path to the same bug. status warns if the sysctl is set.
Unless you rely on it, set it to 0.--disable-mptcp is optional defence in depth only. Services that
are already listening on MPTCP keep running until you restart them (list them
with ss -Mlnp). The setting applies per network namespace.ip protocol 6 in the listing. On systems without /etc/protocols
(minimal images without the netbase package), nft list shows the rule as
ip protocol 6 ... instead of ip protocol tcp .... It is the same rule.nftables package normally enables
and starts nftables.service; --install-nft prevents both.The upstream (kernel.org) fixes are in 5.10.272, 5.15.223, 6.1.190, 6.6.159, 6.12.113, 6.18.56, 7.2.10 and 7.3.
Distribution kernels backport fixes without moving to those version numbers, so the version number alone does not tell you whether a kernel is fixed. Check your distribution's advisory:
-proposed.A new kernel takes effect only after a reboot. Check with uname -r afterwards.
Once you run a fixed kernel, remove the mitigation with
sudo bash cve-2026-98432-mitigate.sh uninstall, or keep it: it does not
affect normal traffic.
The script was tested in Docker containers on Ubuntu 18.04, 22.04 and 24.04, Debian 12, and Rocky Linux 8 and 9, using both the nftables path and the iptables fallback. The tests cover: