
Shell script that applies an interim nftables and sysctl mitigation for CVE-2026-98432 on Ubuntu, with check, self-test, apply, and remove commands.
An interim mitigation for CVE-2026-98432, a use-after-free in the Linux kernel's IPv4 TCP code that affects kernels back to 4.4.
This does not patch your kernel. It makes the bug harder to reach until Ubuntu ships a fixed kernel. Install that kernel when it's available, then run remove. Check the current status on Ubuntu's CVE page.
sudo ./cve-2026-98432-mitigate.sh check # report status, changes nothing
sudo ./cve-2026-98432-mitigate.sh self-test # prove the rule works, in a temporary namespace
sudo ./cve-2026-98432-mitigate.sh apply # apply the mitigation
sudo ./cve-2026-98432-mitigate.sh remove # undo it, after installing a fixed kernel
Read the script before running it as root.
check exits with 0 if the host is fixed or mitigated, 1 if it is exposed, and 2 if it could not run.
apply does--keep-mptcp if the host really needs MPTCP.It also installs the nftables package if it's missing.
It creates these files:
/etc/nftables-cve-2026-98432.nft
/etc/systemd/system/cve-2026-98432-nft.service
/etc/sysctl.d/90-cve-2026-98432-mptcp.conf
Restart services that are listening on MPTCP. Existing sockets stay MPTCP until the service restarts. The script lists them but won't restart anything for you.
Go 1.24 and later enables MPTCP on listeners by default when the kernel supports it, so you may have MPTCP listeners you never chose. On older kernels ss -M won't show listeners, so check looks for tcp-ulp-mptcp in ss -tlni instead.
docker run --sysctl net.mptcp.enabled=0. The firewall rule sees traffic entering through the host's network stack, but setups such as macvlan or ipvlan can bypass it./etc/nftables.conf starts with flush ruleset, so restarting or reloading nftables.service removes the rule until the next boot. Run check afterwards, or run apply again.check looks for the CVE in the running kernel's Ubuntu changelog. If it isn't listed, the script treats the kernel as vulnerable, even if the fix arrived some other way.apply, check, self-test and remove were run in containers with the userland of Ubuntu 20.04, 22.04, 24.04 and 26.04, all on one 5.15 host kernel. Other kernels weren't tested.
Containers don't run systemd, so the script's service start and a real reboot weren't exercised. After you apply this, run self-test on your own system, and run check after your next reboot to confirm the rule came back.
Special courtesy of Team Valken.
Public domain, under the Unlicense. No warranty: you run this at your own risk.