Rapid7 Vulnerability & Exploit Database

Apache NiFi H2 Connection String Remote Code Execution

Back to Search

Apache NiFi H2 Connection String Remote Code Execution

Disclosed
06/12/2023
Created
08/30/2023

Description

The DBCPConnectionPool and HikariCPConnectionPool Controller Services in Apache NiFi 0.0.2 through 1.21.0 allow an authenticated and authorized user to configure a Database URL with the H2 driver that enables custom code execution. This exploit will result in several shells (5-7). Successfully tested against Apache nifi 1.17.0 through 1.21.0.

Author(s)

  • h00die
  • Matei "Mal" Badanoiu

Platform

Unix

Architectures

cmd

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

;