Airflow CVE-2026-120353: We Tested the Fix, and F-String Prompts Still Leak Secrets

Airflow CVE-2026-120353 hits @task.llm and @task.agent. We tested common-ai 1.1.0 vs 1.2.0: the fix holds, but f-string prompts still sent secrets.

Last updated November 29, 2026. Lab used Apache Airflow 3.4.0 with apache-airflow-providers-common-ai 1.1.0 and 1.2.0 on Linux, Python 3.12.

Apache Airflow CVE-2026-120353 is a Jinja template injection in the TaskFlow decorators, including the common.ai @task.llm and @task.agent decorators that send prompts to language models. Upgrade apache-airflow-providers-common-ai to 1.2.0 and apache-airflow-providers-standard to 1.22.0, then remove f-strings from returned prompts.

Apache published the advisory on November 26, 2026 and rated it Important. We ran the same Dag (Airflow’s term for a pipeline) on common-ai 1.1.0 and 1.2.0 with a fake model endpoint. On 1.2.0, any prompt built with an f-string still rendered our run conf as a template and sent a Variable and a Connection password to the model.

The fix works for the fields Apache describes: system_prompt, task arguments, and @task.bash environment values stayed literal on the new builds. Prompts that format untrusted text into the returned string are a separate pattern, and 17 example functions in the 1.2.0 package still use it. No vendor paid for this page.

TL;DR

  • CVE-2026-120353 affects four Airflow providers: standard before 1.22.0, cncf-kubernetes before 11.0.0, common-sql before 3.0.0, and common-ai from 0.1.0 before 1.2.0. Apache rates it Important (CWE-1336).
  • On common-ai 1.1.0, run conf placed in system_prompt or formatted into a prompt reached our fake model as the rendered values of an Airflow Variable and a Connection password.
  • On common-ai 1.2.0, system_prompt and arguments referenced as {{ ticket }} stayed literal, but f-string prompts in @task.llm and @task.agent still leaked both secrets.
  • The {{ ticket }} pattern Apache now recommends fails on 1.1.0 with “‘ticket’ is undefined”, so code and provider upgrades must ship together.
  • On November 29, pip-audit 2.10.1 and an OSV.dev query reported no vulnerabilities for common-ai 1.1.0 or standard 1.21.0, so scanners will not flag the old builds yet.

What Apache Disclosed in CVE-2026-120353

CVE-2026-120353 is a template injection in Airflow TaskFlow decorators, the Python functions that become tasks. The decorators rendered Jinja templates a second time after the task runner had already rendered them, so a value that arrived as text, such as {{ var.value.x }}, was evaluated on the worker. The fix renders each field once.

Apache Airflow is an open source platform for scheduling and running data pipelines. The common.ai provider, first released on April 13, 2026, adds decorators such as @task.llm, @task.agent, @task.llm_sql, and @task.llm_branch that call a model through pydantic-ai. All six common.ai decorators are on the advisory’s list, next to @task.bash, @task.sql, @task.analytics, and @task.kubernetes_cmd.

Provider packageAffectedFixed in
apache-airflow-providers-common-ai0.1.0 to before 1.2.01.2.0 (Nov 23, 2026)
apache-airflow-providers-standard0.3.0 to before 1.22.01.22.0 (Nov 23, 2026)
apache-airflow-providers-cncf-kubernetes10.5.0 to before 11.0.011.0.0
apache-airflow-providers-common-sql1.32.0 to before 3.0.03.0.0
Affected and fixed versions. Source: Apache Airflow security advisory, November 26, 2026; release dates from PyPI.

According to the advisory, an attacker needs one of two things: permission to trigger a Dag run with run conf, or control of text that a Dag passes into one of these decorators, such as a support ticket or a downloaded document. Apache says the impact is command execution on the worker and reading of Connection passwords and Variables.

Sonar found the flaw with the Claude Security Scans tool, and Jarek Potiuk wrote the fix in pull request #76244, merged on November 2, 2026. The fixed providers reached PyPI on November 23, and the CVE went public three days later. On November 29, pypistats counted 92,291 downloads of common-ai and 2,745,697 of the standard provider in the last month.

Timeline of CVE-2026-120353 from the November 2 fix merge to the November 26 advisory and the November 29 scanner checks
From fix to scanners. Image: AgentStack, data from GitHub, PyPI, Apache and our checks, November 29, 2026.

How We Tested the 1.1.0 and 1.2.0 Providers

We installed Airflow 3.4.0 twice: once with common-ai 1.1.0 and standard 1.21.0, once with common-ai 1.2.0 and standard 1.22.0. One Dag held eight decorated tasks covering the patterns teams use, and we ran it with dag.test() and a run conf ticket containing {{ var.value.lab_secret }} / {{ conn.lab_db.password }}.

