Skip to content
Exploit for CVE-2026

Exploit for CVE-2026

Sploitus • November 5, 2026

`CVE-2026-98432-mitigation.sh` applies (or removes) a host firewall rule that drops incoming IPv4 TCP packets carrying IPv4 options.

[CVE-2026-98432]( is a use-after-free flaw in the Linux kernel code that sets up incoming IPv4 TCP connections. A remote attacker can trigger it by sending TCP connection requests that carry IPv4 options to any listening IPv4 TCP port. No credentials or user interaction are needed. The Linux kernel CVE team rates this issue Critical, with a CVSS v3.1 score of 9.8. Operating system vendors rate it between Important and Critical.

- [CVE-2026-98432 firewall mitigation](#cve-2026-98432-firewall-mitigation)

- [Disable (`--disable`)](#disable---disable)

- [Check the patch status only](#check-the-patch-status-only)

- [Kernel already patched](#kernel-already-patched)

- [Amazon Linux, kernel not patched](#amazon-linux-kernel-not-patched)

- [Apply with iptables (nft not installed)](#apply-with-iptables-nft-not-installed)

- [Kernel older than 4.4](#kernel-older-than-44)

- [Disable when nothing is loaded](#disable-when-nothing-is-loaded)

- `nft` (nftables) or `iptables` (with the `u32` match module)

- Root, or a user with `sudo` (the script uses `sudo` only when not run as root)

./CVE-2026-98432-mitigation.sh # apply the mitigation unless the running kernel is confirmed patched (ignored on Amazon Linux)

./CVE-2026-98432-mitigation.sh --check # only report the kernel patch status, change nothing

./CVE-2026-98432-mitigation.sh --force # apply the mitigation even if the kernel looks patched (ignored on Amazon Linux)

./CVE-2026-98432-mitigation.sh --disable # remove the mitigation (skipped on Amazon Linux)

./CVE-2026-98432-mitigation.sh --help # show usage

`--check`, `--force` and `--disable` are mutually exclusive. Any unknown option prints the usage text and exits with status 1.

1. **Kernel check.** Reads `uname -r` and takes the `major.minor` part. The script continues only if that is `4.4` or later (compared with `sort -V`), matching the AWS bulletin's "4.4 and later". Kernels older than 4.4 exit with status 0 and no changes.

2. **Patch status check.** Distros backport the fix, so the version number alone cannot tell whether a kernel is patched. The script looks for the CVE in the distro metadata of the package that owns the **running** kernel (a patched kernel that is installed but not booted does not count). See [Patch detection](#patch-detection).

- **Amazon Linux:** the mitigation is **never applied**, not even with `--force`, because patched kernels are available and updating the kernel is the right solution. If the kernel is not confirmed patched, the script prints the AWS bulletin link and exits 0.

- **Other distributions, `patched`:** the script prints that no mitigation is needed and exits 0 (unless `--force` is given).

- **Other distributions, `not-patched` or `unknown`:** the mitigation is applied. The check is fail-closed, so the firewall rule is added unless the kernel is positively confirmed patched. This covers distros that have not released a fix yet.

3. **Tool selection.** Uses `command -v` to detect what is installed. `nft` is preferred; `iptables` is used only if `nft` is missing. Only one tool is used, so the rule is never applied twice.

- Writes the ruleset to `/etc/cve-2026-98432.nft`.

- Deletes a previously loaded `inet cve_2026_98432` table, if any (so re-runs are idempotent).

- Validates with `nft -c -f`, then loads with `nft -f`.

- Adds `include "/etc/cve-2026-98432.nft"` to `/etc/nftables.conf` if not already there.

- Validates `/etc/nftables.conf` and runs `systemctl enable nftables.service` so the rule survives a reboot.

- Checks with `iptables -C` whether the rule exists; if not, inserts it at position 1 of `INPUT`.

- Lists `INPUT` with `-n -v --line-numbers`.

- The rule is defined once, in the `IPT_ARGS` array, and reused for check, insert, delete and verification.

6. **Confirmation.** Checks that the rule is present and prints an `ACTION:` line saying which tool added it (`rule ADDED using nft` or `rule ADDED using iptables`). If the rule is not found it prints `ACTION: rule was NOT added.` to stderr. Exit status is 0 on success, 1 otherwise.

The distribution is read from `ID` and `ID_LIKE` in `/etc/os-release`.

| Amazon Linux 2023, RHEL family (`amzn`, `rhel`, `fedora`, `centos`) with `dnf` | `dnf -q updateinfo list --installed --cves CVE-2026-98432`. The kernel package line must match the running kernel exactly. |

| Same family without `dnf` (for example Amazon Linux 2) | `rpm -q --changelog` of the package owning `/boot/vmlinuz-$(uname -r)` for the CVE. |

| Debian, Ubuntu | `/usr/ /doc/linux-image-$(uname -r)/changelog.Debian.gz` (or `changelog.gz`) for the CVE. |

| Anything else | Status `unknown`, so the mitigation is applied. |

With `dnf`, the command lists installed packages covered by an advisory for the CVE, for example:

ALAS2023-2026-3335 Important/Sec. kernel6.12-1:6.12.113-138.209.amzn2023.x86_64

ALAS2023-2026-3335 Important/Sec. kernel6.12-devel-1:6.12.113-138.209.amzn2023.x86_64

The script keeps only the `kernel`/`kernelX.Y` package whose `version-release.arch` equals `uname -r`. The `-headers`, `-devel` and `-tools` packages and other installed kernels are ignored. If there is no output apart from the metadata line, the status is `not-patched`. If `dnf` itself fails (for example no repository metadata), the status is `unknown`.

On Amazon Linux (`ID=amzn`), any status other than `patched` (`not-patched` or `unknown`) prints an extra line pointing to the AWS bulletin, in both normal and `--check` runs:

Please update the Kernel version, see

The line is not printed when the kernel is `patched`, or on other distributions. On Amazon Linux the script then stops without touching the firewall (see [Apply](#apply-default)).

| `patched` | The CVE is listed for the running kernel | No mitigation (unless `--force`, which is ignored on Amazon Linux) |

| `not-patched` | The check ran but did not find the CVE | Apply the mitigation (Amazon Linux: print the bulletin link, no mitigation) |

| `unknown` | The check could not run (unsupported distro, no changelog, `dnf` failure) | Apply the mitigation (Amazon Linux: print the bulletin link, no mitigation) |

**Amazon Linux:** `--disable` is skipped. The script never applies the mitigation there, so there is nothing for it to remove. It prints "Amazon Linux detected: the mitigation is never applied here, so --disable is skipped." and exits 0. If a rule was added by hand or by an earlier version of the script, remove it manually.

On other distributions the kernel check is skipped, so removal always works.

- **nft:** removes the include line from `/etc/nftables.conf` with `sed`, then runs `nft delete table inet cve_2026_98432`.

- **iptables:** runs `iptables -D` on the same rule, after confirming it exists with `-C`.

- A missing `/etc/nftables.conf` produces a note and the script carries on.

- If the nft table is not loaded, or the iptables rule is not present, the script prints a note and **exits with status 1 immediately**, because there is nothing to remove. For nft this happens after the include line has already been removed from `/etc/nftables.conf`.

- On success it prints `ACTION: rule REMOVED using `. If the rule is still present it prints `ACTION: rule was NOT removed.` to stderr and exits 1.

type filter hook input priority -310; policy accept;

ip protocol tcp ip hdrlength > 5 counter drop

iptables -I INPUT 1 -p tcp -m u32 --u32 '0>>24&0x0f=6:15' -j DROP

Both match TCP packets whose IPv4 header length (IHL) is greater than 5 words, i.e. packets that carry IPv4 options.

The nft ruleset is deliberately multi-line. Some nft versions reject a closing `}` on the same line as the last statement (`syntax error, unexpected '}', expecting newline or semicolon`), which is what a one-line version of this ruleset triggers.

The output below is illustrative. Exact text depends on the host.

Detected kernel: 6.12.113-138.209.amzn2023.x86_64 (major.minor: 6.12)

Kernel 6.12 is 4.4 or later. Checking patch status.

Patch status: patched (advisory ALAS2023-2026-3335 covers running kernel kernel6.12-1:6.12.113-138.209.amzn2023.x86_64)

Detected kernel: 6.12.113-138.209.amzn2023.x86_64 (major.minor: 6.12)

Kernel 6.12 is 4.4 or later. Checking patch status.

Patch status: patched (advisory ALAS2023-2026-3335 covers running kernel kernel6.12-1:6.12.113-138.209.amzn2023.x86_64)

Running kernel already contains the fix for CVE-2026-98432. No mitigation needed.

Detected kernel: 6.1.100-110.200.amzn2023.x86_64 (major.minor: 6.1)

Kernel 6.1 is 4.4 or later. Checking patch status.

Patch status: not-patched (no advisory for CVE-2026-98432 covers the running kernel package)

Please update the Kernel version, see

Firewall mitigation is not applied on Amazon Linux: update the kernel and reboot.

With `--force` the result is the same, plus the line `--force is ignored on Amazon Linux.`

Detected kernel: 5.15.0-91-generic (major.minor: 5.15)

Kernel 5.15 is 4.4 or later. Checking patch status.

Patch status: not-patched (CVE-2026-98432 not found in /usr/ /doc/linux-image-5.15.0-91-generic/changelog.Debian.gz)

Running kernel is not confirmed patched. Applying mitigation.

[nft] Creating rule file /etc/cve-2026-98432.nft

ACTION: rule ADDED using nft (table inet cve_2026_98432).

### Apply with iptables (nft not installed)

Detected kernel: 4.19.0-25-amd64 (major.minor: 4.19)

Kernel 4.19 is 4.4 or later. Checking patch status.

Patch status: unknown (no readable changelog under /usr/ /doc/linux-image-4.19.0-25-amd64)

Running kernel is not confirmed patched. Applying mitigation.

[iptables] Adding rule to drop IPv4 TCP packets with IPv4 options

ACTION: rule ADDED using iptables (INPUT chain).

Detected kernel: 3.10.0-1160.el7.x86_64 (major.minor: 3.10)

Kernel 3.10 is older than 4.4. No action taken.

$ ./CVE-2026-98432-mitigation.sh --disable

[nft] Removing include line from /etc/nftables.conf

ACTION: rule REMOVED using nft (table inet cve_2026_98432).

$ ./CVE-2026-98432-mitigation.sh --disable

[nft] Removing include line from /etc/nftables.conf

[nft] Table inet cve_2026_98432 not loaded

sudo nft list table inet cve_2026_98432 # nft: show the table and drop counter

sudo iptables -L INPUT -n -v --line-numbers # iptables: show INPUT rules

- **Re-running apply is safe.** An existing nft table is replaced and an existing iptables rule or `include` line is not duplicated.

- **Re-running `--disable` exits 1** when there is nothing left to remove (see the Disable section), so do not treat that exit code as a hard failure in automation.

- **Left in place by `--disable`:** `/etc/cve-2026-98432.nft` and the enabled `nftables.service`. Delete the file manually if you no longer need it.

- **iptables persistence:** the iptables rule is not saved across reboots. Use your distribution's mechanism (for example `iptables-persistent` or `iptables-save`) if you need that.

- **Duplicates:** `--disable` removes one copy of the iptables rule. If the rule was inserted several times by hand, run it again until it reports the rule as removed.

- **Mixed setups:** if both tools are installed, only nft is managed. A rule previously added with iptables must be removed with `iptables -D` manually.

- **Reboot required:** A kernel update only counts once the host has booted into it, because the check uses the running kernel. After updating, reboot, then re-run with `--check`, then `--disable` if you want to remove the mitigation.

- **Patch detection limits:** It relies on the distro naming the CVE in its advisory data or package changelog. A missing mention is treated as not patched, so the worst case is an unnecessary firewall rule. Kernel livepatches are not detected. The Amazon Linux 2 path (`rpm` changelog) and the Debian/Ubuntu changelog path depend on the distro including CVE IDs in those changelogs, which I could not confirm for this CVE. Run `--check` on a sample host of each distro first.

- **Test first:** the nft and iptables paths have not been run on a live host from this repository's authoring environment (macOS). Try them on a non-production system first, and keep console access in case of lockout.

Extracted Entities

Companies (2)

CWE Weaknesses (1)

Platforms (2)

Tools (2)