Rapid7 Vulnerability & Exploit Database

Netfilter nft_set_elem_init Heap Overflow Privilege Escalation

Back to Search

Netfilter nft_set_elem_init Heap Overflow Privilege Escalation

Disclosed
02/07/2022
Created
09/28/2022

Description

An issue was discovered in the Linux kernel through 5.18.9. A type confusion bug in nft_set_elem_init (leading to a buffer overflow) could be used by a local attacker to escalate privileges. The attacker can obtain root access, but must start with an unprivileged user namespace to obtain CAP_NET_ADMIN access. The issue exists in nft_setelem_parse_data in net/netfilter/nf_tables_api.c.

Author(s)

  • Arthur Mongodin <amongodin <Arthur Mongodin <amongodin@randorisec.fr> (@_Aleknight_)>
  • Redouane NIBOUCHA <rniboucha@yahoo.fr>

Platform

Linux

Architectures

x64

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/linux/local/netfilter_nft_set_elem_init_privesc
msf exploit(netfilter_nft_set_elem_init_privesc) > show targets
    ...targets...
msf exploit(netfilter_nft_set_elem_init_privesc) > set TARGET < target-id >
msf exploit(netfilter_nft_set_elem_init_privesc) > show options
    ...show and set options...
msf exploit(netfilter_nft_set_elem_init_privesc) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;