CRITICAL
netfilter Expect UAF
CVE-2026-31414
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
KernelScan AI6.6MEDIUM
01Description
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.
02KernelScan AI Analysis
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.
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.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.1 | 6.1.168 | 847cb7fe26c5 |
| 6.12 | 6.12.81 | 4bd1b3d83917 |
| 6.18 | 6.18.22 | b53294bff19e |
| 6.19 | 6.19.12 | 3dfd3f7712b5 |
| 6.6 | 6.6.134 | e7ccaa0a62a8 |
| mainline | 7.0 | f01794106042 |