CVE-2026-120353 in Airflow
Summary
by MITRE • 11/26/2026
The Apache Airflow TaskFlow decorators @task.bash, @task.sql, @task.analytics, @task.kubernetes_cmd and the common.ai decorators (@task.llm, @task.agent, @task.llm_sql, @task.llm_branch, @task.llm_file_analysis, @task.llm_schema_compare) rendered Jinja templates a second time after the task runner had already rendered them, so any value copied into env, op_args, op_kwargs or the returned prompt, command or SQL was evaluated as a template on the worker. An attacker who can only trigger a Dag run (for example a user with trigger permission supplying run conf), or who controls text that a Dag passes into one of these decorators as an argument or prompt (for example a ticket or a downloaded document), could run arbitrary commands on the worker and read connection passwords and Variables, in any deployment that uses an affected decorator in a Dag that passes such input through env, parameters or prompt. Users are recommended to upgrade apache-airflow-providers-standard to 1.22.0, apache-airflow-providers-cncf-kubernetes to 11.0.0, apache-airflow-providers-common-sql to 3.0.0 and apache-airflow-providers-common-ai to 1.2.0 or later.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/28/2026
The vulnerability described involves a critical server-side template injection flaw within Apache Airflow's TaskFlow API decorators, specifically affecting task.bash, task.sql, task.analytics, task.kubernetes_cmd, and several common.ai decorators including task.llm, task.agent, task.llm_sql, task.llm_branch, task.llm_file_analysis, and task.llm_schema_compare. This issue stems from a double-rendering mechanism where Jinja templates are processed twice during task execution. The first rendering occurs within the standard task runner logic, but a subsequent rendering takes place on the worker node after the task has been dispatched. Consequently, any user-controlled data injected into environment variables (env), operator arguments (op_args), or keyword arguments (op_kwargs) is not merely passed as static text but is interpreted and evaluated as active Jinja template code by the worker's execution context.
From a technical perspective, this double evaluation creates an opportunity for arbitrary command execution and sensitive information disclosure. When an attacker can influence the input data that flows into these decorators—such as through Dag run configuration parameters (run conf) or text inputs like ticket descriptions or downloaded documents—the injected content is executed on the worker node rather than being treated as literal string values. This behavior allows malicious payloads to bypass initial sanitization checks, effectively granting the attacker the ability to execute arbitrary system commands with the privileges of the Airflow worker process. Furthermore, because Jinja templates have access to global objects and configuration contexts within the Python environment, an attacker can exploit this vector to read sensitive connection passwords stored in Airflow's secret backend or retrieve values from Variables, leading to a significant compromise of credential integrity and operational security.
The operational impact of this vulnerability is severe, particularly for deployments where users with trigger permissions are allowed to supply run configuration data that subsequently flows into these affected decorators. Even if an attacker does not have direct code execution privileges on the Airflow web server or metadata database, their ability to initiate a Dag run with specific parameters can be leveraged to achieve remote code execution on any worker node running the vulnerable software versions. This represents a classic case of insecure deserialization and template injection, categorized under CWE-94 for Improper Control of Generation of Code (Code Injection) and CWE-1386 for Insecure Initialization. The attack aligns with MITRE ATT&CK techniques such as T1059 Command and Scripting Interpreter for executing arbitrary commands and T1552 Unsecured Credentials for accessing stored secrets, highlighting the broad scope of potential exploitation across different deployment scenarios.
To mitigate this risk, organizations must immediately upgrade their Apache Airflow provider packages to patched versions that address the double-rendering issue. Specifically, apache-airflow-providers-standard should be updated to version 1.22.0 or later, apache-airflow-providers-cncf-kubernetes to 11.0.0 or later, apache-airflow-providers-common-sql to 3.0.0 or later, and apache-airflow-providers-common-ai to 1.2.0 or later. Until these upgrades are applied, administrators should restrict permissions for users who can trigger Dag runs with custom configurations, ensuring that untrusted input is not passed into the affected decorators' parameters, environment variables, or prompts. Additionally, implementing strict input validation and sanitization on all user-supplied data before it enters any Airflow task logic provides an essential layer of defense in depth against template injection attacks.