Both values were fake. The LLM connection pointed at a small local server that speaks the OpenAI Responses API and writes every request body to a file, so we could see exactly what a real provider would have received. A second run used a textbook Jinja sandbox escape payload instead of the secret lookups.

Lab matrix comparing Airflow common-ai 1.1.0 and 1.2.0 across eight Dag patterns and a sandbox escape payload
What reached the model on each build in our lab on November 29, 2026. Image: AgentStack lab.

1.1.0 sent the secrets from system_prompt and f-string prompts

On common-ai 1.1.0, a system_prompt of Customer tier: {{ dag_run.conf['ticket'] }} reached the model as “Customer tier: FAKE-VAR-7731 / FAKE-PW-4402”. The first render produced our payload text, and the second render inside execute() looked up the Variable and the Connection password.

Prompts that formatted the ticket or an upstream document with an f-string leaked the same way in both @task.llm and @task.agent. The standard provider control matched: @task.bash on 1.21.0 wrote both secrets into the T environment variable we passed through env.

1.2.0 fixed the fields but not the f-string pattern

On common-ai 1.2.0, the system_prompt task sent our payload as plain text, and so did every task that returned a template such as Triage this ticket: {{ ticket }}. The standard 1.22.0 bash control kept the environment value literal too.

The f-string tasks still leaked on 1.2.0. A function that returns f"Triage this ticket: {ticket}" hands Airflow a string that already contains the attacker’s braces, and the changelog says the returned prompt “is still rendered as a Jinja template.” The model received “Triage this ticket: FAKE-VAR-7731 / FAKE-PW-4402” on both builds.

This matches Apache’s own documentation, which now warns that text you insert with an f-string “is rendered as part of the template too.” The advisory and the news coverage we found present the upgrade as the fix, without saying that Dag code using f-strings needs a change as well.

The recommended pattern fails on 1.1.0

Referencing the argument by name only works on 1.2.0. On 1.1.0, all three tasks that returned {{ ticket }} or {{ doc }} failed with jinja2.exceptions.UndefinedError, because 1.1.0 did not expose function arguments to the prompt template. Teams that rewrite prompts before upgrading the provider will break those tasks.

Airflow’s sandbox stopped the textbook escape

Airflow renders task templates in a Jinja SandboxedEnvironment. Our payload {{ cycler.__init__.__globals__.os.popen('id -un').read() }} raised “access to attribute ‘__init__’ of ‘type’ object is unsafe” on both builds, and each task that evaluated it failed.

We did not reproduce command execution, so treat the reading of Variables and Connections as the confirmed impact in our lab and Apache’s command execution rating as its own assessment. One vibecoding.inc article says the task runner itself renders twice; PR #76244 shows the second render came from the decorators calling render_template_fields inside execute().

Why LLM Tasks Make This Worse

In LLM tasks, the rendered secret goes to a third party. On the vulnerable path, the Connection password left the worker inside a prompt bound for the model provider, where it can appear in provider logs, traces, and the model’s reply stored in XCom (Airflow’s task output store).

LLM decorators also invite untrusted text by design. Summarizing tickets, routing support messages, and analyzing documents means formatting outside text into prompts, which is exactly the input the advisory names. A prompt injection detection tool inspects what the model is told to do, but it does not see a template expression that Airflow evaluates before the model call.

17 Example Functions Still Use the Risky Pattern

We wrote a short Python AST check that flags decorated tasks whose returned prompt or command formats a function argument with an f-string, .format(), %, or +. It found 17 functions in 12 of the 55 example Dag files shipped in common-ai 1.2.0, down from 20 in 1.1.0.

Some flagged arguments are trusted values such as ds, the run date. Others carry the text the advisory warns about: notes in the quickstart summarize(), message in route_ticket(), ticket in the agent’s draft_reply(), and description in the classification example. Copying those examples into a Dag that reads outside text brings the injection back on a patched provider.

# Find returned prompts that format a function argument (run from your Dags folder)
import ast, pathlib
D = {"llm","agent","llm_sql","llm_branch","llm_file_analysis","llm_schema_compare","bash"}
for f in pathlib.Path(".").rglob("*.py"):
    for fn in ast.walk(ast.parse(f.read_text())):
        if not isinstance(fn, ast.FunctionDef): continue
        decos = [getattr(getattr(d, "func", d), "attr", "") for d in fn.decorator_list]
        if not D.intersection(decos): continue
        args = {a.arg for a in fn.args.args + fn.args.kwonlyargs}
        for r in ast.walk(fn):
            v = getattr(r, "value", None) if isinstance(r, ast.Return) else None
            risky = isinstance(v, ast.JoinedStr) or (isinstance(v, ast.Call) and getattr(v.func, "attr", "") == "format") or (isinstance(v, ast.BinOp) and isinstance(v.op, (ast.Add, ast.Mod)))
            used = {n.id for n in ast.walk(v) if isinstance(n, ast.Name)} & args if risky else set()
            if used: print(f"{f}:{r.lineno} {fn.name}() formats {sorted(used)} into the returned template")

