The private key Apache Airflow didn't hide
How I discovered CVE-2026-111452 in Apache Airflow: a secrets-masking bug that could expose private keys, database passwords and webhook tokens.
Over the last few months, I’ve spent a lot of time on bug bounty research. I’ve looked at large companies like PlayStation, but most of my research has focused on reviewing source code in open-source projects written in Python.
One of the projects I came across during that research was Apache Airflow, which has over 47,000 GitHub stars and is used by more than 80,000 companies worldwide. I went through its previous CVEs and found five from this year involving the secrets masker. I would normally have moved on to another part of the code, but that many CVEs in the same feature made me curious. I wanted to see what the code looked like after all those fixes. A couple of days later, I found that Airflow could still leave a private key unmasked.
What is Apache Airflow and how does secret masking work?
Apache Airflow helps companies automate workflows: a series of tasks that need to run in a particular order. For example, a company might collect data from a database, process it and upload the results to cloud storage. Airflow schedules these tasks and makes sure each step runs after the tasks it depends on have finished.
It is also used for machine learning workflows, where data needs to be collected and prepared before a model can be trained.
To connect to a database or upload files to cloud storage, those tasks often need passwords, private keys or tokens. These credentials can end up in logs when a task prints its settings or reports an error.
Airflow uses a secrets masker to replace sensitive values with ***. For example, a database password should be hidden before someone reads the log.
There are two ways this can happen. A value can be registered with mask_secret(), telling Airflow to hide it. Airflow also checks field names: if a field is called private_key, the masker treats its value as sensitive and hides it.
What could someone do with the leaked secrets?
Someone troubleshooting a failed task might be allowed to read its logs or inspect its settings without being allowed to see the credentials it uses.
The bug could leave those credentials readable in task logs, rendered template fields or affected API responses. Rendered template fields show the task’s settings after Airflow has filled in the values from its templates.
For example, a database connection string can contain both a username and a password. If that string remained readable under connectionString, someone viewing the output could copy those login details and potentially use them to access the database.
Having permission to troubleshoot an Airflow task should not also give someone the credentials for the systems it connects to.
Looking through the code
I started with should_hide_value_for_key() in secrets_masker.py. This function checks whether a field name contains a term from Airflow’s sensitive-field list. That list includes names such as private_key, connection_string and webhook_url.
Airflow uses fixed names such as login and password for its built-in connection fields. Developers can also store JSON in connection extras and Variables. They can choose the field names in that JSON themselves or use the names required by an integration.
A field called privateKey can therefore already be part of a normal workflow. Both privateKey and private_key are common ways of naming the same kind of value.
Before checking the name, the code converts it to lowercase and replaces characters such as hyphens with underscores.
secrets_masker.py at commit df7b8a7.
For example, private-key becomes private_key, which matches the sensitive-field list.
For privateKey, the uppercase K becomes lowercase, but no underscore is added. The result is privatekey, which does not match private_key on the sensitive-field list.
The same problem affected names such as connectionString and webhookUrl. I wrote a small Python script that loaded Airflow’s masking code and called it directly to see what happened to values stored under those names.
What happened when I tested it
I tested it with Airflow’s default masking settings. I started by checking which field names Airflow recognized as sensitive. I tried each name in two common styles: camelCase, such as privateKey, and snake_case, such as private_key.
| camelCase field | Recognized as sensitive | snake_case field | Recognized as sensitive |
|---|---|---|---|
privateKey | No | private_key | Yes |
serviceAccount | No | service_account | Yes |
connectionString | No | connection_string | Yes |
webhookUrl | No | webhook_url | Yes |
accessToken | Yes | access_token | Yes |
apiKey | Yes | api_key | Yes |
accessToken still worked because token was on the sensitive-field list. The check could find that word inside the longer name, even without an underscore. apiKey worked for a different reason: lowercasing it produced apikey, which was also on the list. I saw the same behavior with clientSecret, since it contains secret.
If I had stopped at accessToken or clientSecret, I would have missed the bug entirely…
I tested whether Airflow would mask the secrets stored under those field names.
I created two versions of the same test data. Both contained a test private key, a service account identifier, a database connection string and a webhook URL. One used camelCase field names such as privateKey. The other used snake_case names such as private_key. The values themselves were identical.
I passed both versions to redact(). All four values under the camelCase names came back unchanged. Under the snake_case names, they were replaced with ***.
I initially thought I had mixed up the test data, so I ran it again. The result stayed the same.
For example, the password in this connection string was still readable in the returned dictionary:
{"connectionString": "Server=db;User Id=app;Password=hunter2;"} I couldn’t resist using hunter2 for a bug about passwords not being hidden ;)
Using connection_string instead resulted in:
{"connection_string": "***"} I also passed the test private key directly to redact() with a name argument. name="privateKey" returned the original value. name="private_key" returned ***.
What about those other CVEs?
I found five earlier CVEs involving Airflow’s secret masking. Those fixes addressed other masking issues, but this bug was still present. Airflow did not recognize names such as privateKey as sensitive.
Reporting it to Apache
I reported the issue to the Airflow security team on October 12, 2026. They confirmed it, and Jarek Potiuk’s fix was merged on October 16 in PR #74840.
I shared this update on X on October 25:
My post on X from October 25, 2026.
The fix is included in Apache Airflow 3.4.0. The CVE was published on November 9, 2026. Thanks to the Airflow security team and Jarek Potiuk for handling the report and fixing it.
What I enjoyed about this research was testing the code myself rather than assuming the earlier fixes had covered everything. Some field names worked as expected, but others left the same test values readable.
I’ll be starting OffSec’s OSWE soon as part of working towards OSCE³.
I’m also planning to contribute more to hacking tools such as NetExec, while continuing my bug bounty research into Python-based AI/ML projects. I recently received a $5,000 bounty for another finding, which I’ll cover in more detail in an upcoming blog post.
Thank you for reading!
The public CVE record can be found here: CVE-2026-111452.
References
- CVE-2026-111452
- Apache security advisory
- Fix: apache/airflow#74840
- Earlier masking advisories: CVE-2026-42358, CVE-2026-42360, CVE-2025-68438, CVE-2026-59244, CVE-2026-65017




