KernelScan.io

CRITICAL

netfilter Expect UAF

CVE-2026-31414

CVSS 9.8 / 10.0 NVD

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

KernelScan AI6.6MEDIUM

01

In the Linux kernel, the following vulnerability has been resolved: netfilter: nf_conntrack_expect: use expect->helper Use expect->helper in ctnetlink and /proc to dump the helper name. Using nfct_help() without holding a reference to the master conntrack is unsafe. Use exp->master->helper in ctnetlink path if userspace does not provide an explicit helper when creating an expectation to retain the existing behaviour. The ctnetlink expectation path holds the reference on the master conntrack and nf_conntrack_expect lock and the nfnetlink glue path refers to the master ct that is attached to the skb.

02

Engine v0.2.0

Risk summary

A use-after-free vulnerability in netfilter connection tracking allows local attackers with CAP_NET_ADMIN (obtainable via user namespaces on default kernels) to potentially leak kernel information, corrupt memory, or crash the kernel. The vulnerability occurs when accessing helper information through freed master conntrack references in expectation handling via ctnetlink, /proc, and helper packet-processing paths.

Affectednet/netfilter/nf_conntrack_expect.c (netfilter)

Vulnerability analysis

The vulnerability stems from unsafe access to helper information via nfct_help(expect->master)->helper without holding a reference to the master conntrack. Because nf_conn uses SLAB_DESTROY_BY_RCU, the master conntrack can be freed while expectations still reference it, creating a use-after-free when /proc is read, ctnetlink dumps expectations, or helpers iterate expectations. The fix changes the code to use expect->helper directly (which maintains a stable reference) and ensures proper locking and reference handling in the ctnetlink allocation path.

03

BranchFixed inPatch commit
6.16.1.168847cb7fe26c5
6.126.12.814bd1b3d83917
6.186.18.22b53294bff19e
6.196.19.123dfd3f7712b5
6.66.6.134e7ccaa0a62a8
mainline7.0f01794106042