The vulnerability is a remote code execution flaw in D-Tale's column filtering mechanism, triggered via the /save-column-filter endpoint. This endpoint accepts user-defined filter configurations which are then used to construct query strings for the pandas.DataFrame.query() method. The query() method in pandas can be dangerous with untrusted input because it uses eval() internally, allowing for arbitrary Python code execution.
The vulnerable functions are the build_filter methods within various filter classes (StringFilter, NumericFilter, DateFilter, OutlierFilter) located in dtale/column_filters.py. These methods were responsible for taking user input from the filter configuration and constructing the query string. Prior to the patch, this was done without any sanitization or validation, allowing an attacker to inject malicious Python code into the query string. For example, an attacker could provide a filter value like __import__('os').system('cat /etc/passwd').
The function dtale.query.run_query acts as the execution sink where the crafted malicious query is passed to df.query(). The patch introduces a defense-in-depth validation layer (validate_query_safety) in this function to block dangerous queries before they are executed.
During exploitation, a runtime profiler would show calls to one of the build_filter methods, which process the malicious payload, followed by a call to run_query, which executes it.