CVE-2026-120353: Apache Airflow TaskFlow decorators rendered Jinja a second time, so Dag run conf or text passed into @task.bash and its siblings runs code on the worker

ByLinuxtastic

December 2, 2026 #Apache Airflow, #CVE

Airflow renders a task’s template fields once, in the task runner, with the Dag run’s context, which is how {{ dag_run.conf }} and {{ var.value.x }} reach a task. The Apache CNA record says that the TaskFlow decorators @task.bash, @task.sql, @task.analytics, @task.kubernetes_cmd and the common.ai decorators “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.” A value that was data on the first pass, a string from run conf or a downloaded document, became a template on the second, and Jinja in the worker can reach the connection store. Apache rates it Important and credits Claude Security Scans (tool), Sonar (finder) and Jarek Potiuk (remediation). Upgrade apache-airflow-providers-standard to 1.22.0, cncf-kubernetes to 11.0.0, common-sql to 3.0.0 and common-ai to 1.2.0 or later on every worker; the advisory gives no workaround, so until then treat Dag trigger permission on any Dag using these decorators as command execution on the worker.

CVE-2026-120353 at a glance.

ComponentApache Airflow provider packages: apache-airflow-providers-standard (@task.bash), apache-airflow-providers-common-sql (@task.sql, @task.analytics), apache-airflow-providers-cncf-kubernetes (@task.kubernetes_cmd) and apache-airflow-providers-common-ai (@task.llm, @task.agent, @task.llm_sql, @task.llm_branch, @task.llm_file_analysis, @task.llm_schema_compare); the Airflow core package itself is not named
Affected versionsstandard 0.3.0 before 1.22.0; cncf-kubernetes 10.5.0 before 11.0.0; common-sql 1.32.0 before 3.0.0; common-ai 0.1.0 before 1.2.0, per the Apache CNA record and the advisory
Fixed instandard 1.22.0 and common-ai 1.2.0 (released 23 November 2026), common-sql 3.0.0 and cncf-kubernetes 11.0.0 (released 9 November 2026), all carrying “Render only the returned value in TaskFlow decorators that template it (#76244)” in their changelogs. The change is pull request #76244 by Jarek Potiuk, merged 2 November 2026: the decorators no longer call render_template_fields inside execute() and render only the value the decorated function returns. common-sql 3.0.0 and cncf-kubernetes 11.0.0 are major releases with unrelated removals (see below)
SeverityApache: Important, CWE-1336 improper neutralisation of special elements in a template engine. No CVSS score from any source: NVD is in Received state with an empty metrics block on 2 December 2026, the CNA gives none and the CISA ADP has not added one; no distribution packages the providers
Exploited in the wildNot on the CISA KEV catalogue (2026.11.30). EPSS 0.00383 (34th percentile) on 1 December 2026
Who is exposedAny deployment with an affected provider installed on its workers and a Dag that uses one of the decorators and passes outside input through env, parameters, op_args/op_kwargs or the returned command, SQL or prompt. The advisory’s two attackers: “a user with trigger permission supplying run conf”, and anyone “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)”. The prize is “arbitrary commands on the worker” and the ability to “read connection passwords and Variables”
PublishedAdvisory to users@airflow and oss-security 26 November 2026 14:53 UTC (Vincent Beck); CVE record 26 November, NVD 26 November; fixes released 9 and 23 November; this page built 2 December 2026, last updated 2 December 2026

What it is

Airflow’s templating contract is one render per task instance: before execute() runs, the task runner walks the operator’s template_fields and renders each one with the run’s context. After that, the values are plain data; a string that happens to contain {{ ... }} because it came from dag_run.conf, from an upstream XCom or from a file is just a string. The TaskFlow decorators in question wrap a user function whose return value, a shell command, a SQL statement, a prompt, is itself meant to be a template, so they rendered that return value inside execute(). The pull request’s description says that in doing so they “rendered all the other template fields … a second time”, and values containing {{ ... }} “were rendered again”.

