Skip to main content
Mallory
HighPublic exploitVulnerability

CVE-2022-34918: Linux Netfilter nft_set_elem_init Type Confusion and Local Privilege Escalation

Published Jul 4, 2022 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS7.8High · v3.1
EPSS5.5%93rd percentile
CISA KEVNoNot listed
In the wildNonePublic exploit, no exploitation reported
Vendors
Debian ProjectNetAppLinuxCanonical
IdentifiersCVE-2022-34918CWE-843 · Access of Resource Using…

CVE-2022-34918 is a type-confusion vulnerability in the Linux kernel Netfilter nftables subsystem, affecting kernels through version 5.18.9. Incorrect handling of set-element data in nft_set_elem_init() can cause a heap buffer overflow. A local attacker with CAP_NET_ADMIN in an appropriate network namespace can exploit the flaw to escalate privileges to root; an unprivileged attacker can obtain the required capability through user and network namespaces. The vulnerability is distinct from CVE-2022-32250.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation allows a local attacker to escalate privileges to root, compromising system confidentiality and integrity. Kernel heap corruption can also disrupt availability or crash the system.

Mitigation

If you can’t patch tonight, do this now.

Restrict unprivileged creation of user and network namespaces where operationally feasible, preventing ordinary local users from obtaining the namespace-scoped CAP_NET_ADMIN capability needed for this exploitation route. Avoid granting CAP_NET_ADMIN to untrusted workloads. These restrictions reduce exposure but do not replace patching or protect against attackers who already possess the required capability.

Remediation

Patch, then assume compromise.

Install a vendor-supported kernel update that fixes CVE-2022-34918 and reboot into the updated kernel. The upstream fix modifies nft_setelem_parse_data() and was included in Linux 5.19-rc6. RHEL 9 fixes were issued through RHSA-2022:6582, RHSA-2022:6592, and RHSA-2022:6610. For applicable RHEL 9 x86_64 real-time kernel channels, the fixed kernel-rt package is 5.14.0-70.26.1.rt21.98.el9_0; use that version or a superseding vendor update.

Public exploits

Exploits

4 exploits validated by Mallory's analysis.

