CVE-2025-54941

4.6 MEDIUM

📋 TL;DR

This CVE describes an OS command injection vulnerability in Apache Airflow's example_dag_decorator where unvalidated parameters could allow UI users to redirect to malicious servers and execute code on workers. Only affects systems where example dags are enabled in production (not default) or where users have copied the vulnerable example code into their own dags. Requires user interaction through the Airflow UI.

💻 Affected Systems

Products:
  • Apache Airflow
Versions: Versions before 3.0.5 containing the vulnerable example_dag_decorator
Operating Systems: All
Default Config Vulnerable: ✅ No
Notes: Only vulnerable if example dags are enabled in production (not default) OR if users copied the vulnerable example_dag_decorator code into their own dags.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution on Airflow worker nodes, potentially leading to full compromise of the Airflow environment and underlying infrastructure.

🟠

Likely Case

Limited impact since example dags are disabled by default in production; most likely scenario involves developers who copied the vulnerable example code without proper validation.

🟢

If Mitigated

No impact if example dags are disabled (default) and custom dags implement proper input validation.

🌐 Internet-Facing: MEDIUM - If Airflow UI is exposed to internet and vulnerable configuration exists, but requires authenticated user interaction.
🏢 Internal Only: LOW - Requires specific non-default configuration and user interaction through the UI.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires authenticated access to Airflow UI and specific configuration conditions. Exploitation involves manipulating dag parameters through the UI.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Airflow 3.0.5

Vendor Advisory: https://lists.apache.org/thread/c6q6nofc6xl5bms039ks9b34v0v36df1

Restart Required: No

Instructions:

1. Upgrade to Airflow 3.0.5 or later. 2. If using example_dag_decorator or copied its code, review and apply the security fixes from the updated version. 3. Ensure example dags remain disabled in production environments.

🔧 Temporary Workarounds

Disable example dags in production

all

Prevents exploitation by removing the vulnerable example code from production environments

Set load_examples = False in airflow.cfg or AIRFLOW__CORE__LOAD_EXAMPLES=False in environment

Input validation for custom dags

all

Add proper input validation and sanitization to any dags based on the vulnerable example

Review custom dag code and implement parameter validation similar to Airflow 3.0.5 fixes

🧯 If You Can't Patch

  • Disable example dags in production configuration
  • Review and modify any custom dags based on example_dag_decorator to add input validation
  • Restrict UI access to trusted users only
  • Implement network segmentation to isolate Airflow workers

🔍 How to Verify

Check if Vulnerable:

Check if example dags are enabled in production (load_examples=True) OR if you have custom dags based on example_dag_decorator without proper input validation.

Check Version:

airflow version

Verify Fix Applied:

Verify Airflow version is 3.0.5 or later, and that custom dags implement proper parameter validation.

📡 Detection & Monitoring

Log Indicators:

  • Unusual parameter values in dag execution logs
  • External network connections from workers to unexpected destinations

Network Indicators:

  • Outbound connections from Airflow workers to unknown external servers

SIEM Query:

airflow AND (example_dag_decorator OR parameter_injection OR os_command)

🔗 References

📤 Share & Export