Skip to main content
Vulnerability Database/CVE-2026-98322

CVE-2026-98322: Linux Kernel Use-After-Free Vulnerability

CVE-2026-98322 is a use-after-free vulnerability in the Linux kernel's netfilter nft_nat component that causes uninitialised memory access. This article covers technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-98322 Overview

CVE-2026-98322 is an uninitialized memory use vulnerability in the Linux kernel's netfilter nft_nat module. The flaw resides in nft_nat_setup_netmap(), which constructs a mapped address inside an on-stack union nf_inet_addr. For IPv4 mappings the function writes only the 4-byte .ip member, yet copies the entire 16-byte union into range->min_addr and range->max_addr. The upper 12 bytes reach nf_nat_setup_info() uninitialised, as flagged by KMSAN. The IPv6 code path initializes all 16 bytes and is not affected. Kernel maintainers resolved the issue by zero-initialising new_addr.

Critical Impact

Leakage of up to 12 bytes of uninitialized kernel stack memory into NAT translation state during IPv4 netmap operations, enabling potential kernel information disclosure.

Affected Products

  • Linux kernel versions containing nft_nat_setup_netmap() prior to the patched commits
  • Distributions shipping netfilter nftables NAT with IPv4 netmap support
  • Stable kernel branches referenced in the fix series (multiple backports published)

Discovery Timeline

  • 2026-10-06 - CVE-2026-98322 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-98322

Vulnerability Analysis

The vulnerability is an uninitialized memory use [CWE-908] in the netfilter nftables NAT subsystem. nft_nat_setup_netmap() prepares an nf_inet_addr union on the kernel stack to describe the translated address range for a netmap rule. The union is 16 bytes to accommodate IPv6 addresses, while IPv4 only occupies the first 4 bytes via the .ip member.

For IPv4 mappings, the setup loop runs a single 32-bit iteration and writes only .ip. The code then copies the full 16-byte union into both range->min_addr and range->max_addr. The remaining 12 bytes carry whatever stack contents existed prior to the call. Those bytes are then handed to nf_nat_setup_info(), which uses them when programming connection tracking state.

Kernel Memory Sanitizer (KMSAN) detected the uninit-value propagating from nft_nat_eval() into nf_nat_setup_info(). The IPv6 path initialises all 16 bytes and is unaffected.

Root Cause

The root cause is a partial write to a stack-allocated union followed by a full-width copy. union nf_inet_addr overlays __be32 ip with struct in6_addr in6. IPv4 initialisation touches only .ip, leaving in6.s6_addr[4..15] uninitialised. The subsequent memcpy-equivalent assignment propagates stack residue into persistent NAT configuration state.

Attack Vector

Triggering the condition requires the ability to install nftables rules with CAP_NET_ADMIN in a network namespace that supports NAT, or equivalent capability inside an unprivileged user namespace where netfilter is reachable. A local actor configuring an IPv4 netmap rule can cause uninitialised stack bytes to be committed into NAT range metadata. Observable impact includes potential disclosure of kernel stack contents through later NAT behaviour or diagnostic surfaces, and non-deterministic NAT translation state. Full technical details are available in the upstream fix: see Kernel Commit 0ce42c7b.

Detection Methods for CVE-2026-98322

Indicators of Compromise

  • KMSAN or KASAN reports referencing nf_nat_setup_info reached from nft_nat_eval or nft_nat_setup_netmap.
  • Unexpected NAT translation entries whose high-order IPv4 address bytes contain non-zero residual data.
  • Loading of nft_nat with IPv4 netmap rules on an unpatched kernel.

Detection Strategies

  • Audit installed nftables rulesets for netmap statements against IPv4 ranges and correlate with kernel version metadata.
  • Enable KMSAN on test kernels to validate that netfilter paths no longer emit uninit-value reports after patching.
  • Monitor dmesg and journal logs for sanitizer warnings tied to nf_nat_setup_info.

Monitoring Recommendations

  • Track namespace creation events combined with nftables ruleset changes using auditd rules on nf_tables netlink traffic.
  • Alert on unprivileged user namespace usage that subsequently loads NAT modules in environments where this is not expected.
  • Collect kernel version inventory and flag hosts missing the patched commits referenced below.

How to Mitigate CVE-2026-98322

Immediate Actions Required

  • Apply the upstream fix that zero-initialises new_addr in nft_nat_setup_netmap() from the referenced stable commits.
  • Update to the kernel package provided by your distribution containing the backport for your branch.
  • Restrict CAP_NET_ADMIN and unprivileged user namespace creation on multi-tenant hosts until patches are deployed.

Patch Information

The fix zero-initialises the on-stack union nf_inet_addr before any member assignment, ensuring the full 16 bytes copied into range->min_addr and range->max_addr are defined regardless of address family. Backports are available across stable branches:

Workarounds

  • Disable or avoid IPv4 netmap statements in nftables rulesets until the kernel is patched.
  • Disable unprivileged user namespaces by setting kernel.unprivileged_userns_clone=0 where policy allows.
  • Limit which operators and workloads can load the nft_nat module via module blacklisting on hosts that do not require NAT.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.