View more in app →
netfilter_nft_set_elem_init_privesc.rbThis repository contains a single Metasploit module implementing a local privilege escalation exploit for CVE-2022-34918, a heap overflow in the Linux kernel's Netfilter nft_set_elem_init function (in net/netfilter/nf_tables_api.c). The exploit targets Linux kernels up to 5.18.9 and requires the attacker to have local access with the ability to create an unprivileged user namespace (CONFIG_USER_NS enabled and permitted). The module uploads and executes a compiled exploit binary (either pre-compiled or compiled on the target) and a payload binary (such as a reverse shell) to a writable directory (default: /tmp). If successful, it provides a root shell or Meterpreter session to the attacker. The module includes checks for kernel version, configuration, and architecture, and cleans up dropped files after execution. The structure is typical for a Metasploit local exploit: it registers options, checks target suitability, uploads/compiles binaries, executes the exploit, and delivers the payload. No network endpoints are involved; the attack vector is purely local privilege escalation.Disclosed Feb 7, 2022 · Framework: metasploit · ruby · localWeaponizedCVE-2022-34918-LPE-PoCThis repository is a local privilege escalation (LPE) exploit for CVE-2022-34918, targeting the Linux kernel (specifically 5.15.0-39-generic). The exploit is implemented in C and consists of a main exploit binary ('poc') and a helper binary ('get_root'). The exploit abuses a vulnerability in the netfilter/nf_tables subsystem to achieve an arbitrary write, which is used to overwrite the kernel's modprobe_path. By placing a malicious script at the new modprobe_path, the exploit is able to set the SUID bit on the 'get_root' binary, which then provides a root shell when executed. The codebase is modular, with separate source files for kernel heap spraying (keyring, uring, xattr), netlink/nf_tables manipulation, and the modprobe_path hijack. The exploit requires local access and the ability to create namespaces and mount tmpfs. Notable fingerprintable endpoints include '/proc/sys/kernel/modprobe', '/tmp/get_root', '/tmp/dummy', and '/tmp/tmpfs'. The exploit is operational and provides a working local root shell on vulnerable systems.randorisec · Disclosed Jul 19, 2022 · c · makefile · localOperationalCVE-2022-34918-LPE-PoCThis repository is a local privilege escalation (LPE) exploit for CVE-2022-34918, targeting the Linux kernel's nf_tables implementation (specifically tested on Ubuntu 5.15.0-39-generic). The exploit is written in C and consists of a main exploit binary ('poc') and a helper binary ('get_root'). The exploit works by abusing a heap overflow in nf_tables to overwrite kernel structures, leaking kernel addresses, and ultimately overwriting the modprobe_path to point to a malicious script. This script sets the SUID bit on the 'get_root' binary, which is then executed to provide a root shell. The codebase is modular, with separate source files for key kernel heap spraying techniques (keyring, io_uring, xattr), netlink/nf_tables manipulation, and privilege escalation logic. The exploit requires local access and is not a detection script. Several fingerprintable file paths are used, including /proc/sys/kernel/modprobe, /tmp/get_root, /tmp/dummy, and files under /tmp/tmpfs/ for heap spraying. The exploit demonstrates a deep understanding of Linux kernel internals and heap manipulation for privilege escalation.merlinepedra25 · Disclosed Jul 24, 2022 · c · makefile · localOperationalCVE-2022-34918This repository contains multiple proof-of-concept (PoC) exploits for CVE-2022-34918, a local privilege escalation vulnerability in the Linux kernel's netfilter nftables subsystem. The exploit targets a heap out-of-bounds write, allowing an unprivileged user to escalate privileges to root. The repository is organized into several subfolders, each implementing a variant of the exploit using different kernel heap spraying and manipulation techniques (e.g., keyring, fs_context, and credential structures). The main exploit logic is implemented in C, with supporting shellcode generation scripts and Makefiles for building the PoCs. The exploit works by setting up user and network namespaces, spraying kernel heap objects (such as keyrings and fs_context), leveraging the netfilter netlink interface to trigger the vulnerability, leaking kernel pointers, and finally injecting shellcode or patching kernel code to escalate privileges. The payloads are custom shellcode that directly manipulates kernel memory to grant root privileges. The exploit also interacts with kernel files such as /proc/self/setgroups, /proc/self/uid_map, /proc/self/gid_map, and /proc/sys/kernel/modprobe, and may drop binaries in /tmp for privilege escalation. The exploit is operational and provides a root shell if successful. The code is intended for research and educational purposes only.veritas501 · Disclosed Aug 2, 2022 · c · bash · localOperational
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
CanonicalUbuntu Linuxoperating_system
Debian ProjectDebian Linuxoperating_system
LinuxLinux Kerneloperating_system
NetAppH300s Firmwareoperating_system
NetAppH410c Firmwareoperating_system
NetAppH410s Firmwareoperating_system
NetAppH500s Firmwareoperating_system
NetAppH700s Firmwareoperating_system
FAQ

Frequently asked questions

Is CVE-2022-34918 exploited in the wild?
As of Oct 18, 2026, Mallory has no reports of CVE-2022-34918 being exploited in the wild. It is not listed in CISA KEV.
Is there a public exploit for CVE-2022-34918?
Yes. Mallory tracks 4 public exploits or proofs of concept for CVE-2022-34918, the earliest disclosed Feb 7, 2022.
Is there a patch for CVE-2022-34918?
Install a vendor-supported kernel update that fixes CVE-2022-34918 and reboot into the updated kernel. The upstream fix modifies nft_setelem_parse_data() and was included in Linux 5.19-rc6.
What products are affected by CVE-2022-34918?
Linux Kernel, Debian Project Debian Linux, NetApp H300s Firmware, NetApp H410c Firmware, NetApp H410s Firmware, and 3 more.
How severe is CVE-2022-34918?
CVE-2022-34918 has a CVSS v3.1 score of 7.8 (High) and an EPSS score of 5.5% (93rd percentile) as of Oct 18, 2026.
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activityCommunity discussion across Reddit, Mastodon, and other social sources.