The vulnerability, CVE-2025-66236, involves the logging of secrets in plain text within the Apache Airflow DAG run logs UI. The root cause was traced to a deprecated import path for the mask_secret function.
The investigation of the provided pull request, https://github.com/apache/airflow/pull/58662, and its associated commit, 667cb850edacfd0cc7153f98ef39ac5af7e8ef7c, pinpointed the issue to the task-sdk/src/airflow/sdk/execution_time/secrets_masker.py file. This file serves as a compatibility layer for the deprecated import path and utilizes a __getattr__ function to dynamically load requested functions.
The vulnerability existed because when a user's DAG code imported mask_secret from this deprecated module, the __getattr__ function would load an incorrect implementation from airflow.sdk._shared.secrets_masker. This version of mask_secret was designed for a single-process environment and did not communicate the list of secrets to be masked to the separate supervisor process responsible for writing logs. Consequently, secrets were not redacted and appeared in plain text.
The patch addresses this by modifying the __getattr__ function. It now includes a specific condition to check if the requested function is mask_secret. If so, it correctly imports the multi-process aware version from airflow.sdk.log, which ensures that secrets are properly communicated to the logging process and redacted.
Therefore, the function airflow.sdk.execution_time.secrets_masker.__getattr__ is identified as the vulnerable function. It facilitated the use of the insecure mask_secret implementation, leading to the exposure of sensitive information in the logs.