Apache Superset is an open-source Data Visualization and Data Exploration Platform, it is written in Python and based on the Flask web framework. Version 2.1.1 addressed two vulnerabilities, respectively tracked as CVE-2023-39265 and CVE-2023-37941, that could be exploited to take control of Superset’s metadata database.
The Horizon3 researchers pointed out that Superset by design allows privileged users to connect to arbitrary databases and execute arbitrary SQL queries using the SQLLab interface. By tricking Superset can into connecting to its own metadata database, an attacker can directly read or write application configuration through the interface potentially leading to credential harvesting and remote code execution.
Below is the description for the flaw CVE-2023-39265 described as SQLite Access via SQLAlchemy URI Bypass.
“By default Superset uses SQLite as its metadata database, and the SQLite file is located on the Superset web server. Attempting to connect to this SQLite database through the Superset UI doesn’t work, as Superset has safeguards in place to prevent sqlite connections.” reads the post published by Horizon3.
“We discovered, however, that it’s possible to bypass this safeguard by putting in the full SQLAlchemy URI containing both the dialect and driver name, e.g. sqlite+pysqlite:////app/superset_home/superset.db
“
The URI bypass flaw CVE-2023-39265 affects Superset versions <= 2.1.0. The flaw was fixed by blocking any SQLAlchemy URIs starting with sqlite
instead of just blocking the sqlite://
syntax.
The experts also noticed that certain installations of Superset, such as docker-compose, use default credentials to access the metadata database. An attacker that knows the default credentials can connect to the metadata database and gain control over it.
The second vulnerability, tracked as CVE-2023-37941, is a remote code execution. The experts reported that Superset versions from 1.5 to 2.1.0 use python’s pickle package to store certain configuration data. Threat actors with write access to the metadata database can insert an arbitrary pickle payload into the store, and then trigger deserialization of it, leading to remote code execution.
The latest version also fixed CVE-2023-30776.
a leak of database credentials in plaintext when querying the /api/v1/database API as a privileged user. This issue has been tracked asIn April 2022, Horizon3 researchers discovered a remote code execution, tracked as CVE-2023-27524 (CVSS score: 8.9), in Apache Superset.
Follow me on Twitter: @securityaffairs and Facebook and Mastodon
(SecurityAffairs – hacking, Superset)