Rapid7 Vulnerability & Exploit Database

io_uring Same Type Object Reuse Priv Esc

Back to Search

io_uring Same Type Object Reuse Priv Esc

Disclosed
03/22/2022
Created
02/01/2023

Description

This module exploits a bug in io_uring leading to an additional put_cred() that can be exploited to hijack credentials of other processes. We spawn SUID programs to get the free'd cred object reallocated by a privileged process and abuse them to create a SUID root binary ourselves that'll pop a shell. The dangling cred pointer will, however, lead to a kernel panic as soon as the task terminates and its credentials are destroyed. We therefore detach from the controlling terminal, block all signals and rest in silence until the system shuts down and we get killed hard, just to cry in vain, seeing the kernel collapse. The bug affected kernels from v5.12-rc3 to v5.14-rc7. More than 1 CPU is required for exploitation. Successfully tested against Ubuntu 22.04.01 with kernel 5.13.12-051312-generic

Author(s)

  • h00die
  • Ryota Shiga
  • Mathias Krause

Platform

Linux

Architectures

x86, 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/cve_2022_1043_io_uring_priv_esc
msf exploit(cve_2022_1043_io_uring_priv_esc) > show targets
    ...targets...
msf exploit(cve_2022_1043_io_uring_priv_esc) > set TARGET < target-id >
msf exploit(cve_2022_1043_io_uring_priv_esc) > show options
    ...show and set options...
msf exploit(cve_2022_1043_io_uring_priv_esc) > 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

;