Engineering, AI & Security

CVE-2026-139281: The 21-Year Linux Netfilter IPv6 Firewall Bypass and Why Standard Mitigations Fail

How a single 8-bit integer in nf_conntrack survived 21 years of Linux kernels, why generic raw-table workarounds run too late, and how to measure your real IPv6 blast radius.

By Josué Trindade Engineering & AI ~12 min

You configure a Linux server with a clean default-drop firewall. In UFW, nftables, or Docker’s DOCKER-USER chain, only SSH, HTTP, and HTTPS are permitted from the internet. Your admin panel on port 3000, your cluster control plane, and internal UDP daemons sit behind stateful inspection rules that explicitly reject unsolicited traffic. On IPv4, the rule works as advertised. On IPv6, a single two-fragment packet slips through, tricks the kernel into recording it as allowed DNS traffic, and lands straight inside a blocked internal service.

That is the practical failure behind CVE-2026-139281 (CVSS 9.1), disclosed after research credited to Jérémy Jean at ANSSI and resolved upstream in Linux kernel commit 48d522b65fb0ce2bd54f8f5838d77b48afcf1f3e. The underlying bug, a single unsigned 8-bit integer (u8) truncation inside IPv6 connection-tracking reassembly, had lived in the Linux kernel since v2.6.15 in January 2006: roughly 21 years of production servers.

What makes this advisory treacherous for operators is not just the severity score. Within hours of disclosure, generic one-liners began circulating online suggesting ip6tables -t raw or simple nftables frag rules as quick workarounds. Most of those snippets look plausible and fail silently against the actual packet flow because of Netfilter hook ordering.

To decide whether to disable IPv6 on an interface, tighten cloud perimeter filters, or simply wait for your distribution’s kernel package, you first need to understand where the u8 truncation happens and how to measure your server’s real exposure.

How the 21-year find_prev_fhdr() u8 bug bypasses stateful firewalls

Unlike IPv4, where routers can fragment packets in transit, IPv6 uses a fixed 40-byte base header followed by optional chained extension headers (Hop-by-Hop Options, Routing, Destination Options, Fragment). Before a stateful Linux firewall (iptables, ip6tables, nftables, ufw, or firewalld) can inspect ports and track state in nf_conntrack, the kernel must reassemble fragmented IPv6 packets so Netfilter sees a single coherent transport header.

Inside net/ipv6/netfilter/nf_conntrack_reasm.c, the helper function find_prev_fhdr() walks the chain of IPv6 headers to locate the offset of the Next Header field immediately preceding the IPv6 Fragment header. That offset is returned to the caller through an int pointer, which is large enough for any valid header offset. Inside the function body, however, the working variable tracking that offset was declared as u8, holding only values from 0 to 255.

If an attacker sends a fragmented IPv6 packet with a long sequence of legitimate extension headers pushing the Fragment header past byte 255, the u8 local counter wraps around modulo 256 before the value is saved in the fragment queue.

Crafted 2-fragment IPv6 packet (extension headers > 255 bytes)
  |
  v
nf_conntrack IPv6 defragmentation (priority -400)
  |-- find_prev_fhdr() tracks offset in a u8 -> wraps past byte 255
  |-- reassembly writes Next Header using truncated offset
  '-- corrupts header chain for conntrack parser
  |
  +--> conntrack view: parses wrapped offset -> sees allowed tuple (e.g. UDP :53)
  |      '--> UFW / nftables / DOCKER-USER accepts ESTABLISHED/allowed port
  |
  '--> IPv6 local delivery: parses true packet layout -> delivers to blocked port (e.g. UDP :9999)

Notice the two different views of the same reassembled packet:

  1. What nf_conntrack records: Using the truncated offset during reassembly overwrites an unintended byte in the header chain, desynchronizing conntrack from the true transport payload. According to the CVE-2026-139281 record, a crafted two-fragment packet can be logged by Netfilter as UDP destination port 53 (allowed by a permissive rule, or matched as an innocent flow) while the actual payload routes to UDP port 9999.
  2. What local IPv6 delivery sees: Once the Netfilter verdict says ACCEPT, the host IPv6 stack delivers the packet according to the true header layout straight to the restricted listening socket.

No authentication is required, and no user interaction is involved. Any stateful rule that depends on nf_conntrack to distinguish allowed external ports from restricted internal ports fails when nf_defrag_ipv6 misclassifies the tuple.