Scanners Do Not Flag the Old Providers Yet

On November 29, 2026, pip-audit 2.10.1 returned “No known vulnerabilities found” for apache-airflow-providers-common-ai 1.1.0 and apache-airflow-providers-standard 1.21.0. An OSV.dev query for both versions came back empty, and the OSV record for CVE-2026-120353 carried no affected package data, so tools that match on package ranges cannot connect the CVE to your lockfile.

We saw the same lag in the Microsoft agent-framework compromise this month. Until the record gains package ranges, check provider versions by hand with pip show in every worker image, including images built for the KubernetesExecutor.

How to Fix Your Dags

Upgrade all four providers, then change Dag code that formats untrusted text into returned prompts or commands. Pass the text as a task argument and reference it by name in the template. Ship both changes together, because the named reference fails on common-ai 1.1.0 and f-strings stay injectable on 1.2.0.

pip install "apache-airflow-providers-common-ai>=1.2.0" "apache-airflow-providers-standard>=1.22.0" \
            "apache-airflow-providers-common-sql>=3.0.0" "apache-airflow-providers-cncf-kubernetes>=11.0.0"

# Before (still injectable on common-ai 1.2.0)
@task.llm(llm_conn_id="pydanticai_default", system_prompt="Triage tickets.")
def triage(ticket: str):
    return f"Triage this ticket: {ticket}"

# After (needs common-ai 1.2.0; the value is inserted as text)
@task.llm(llm_conn_id="pydanticai_default", system_prompt="Triage tickets.")
def triage(ticket: str):
    return "Triage this ticket: {{ ticket }}"
  • Limit who can trigger Dags with run conf. In our lab, run conf alone was enough to pull a Connection password into a prompt on 1.1.0.
  • Keep run conf and outside text out of system_prompt templates; pass them as arguments instead.
  • Give LLM tasks their own Connections with narrow scopes, and avoid storing database or cloud passwords in Variables that any template can read. The non-human identity tools we track can inventory those credentials.
  • Watch task logs for UndefinedError and SecurityError during rendering. In our runs, both showed up when a payload was evaluated or a pattern did not match the provider version.

Teams comparing orchestration options for agent workloads can see how Airflow’s model differs from durable execution engines in our Temporal vs Inngest vs Restate comparison. For broader controls around agents that read untrusted text, see the AI agent security tools guide.

What is CVE-2026-120353?

CVE-2026-120353 is an Apache Airflow template injection disclosed on November 26, 2026. TaskFlow decorators, including the common.ai @task.llm and @task.agent, rendered Jinja twice, so attacker text in run conf, arguments, or prompts was evaluated on the worker. Apache rates it Important and fixed it in four provider releases.

Which Airflow versions fix CVE-2026-120353?

Install apache-airflow-providers-common-ai 1.2.0, apache-airflow-providers-standard 1.22.0, apache-airflow-providers-common-sql 3.0.0, and apache-airflow-providers-cncf-kubernetes 11.0.0 or later. The fix lives in the providers, so upgrading Airflow core alone does not close it. Check every worker image and any custom image built for the KubernetesExecutor, since each one pins its own provider versions.

Is common-ai 1.2.0 enough to stop the injection?

Not for f-string prompts. In our November 29 lab, @task.llm and @task.agent functions that formatted run conf into the returned prompt still sent a Variable and a Connection password to the model on 1.2.0. Reference the argument as {{ ticket }} in the template instead.

Did you reproduce command execution on the worker?

No. Airflow renders templates in a Jinja sandbox, and our textbook escape payload failed with a SecurityError on both builds. We confirmed that Variables and Connection passwords were readable. Apache’s advisory still lists command execution as an impact, so plan the upgrade as if that path exists in your deployment.

Do pip-audit or OSV flag the vulnerable Airflow providers?

Not yet. On November 29, 2026, pip-audit 2.10.1 reported no known vulnerabilities for common-ai 1.1.0 and standard 1.21.0, and an OSV.dev query for both returned nothing. Upgrade from the Apache advisory rather than waiting for a scanner alert, and confirm the installed versions with pip show on each worker.

Sources

  1. Apache Airflow: CVE-2026-120353 security advisory (Nov 26, 2026)
  2. oss-security: CVE-2026-120353 Apache Airflow providers (Nov 26, 2026)
  3. apache/airflow PR #76244: Render only the returned value in TaskFlow decorators (merged Nov 2, 2026)
  4. apache-airflow-providers-common-ai changelog, 1.2.0 (Nov 23, 2026)
  5. common-ai documentation: LLMOperator and @task.llm
  6. CVE record: CVE-2026-120353
  7. pypistats: apache-airflow-providers-common-ai downloads