That second pass is the vulnerability. On the first pass {{ dag_run.conf["name"] }} in a template turns into whatever the person who triggered the run typed; if they typed {{ macros.__import__("os").popen("id").read() }}, the first pass produces that text as data and the second pass executes it, in the worker process, with the worker’s access to Airflow’s connection and Variable stores. The advisory’s second attacker is the more interesting one: a Dag that fetches a ticket or downloads a document and hands the text to @task.llm as a prompt, or to @task.bash through env, gives the author of that document the same execution. Nothing in the Dag need look wrong. Apache rates it Important, and the common.ai decorators, built to take arbitrary text as prompts, are the natural target.

The fix, pull request #76244 by Jarek Potiuk, merged 2 November 2026 and shipped across the four providers over the following three weeks, renders only the returned value and leaves the other template fields to the task runner’s single pass; a second commit in the same pull request makes positional arguments available to the returned common.ai prompt so that the change does not break prompts that referenced them. The provider changelogs record the behaviour under a Note in each release, without the word “security”. Two of the fixed releases are majors with unrelated removals: common-sql 3.0.0 drops the deprecated DbApiHook.get_pandas_df and get_pandas_df_by_chunks (use get_df(..., df_type="pandas")), and cncf-kubernetes 11.0.0 drops cleanup_stuck_queued_tasks (use revoke_task). common-ai 1.2.0’s sql extra wants common-sql 3.1.0.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 2 December 2026; the link in the row is the tracker page, which will be newer than this one. The Airflow providers are installed from PyPI into a virtual environment or a container image, and no distribution packages them, so the row that matters is the last one.

DistributionStatusFixed package
AlpineNot consulted for this page; Alpine does not package Airflow—
DebianNOT-FOR-US: “Apache software not packaged in Debian”—
UbuntuTracker returned a server error to the automated reader on 2 December 2026 (three attempts); Ubuntu does not package Airflow—
RHEL, Rocky, Alma, CentOS StreamPage returned a client error to the automated reader on 2 December 2026, consistent with no entry; Red Hat does not ship Airflow—
openSUSE/SLENot consulted for this page; SUSE does not ship Airflow—
PyPI, the apache/airflow images, Helm chart deployments, constraints filesThe upstream provider releases apply; every worker image and every scheduler that parses the Dags needs the new providers, and the constraints file an installation pins to must be one that lists themapache-airflow-providers-standard>=1.22.0, -cncf-kubernetes>=11.0.0, -common-sql>=3.0.0, -common-ai>=1.2.0

How to check

Three questions: which versions of the four providers are on the workers, which Dags use the decorators, and what flows into them. The last one is the real audit, and the grep below only finds the obvious cases.

# 1. provider versions on a worker (and in the image the Helm chart deploys)
airflow providers list 2>/dev/null | grep -E 'standard|cncf-kubernetes|common-sql|common-ai'
pip show apache-airflow-providers-standard apache-airflow-providers-cncf-kubernetes apache-airflow-providers-common-sql apache-airflow-providers-common-ai 2>/dev/null | grep -E '^(Name|Version)'

# 2. Dags that use an affected decorator
grep -rnE '@task\.(bash|sql|analytics|kubernetes_cmd|llm|agent|llm_sql|llm_branch|llm_file_analysis|llm_schema_compare)\b' /opt/airflow/dags /path/to/dags 2>/dev/null

# 3. outside input reaching them: run conf, params, XComs, fetched text, in env / op_args / op_kwargs / the returned string
grep -rnE 'dag_run\.conf|params\[|\{\{ *params|xcom_pull|requests\.get|read_text\(' /opt/airflow/dags /path/to/dags 2>/dev/null | head -40

# 4. who can trigger Dags (Airflow 3: the Dags:can_trigger / DagRuns:can_create permissions)
airflow roles list -o table 2>/dev/null; airflow users list 2>/dev/null | head