Why viral “quick firewall mitigations” fail in practice

When a kernel patch is still rolling through distro build queues, administrators naturally look for a firewall rule they can deploy in ten seconds. For CVE-2026-139281, two widely shared workarounds miss the target.

Trap 1: Adding drop rules to the raw table (priority raw)

In Linux kernel header <linux/netfilter_ipv6.h>, Netfilter hook priorities are strictly ordered by signed integer value, where lower numbers execute first:

  • NF_IP6_PRI_CONNTRACK_DEFRAG = -400
  • NF_IP6_PRI_RAW = -300
  • NF_IP6_PRI_CONNTRACK = -200
  • NF_IP6_PRI_FILTER = 0

That ordering means nf_conntrack IPv6 defragmentation executes at -400, before the raw table at -300. Any ip6tables -t raw -A PREROUTING -m frag ... -j DROP rule or nftables type filter hook prerouting priority raw rule inspects packets after nf_conntrack_reasm.c has already walked the fragments and triggered the u8 truncation. By the time raw runs, a fragment has already been reassembled (or corrupted).

Trap 2: Matching ip6 nexthdr ipv6-frag in nftables

Another common rule looks clean at a glance:

# INCOMPLETE: misses fragmented packets preceded by extension headers
ip6 nexthdr ipv6-frag drop

In nftables, ip6 nexthdr reads only the Next Header field of the fixed 40-byte IPv6 base header. It does not walk chained extension headers. Because exploiting CVE-2026-139281 requires inserting long extension headers between the base IPv6 header and the Fragment header to exceed byte 255, an attacker’s first Next Header value is something like Hop-by-Hop (0), Routing (43), or Destination Options (60), never 44 (ipv6-frag). A rule checking ip6 nexthdr ipv6-frag lets the exact exploit packet walk straight past, even if placed at an earlier netdev ingress hook.

If you want to understand how nftables hooks and conntrack stages interact cleanly on production servers, our breakdown of nftables packet flow and hook ordering covers the full pipeline.

Auditing your real blast radius in 30 seconds

Not every Linux server running a vulnerable kernel has the same practical risk. Before changing sysctl parameters or taking services offline, run four read-only checks over SSH to map what is actually exposed on your machine.

First, verify your running kernel, loaded Netfilter modules, and whether your host even has a globally routable IPv6 address:

uname -a
lsmod | grep -E 'nf_conntrack|nf_defrag_ipv6'
ip -6 addr show scope global
grep -E '^(Ip6InReceives|Ip6ReasmReqds|Ip6ReasmFails)\b' /proc/net/snmp6

If nf_defrag_ipv6 is not loaded (for instance, no stateful conntrack rules and no Docker bridge NAT/filtering), or if ip -6 addr show scope global returns nothing and there is no default IPv6 route, external exploitation via internet routing drops sharply (link-local or LAN-adjacent attack surfaces still depend on your local network). Note that /proc/net/snmp6 also lets you verify immediately whether any fragmented IPv6 packets (Ip6ReasmReqds) have even reached the host since boot.

Second, inspect every listening IPv6 and dual-stack socket against your IPv6 firewall rules (nft list ruleset or ufw status verbose):

sudo ss -tulnp -6

Do not treat every line of ss -tulnp -6 equally. Group sockets into three buckets:

Socket bind pattern Example ports Practical CVE-2026-139281 risk Why
Loopback only ([::1]:port) [::1]:953, [::1]:631 None from network Kernel loopback addresses are never routable from external interfaces
Wildcard :: or global IPv6, already open in firewall 22, 80, 443, 53, mail (25, 587, 993) Minimal direct port exposure Attackers can already reach these ports without bypassing firewall state (though IP-based blocklists or ct state filters remain weakened)
Wildcard :: or dual-stack *, blocked only by stateful firewall :3000 (docker-proxy), :2377 / :7946 (Swarm), :6379 (Redis), :3306 / :5432, :5353 (mDNS) High bypass target External traffic is suppressed solely by UFW, nftables, or DOCKER-USER stateful inspection

