From 0c8f32625821d99ecb3e2edb7b8d866f47efc105 Mon Sep 17 00:00:00 2001 From: sha174n <105581038+sha174n@users.noreply.github.com> Date: Thu, 18 Sep 2025 22:36:41 +0100 Subject: [PATCH] docs: Add security warning for ENABLE_TEMPLATE_PROCESSING (#35192) --- docs/docs/configuration/sql-templating.mdx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/docs/configuration/sql-templating.mdx b/docs/docs/configuration/sql-templating.mdx index d2b74afa1ab..827d70522c6 100644 --- a/docs/docs/configuration/sql-templating.mdx +++ b/docs/docs/configuration/sql-templating.mdx @@ -10,8 +10,15 @@ version: 1 ## Jinja Templates SQL Lab and Explore supports [Jinja templating](https://jinja.palletsprojects.com/en/2.11.x/) in queries. -To enable templating, the `ENABLE_TEMPLATE_PROCESSING` [feature flag](/docs/configuration/configuring-superset#feature-flags) needs to be enabled in -`superset_config.py`. When templating is enabled, python code can be embedded in virtual datasets and +To enable templating, the `ENABLE_TEMPLATE_PROCESSING` [feature flag](/docs/configuration/configuring-superset#feature-flags) needs to be enabled in `superset_config.py`. + +> #### ⚠️ Security Warning +> +> While powerful, this feature executes template code on the server. Within the Superset security model, this is **intended functionality**, as users with permissions to edit charts and virtual datasets are considered **trusted users**. +> +> If you grant these permissions to untrusted users, this feature can be exploited as a **Server-Side Template Injection (SSTI)** vulnerability. Do not enable `ENABLE_TEMPLATE_PROCESSING` unless you fully understand and accept the associated security risks. + +When templating is enabled, python code can be embedded in virtual datasets and in Custom SQL in the filter and metric controls in Explore. By default, the following variables are made available in the Jinja context: