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.

Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.
3 events from the most recent confirmed update back to the earliest known activity.
STAR Labs published a technical write-up showing how CVE-2023-31248 could be exploited on Ubuntu 23.04 with kernel 6.2.0-20-generic to gain RIP control and obtain a root shell. The article also documented a separate dormant-state chain hook deactivation bug that appeared to cause kernel warnings but was not considered practically exploitable.
Upstream fixes were introduced for two nftables issues: one patch rejected repeated dormant-state toggles within a single batch transaction to stop erroneous hook deactivation warnings, and another added genmask validation to chain-by-ID lookups to prevent references to inactive chains. The write-up notes kernels before Ubuntu's 6.2.0-26-generic remained vulnerable to CVE-2023-31248.
CVE-2023-31248 was identified in the Linux kernel's nftables subsystem because nft_chain_lookup_byid did not verify whether a chain was still active via genmask checks. This allowed rules to reference chains deleted in the same batch transaction, creating a use-after-free condition that could be exploited for local privilege escalation.
Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.
2 references tracked. Mallory keeps watching after this page renders.
Map indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.