Look closely at that third row, especially on single-host container nodes and home/office labs. On Linux, docker-proxy and dockerd commonly bind published container ports or Swarm control/gossip ports (2377/tcp, 7946/tcp+udp) on [::] or dual-stack *, relying on UFW and ip6tables DOCKER-USER to drop external packets. Similarly, residential or office ISP routers frequently delegate a live /64 IPv6 prefix via SLAAC Router Advertisements even when your DNS records only publish IPv4 (A) addresses and you never intended the host to be reachable over IPv6. In our Docker security practices for production, separating container bindings from host interfaces matters for precisely this reason: host firewalls are only one layer when kernel parsing itself misbehaves.

Kernel patch status across distributions

The upstream patch in 48d522b65fb0ce2bd54f8f5838d77b48afcf1f3e changes the local offset variable inside find_prev_fhdr() from u8 to int, eliminating the byte wrap. According to kernel stable tracking and distribution trackers as of December 3, 2026:

Tree / Distribution Status & Fixed Version Notes
Mainline Linux Fixed in 7.3.6 / 7.4-rc1 Upstream commit 48d522b65fb0
Kernel 6.18.y LTS Fixed in 6.18.65 Backported cleanly
Kernel 6.12.y LTS Fixed in 6.12.119 Backport commit 55cd1d227de0
Kernel 6.6.y / 6.1.y / 5.15.y / 5.10.y Fixed in 6.6.163, 6.1.193, 5.15.226, 5.10.275 Upstream stable trees patched
Debian (bookworm 6.1.x, trixie 6.12.x) Pending DSA (6.1.192-3 and 6.12.118-1 still listed vulnerable; forky/sid fixed in 7.3.6-1) Monitor Debian Security Tracker and apply + reboot once issued
Red Hat Enterprise Linux Critical advisories rolling out (e.g. RHSA-2026:107608) See Red Hat CVE page
Ubuntu Tracking backports across LTS kernels Check Ubuntu Security CVE page

Keep in mind that a kernel package upgrade does nothing until the machine reboots into the patched vmlinuz image (or applies livepatch). If you rely on automated security patching with unattended-upgrades on Debian, verify whether linux-image-* is held or excluded from automatic reboots so kernel patches do not sit uninstalled on disk for weeks.

Practical mitigations that actually protect you

What you should do right now depends on whether your host genuinely serves production traffic over IPv6.

Condition A: Your host publishes no AAAA records and serves no IPv6 traffic

If DNS for the host has no AAAA records, mail delivery (Exim/Postfix) does not send over IPv6, and external clients reach the server over IPv4 or an IPv4-only proxy, keeping an active global IPv6 address on the public NIC adds pure attack surface with zero operational return.

However, do not rush to set net.ipv6.conf.all.disable_ipv6 = 1 or add ipv6.disable=1 to GRUB on a running Docker, HestiaCP, or dual-stack server without testing first. Disabling IPv6 globally tears down the ::1 loopback interface as well. On many Debian servers, that breaks dual-stack sockets, fails ip6tables/after6.rules firewall restores, or triggers errors in CrowdSec/IPS ip6 bouncer hooks during reloads.

A much cleaner mitigation is interface-scoped IPv6 disabling on your physical uplink interfaces (eth0, ens3, wlp3s0, etc.), leaving lo (::1) untouched:

# /etc/sysctl.d/99-ipv6-hardening.conf
# Replace eth0 with your actual physical NIC name(s)
net.ipv6.conf.eth0.disable_ipv6 = 1
net.ipv6.conf.eth0.accept_ra = 0

If NetworkManager manages the interface (common on Debian desktops, mini-PCs, and Wi-Fi servers), also set the connection profile so a reconnect does not re-enable SLAAC addresses:

sudo nmcli connection modify "<CON_NAME>" ipv6.method disabled
sudo nmcli device reapply <NIC>
sudo sysctl --system

Once applied, verify three invariants immediately: ip -6 addr show <NIC> returns nothing, ip -6 addr show lo still holds ::1/128, and your firewall/container services reload cleanly. Because disable_ipv6 = 1 on the physical NIC instructs ipv6_rcv() in the kernel to drop incoming IPv6 frames before Netfilter ever invokes nf_defrag_ipv6, remote CVE-2026-139281 fragments never reach find_prev_fhdr().

Note also that if you run Host File Integrity Monitoring (FIM), /etc/sysctl.d/ and NetworkManager connection profiles should be covered and re-sealed after any intentional change.

