Skip to main content
Mallory
← Back to News
privilege-escalation-techniqueendpoint-software-vulnerabilityproof-of-concept-releasewidely-deployed-product-advisory

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

Linux nftables flaw CVE-2023-31248 enables local root via use-after-free

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 nftables subsystem.
  • 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.
Who uses this technique?Get the actors, campaigns, and ATT&CK mapping behind it.
Get the tradecraft
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

3 events · Sep 25, 2023
  1. Sep 25, 20233y ago

    STAR Labs publishes exploit analysis for CVE-2023-31248

    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.

  2. Sep 25, 20233y ago

    Upstream fixes added for nftables dormant toggle bug and CVE-2023-31248

    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.

  3. Sep 25, 20233y ago

    Linux nftables chain lookup flaw enables local privilege escalation

    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.

Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

Open in app →

Affected products

1 linked
Linux Kernel

Organizations

1 linked
Canonical
Do you run this?Get the adversaries, campaigns, and ATT&CK mapping behind this technique, with detections ready to deploy.
See Who Uses This Technique
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.