Secrets can be unmasked in the "Rendered Template"
An authenticated user with access to view a DAG in the Airflow UI could craft a URL with a decoded execution_date parameter to unmask secret configuration values that are normally masked in the Rendered Template page. This allowed any user who could see a DAG to access secret credentials used by that DAG.
- Triaged in 3 days
- Fixed in 15 days
- Paid in 15 days
- Disclosed after 45 days
Summary by the program
CVE-2023-40712: Apache Airflow: Secrets can be unmasked in the "Rendered Template" Severity: moderate
Affected versions:
- Apache Airflow before 2.7.1
Description: Apache Airflow, versions before 2.7.1, is affected by a vulnerability that allows authenticated users who have access to see the task/dag in the UI, to craft a URL, which could lead to unmasking the secret configuration of the task that otherwise would be masked in the UI.
Users are strongly advised to upgrade to version 2.7.1 or later which has removed the vulnerability.
Credit: klexadoc (finder)
Full Security Advisory: https://lists.apache.org/thread/jw1yv4lt6hpowqbb0x4o3tdp0jhx2bts
The report
Affected versions
Apache Airflow before 2.7.1
How to reproduce
Go to the Rendered Template page and in address line replace encoded symbols of execution_date parameter with decoded symbols. Page is still shown, but with credentials unmasked.
Sibling pages in contrast have different behavior: K8s Pod Specs shows oops page and Log shows empty log whenexecution_date parameter is malformed
Example
not masked - http://airflow.dev.local/rendered-templates?dag_id=tutorial_taskflow_api&task_id=extract&execution_date=2023-08-17T16%3A15%3A08.189107+00%3A00
masked - http://airflow.dev.local/rendered-templates?dag_id=tutorial_taskflow_api&task_id=extract&execution_date=2023-08-17T16%3A15%3A08.189107%2B00%3A00


Example dag code:
import json
import pendulum
from airflow.decorators import dag, task
from airflow.models import Variable
@dag(
schedule=None,
start_date=pendulum.datetime(2023, 8, 17, tz="UTC"),
catchup=False,
tags=["example"],
)
def tutorial_taskflow_api():
@task()
def extract(pwd):
return pwd
order_data = extract(pwd = Variable.get('secret_var'))
print(order_data)
tutorial_taskflow_api()
In airflow UI variable with name secret_var should be added before trying
Impact
Any user who can see a dag can get access to secret credentials used by this dag
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Rendered Template page decodes the execution_date parameter before using it to look up the task instance, and the decoded value bypasses the masking logic that normally hides secrets.
What the attacker needed
Authenticated user; access to view the DAG in the UI; a secret variable used by the DAG
The fix
The vulnerability was fixed in Apache Airflow version 2.7.1.
How it was found
- Add a variable named secret_var in the Airflow UI.
- Go to the Rendered Template page for a task that uses the secret variable.
- In the address bar, replace the encoded symbols of the execution_date parameter with decoded symbols.
- The page still loads but now shows the credentials unmasked.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Apache Airflow is a tool for scheduling and running data workflows. It has a page that shows the template used for a task, and secret values in that template are normally hidden with asterisks. By changing the URL slightly, a logged-in user could make the page show the secret values in plain text instead.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.