Condition B: Your host requires IPv6 in production

If your site publishes AAAA records, accepts IPv6 SMTP mail, or relies on IPv6 connectivity, do not cut IPv6 blindly. Instead, reduce blast radius while waiting for your distribution’s kernel patch:

  1. Bind internal services strictly to 127.0.0.1: Audit every row from ss -tulnp -6 in that high-risk third bucket. Databases (MariaDB, PostgreSQL), caches (Redis), admin panels, and exporter ports should bind explicitly to 127.0.0.1 (or Unix domain sockets) rather than :: whenever external hosts never connect directly. That removes the target even if nf_conntrack is tricked.
  2. Use an external cloud SDN firewall at the perimeter: On providers such as Hetzner Cloud, AWS Security Groups, or upstream hardware firewalls, packet filtering happens outside the guest VM’s Linux kernel. Until the guest kernel receives its security update, blocking unnecessary ports (or temporarily pausing IPv6 ingress if failover DNS uses IPv4) prevents crafted fragment chains from ever hitting the host’s nf_conntrack_reasm.c. Notice the same principle applies on hardened HestiaCP Debian servers: if public services are the only ones listening on global IPv6 and databases stay on 127.0.0.1, a stateful bypass has very little left to hit.
  3. Avoid brittle homegrown header-parsing firewall hacks: Trying to filter chained IPv6 extension headers in netdev ingress requires exact knowledge of your kernel’s nftables exthdr support and risks dropping valid MTU/ICMPv6 traffic or breaking firewall reloads under ufw. Put that effort into patching the kernel and fixing overly broad :: bindings instead.

What this bug teaches about security baselines

Standard Linux hardening checklists have spent years preaching “IPv4/IPv6 firewall parity”: mirror every iptables rule in ip6tables or after6.rules, enable CrowdSec or Fail2Ban on both families, and call it secure. That advice is sound when you actually need dual-stack services, and you should never leave an IPv6 stack unfirewalled.

Yet CVE-2026-139281 exposes a blind spot in routine server audits. Security scanners verify whether your firewall rules match across IPv4 and IPv6; they rarely ask why a server with zero AAAA records is still accepting SLAAC Router Advertisements from an upstream ISP router in the first place. When a 21-year kernel parser bug undermines the stateful firewall itself, every protocol enabled on an external NIC without a concrete workload requirement becomes unrewarded risk.

Run ss -tulnp -6 on your hosts today, eliminate accidental :: bindings on internal tools, disable unused external IPv6 NICs while keeping ::1 intact, and schedule the kernel reboot the moment your distro ships 6.1.193+, 6.12.119+, or your vendor backport.

[+] On this page 18 topics ▼
FAQ · Common Questions

Frequently Asked Questions

Does CVE-2026-139281 allow remote code execution by itself?

No. CVE-2026-139281 is a stateful firewall bypass (CVSS 9.1), not an RCE bug. Its real danger is reaching internal UDP or TCP services bound to wildcard :: that were supposed to remain blocked by iptables, nftables, UFW, or DOCKER-USER.

Why do ip6tables -t raw or nftables raw-priority drop rules fail to stop it?

In <linux/netfilter_ipv6.h>, nf_conntrack IPv6 defragmentation runs at NF_IP6_PRI_CONNTRACK_DEFRAG (-400), which executes before NF_IP6_PRI_RAW (-300). Furthermore, rules matching only ip6 nexthdr ipv6-frag miss fragmented packets preceded by extension headers.

Should I set net.ipv6.conf.all.disable_ipv6=1 to mitigate this quickly?

Avoid conf.all unless you also want to break ::1 loopback and dual-stack sockets. Disabling IPv6 per external physical NIC (for example net.ipv6.conf.eth0.disable_ipv6=1 and accept_ra=0) drops external IPv6 ingress at ipv6_rcv() while keeping ::1, firewalls, and local services intact.

How do I know if my server actually has ports exposed to this bypass?

Inspect ss -tulnp -6 alongside your active IPv6 firewall policy. Ports listening only on [::1] are safe loopback sockets, and ports already open publicly (such as 80 and 443) gain nothing new from a bypass. The real targets are restricted internal listeners bound to :: or dual-stack *.

Start your project

Need a website that earns trust, ranks in search, and gives your business a stronger digital presence? Start the conversation here.

Official sources used on this page