The vulnerability exists in how Apache Airflow handles secrets within rendered template fields. When a DAG task uses a templated field that resolves to a secret value, that value was being exposed in the Airflow UI.
The root cause, as identified from the pull request discussions, is a discrepancy in how secret masking was applied. Secrets masked on the worker using mask_secret() were not being redacted in the 'Rendered Templates' UI view. This is because the secret patterns were registered with the worker's secret masker instance, but the UI relies on a different instance within the core Airflow application, which did not have access to the worker's patterns.
The analysis of the patches, specifically commit 1e294eeef6621183ba0f0d075a0b57350db25ff7, points to the _serialize_rendered_fields function in task-sdk/src/airflow/sdk/execution_time/task_runner.py as the source of the leak. The original code simply serialized the rendered fields without any redaction. The fix intercepts this process by explicitly calling redact() on each serialized field before it is sent from the task runner to the API server. This ensures that secrets are masked at the source (the worker) before being stored and potentially exposed in the UI. Therefore, _serialize_rendered_fields is the key vulnerable function that would be in the execution path when this vulnerability is triggered.