Rapid7 Vulnerability & Exploit Database

Apache Spark Unauthenticated Command Injection RCE

Back to Search

Apache Spark Unauthenticated Command Injection RCE

Disclosed
07/18/2022
Created
09/07/2022

Description

This module exploits an unauthenticated command injection vulnerability in Apache Spark. Successful exploitation results in remote code execution under the context of the Spark application user. The command injection occurs because Spark checks the group membership of the user passed in the ?doAs parameter by using a raw Linux command. It is triggered by a non-default setting called spark.acls.enable. This configuration setting spark.acls.enable should be set true in the Spark configuration to make the application vulnerable for this attack. Apache Spark versions 3.0.3 and earlier, versions 3.1.1 to 3.1.2, and versions 3.2.0 to 3.2.1 are affected by this vulnerability.

Author(s)

  • Kostya Kortchinsky
  • h00die-gr3y <h00die.gr3y@gmail.com>

Platform

Linux,Unix

Architectures

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

;