Providers at or above the four fixed versions on every worker ends it; a scheduler on new providers and a worker image on old ones does not, because the second render happens on the worker. On an affected installation, every Dag in step 2 whose decorator receives anything from step 3 is exposed to whoever controls that input, and a Dag that reads dag_run.conf at all is exposed to everyone in step 4 with trigger permission. A Dag whose decorated functions return constants and take no outside input is not reachable, but the advisory says “in any deployment that uses an affected decorator in a Dag that passes such input”, which is most real Dags.

How to fix it

Pin the four providers to the fixed versions, rebuild the worker and scheduler images, and roll them out. The two major releases carry unrelated removals, so run the Dag parser against the new image before deploying it.

# requirements / Dockerfile: the fixed providers (constraints files from 23 November 2026 onward list them)
pip install --upgrade \
  'apache-airflow-providers-standard>=1.22.0' \
  'apache-airflow-providers-cncf-kubernetes>=11.0.0' \
  'apache-airflow-providers-common-sql>=3.1.0' \
  'apache-airflow-providers-common-ai>=1.2.0'
airflow providers list | grep -E "standard|cncf-kubernetes|common-sql|common-ai"
# before rolling out: the two majors removed deprecated APIs; parse every Dag against the new image
airflow dags list-import-errors
grep -rnE 'get_pandas_df|cleanup_stuck_queued_tasks' /opt/airflow/dags /opt/airflow/plugins 2>/dev/null
# interim, in the Dag: do not route outside text through a template field; pass it as a plain argument the function uses directly
@task.bash
def run(name: str) -> str:
    return "process --name " + shlex.quote(name)      # name arrives as data, never rendered

The interim pattern keeps outside text out of env, op_args, op_kwargs and the returned string’s template, which is the set the advisory names; it does not make an affected provider safe in general, only that Dag. Restricting trigger permission to operators who could already run code on the workers removes the first attacker but not the second. What not to do: do not rely on sandboxed Jinja or on removing macros from the context. The advisory offers no configuration workaround, and the Airflow context the worker renders with is the one that contains the connections and Variables the attacker is after; the fix is to stop rendering twice, which only the provider upgrade does.

Sources

  • CVE-2026-120353 at CVE.org — the Apache CNA record (26 November 2026): the ten decorators, the “rendered Jinja templates a second time” sentence, the two attackers, the four affected ranges and fix versions, CWE-1336
  • Advisory on users@airflow.apache.org (Vincent Beck, 26 November 2026 14:53 UTC; read through the archive’s JSON API because the HTML page renders client-side) and its oss-security copy — “Severity: important”, the affected versions, the credit to Claude Security Scans (tool), Sonar (finder) and Jarek Potiuk (remediation developer); no workaround section
  • Pull request #76244 (“Render only the returned value in TaskFlow decorators that template it”, Jarek Potiuk, merged 2 November 2026) — the mechanism, the second commit for positional arguments in common.ai prompts, the changelog notes for the four providers
  • Provider changelogs: standard 1.22.0 (23 November 2026) · common-sql 3.0.0 (9 November; get_pandas_df removal) · cncf-kubernetes 11.0.0 (9 November; cleanup_stuck_queued_tasks removal) · common-ai 1.2.0 (23 November) — each carries the #76244 line and a Note on the single render
  • NVD entry — Received, published 26 November 2026, last modified 27 November; CWE-1336 from Apache, no CVSS metric in the JSON on 2 December 2026
  • Distribution trackers: Debian (NOT-FOR-US); Ubuntu (server error on 2 December 2026) and Red Hat (client error) not readable; neither packages Airflow
  • CISA KEV catalogue 2026.11.30, not listed · EPSS 0.00383 (percentile 0.345) on 1 December 2026

Related reading

This advisory page was assembled from the primary sources listed above on 2 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.