The vulnerability exists in the apache-airflow-providers-elasticsearch package, where the Elasticsearch task-log handler could leak credentials. The root cause was identified in the _group_logs_by_host method of the ElasticsearchTaskHandler class, located in airflow/providers/elasticsearch/log/es_task_handler.py.
Before the patch, this method used the raw self.host attribute as a fallback key for grouping log entries. The self.host attribute holds the Elasticsearch host URL from the configuration. If this URL contained embedded credentials (e.g., https://user:password@es.example.com), these credentials would be used as a dictionary key and written to the task logs, making them visible to any user with permission to read those logs.
The fixing commit f9244064016a8db45277efb0c24808e663b233f3 addresses this by introducing a new helper function, _strip_userinfo, which removes any username and password from the URL. The _group_logs_by_host method was modified to use this sanitized URL as the fallback, thus preventing the credentials from being logged. Therefore, any runtime profile capturing the execution of ElasticsearchTaskHandler._group_logs_by_host on a vulnerable version would be an indicator of this vulnerability being triggered.