The vulnerability lies in the mechanism for detecting and blocking disallowed SQL functions in Apache Superset. The root cause is the use of the sqlparse library, which was found to be susceptible to bypass through the use of specially crafted comments in the SQL query. This would allow an attacker with SQL Lab access to execute functions that are on the denylist (DISALLOWED_SQL_FUNCTIONS).
The primary fix is in commit ce6d0d5963fd394d0082dea9921c72b2558a2788, which replaces the vulnerable sqlparse-based implementation with a more robust one using the sqlglot library. The vulnerable function superset.sql_parse.check_sql_functions_exist was modified to use the new secure implementation, and the underlying vulnerable methods ParsedQuery.check_functions_exist and ParsedQuery._check_functions_exist_in_token were removed.
Other related commits show a broader effort to replace sqlparse with sqlglot for other security checks as well, such as detecting DML statements. This indicates a systematic effort to improve the security of SQL parsing in the application.
For a security engineer, the key takeaway is that any user with SQL Lab access on a vulnerable version of Superset could bypass the configured function denylist, potentially leading to information disclosure or other security impacts depending on the disallowed functions. The identified vulnerable functions are central to this vulnerability and would be key indicators in a runtime profile during an exploitation attempt.