Linux nftables flaw CVE-2023-31248 enables local root via use-after-free
Attack Tradecraft · 2 sources · Updated 5mo ago · First seen Apr 11, 2026

Researchers detailed exploitation of CVE-2023-31248 in the Linux kernel's nftables subsystem, showing how a chain lookup flaw can let local attackers gain root privileges. The bug exists because nft_chain_lookup_byid did not verify whether a chain was still active through genmask checks, allowing rules in a batch transaction to reference chains deleted in the same batch. That logic error can trigger a use-after-free when rule deletion in the control plane races with asynchronous transaction-worker cleanup, creating a path to reclaim freed memory and corrupt kernel objects.
The write-up demonstrates an exploit on Ubuntu 23.04 with kernel 6.2.0-20-generic, using heap sprays and information leaks to recover kernel text and heap addresses before forging nftables structures and building a ROP chain that invokes prepare_kernel_cred and commit_creds to obtain a root shell. Researchers said kernels before 6.2.0-26-generic were vulnerable, while upstream fixes added genmask validation to chain-by-ID lookups so inactive chains cannot be referenced. The same research also described a separate dormant-state chain hook deactivation bug that can trigger kernel warnings but was assessed as not practically exploitable and patched by blocking repeated dormant-state toggles within a single batch.
Why it matters
Impact assessment
CVE-2023-31248 is a local privilege-escalation flaw in the Linux kernel nftables subsystem that can allow a local attacker to obtain root on vulnerable systems. The primary affected population is Linux hosts that expose nftables functionality to local users or containers with sufficient netfilter interaction capability, with confirmed exploit development demonstrated on Ubuntu 23.04 kernel 6.2.0-20-generic.
The impact is severe at the host level because successful exploitation yields full kernel-level compromise, enabling complete loss of confidentiality, integrity, and availability on the affected machine. The exposure appears broad across vulnerable kernel builds rather than tied to a single application, but exploitation requires local code execution and a workable path to interact with nftables rather than unauthenticated remote access.
Supporting details
- Affected component: Linux kernel
nftablessubsystem. - Vulnerability:
CVE-2023-31248. - Impact type: local privilege escalation to root via kernel use-after-free.
- Demonstrated target: Ubuntu 23.04 with kernel
6.2.0-20-generic. - Vulnerable range stated in the story: kernels before
6.2.0-26-generic. - Exploitation status: public exploit methodology described by researchers; the story does not cite confirmed in-the-wild exploitation.
- Secondary issue in the same research: dormant-state chain hook deactivation bug causing kernel warnings; assessed by the researchers as not practically exploitable.
- Potential business effects: host takeover, disruption of security controls, credential theft, lateral movement enablement, and reputational impact if multi-tenant or production Linux systems are affected.


