Apache Superset CLI Tool Exposes HIGH-Severity Jinja2 XSS Vulnerability (B701)
A high-severity security flaw has been identified in the Apache Superset extensions command-line interface (CLI), exposing the platform to potential cross-site scripting (XSS) attacks. The vulnerability, flagged by the Bandit security scanner as rule B701, stems from the Jinja2 templating engine's default configuration of `autoescape=False`. This setting fails to automatically escape user-controlled input, creating a direct injection path for malicious scripts within the Superset ecosystem.
The specific vulnerability resides in the file `superset-extensions-cli/src/superset_extensions_cli/cli.py` at line 834. The finding is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'). The presence of this flaw in a core administrative tool like the extensions CLI significantly raises the attack surface, as it could be leveraged to compromise dashboard integrity or user sessions if an attacker gains control over the templating input.
Remediation is assigned to a developer named Devin, who is tasked with investigating, implementing a fix, and opening a pull request. The standard mitigation involves setting `autoescape=True` or utilizing Jinja2's `select_autoescape()` function. Until this patch is applied and deployed, any instance using the vulnerable `superset-extensions-cli` component remains at elevated risk. This finding underscores the persistent security challenges in complex data visualization platforms where templating engines intersect with user data.