CVE-2022-40127 Apache Airflow <2.4.0 has an RCE in a bash example
An attacker with UI access can execute arbitrary commands via the run_id parameter in example DAGs, requiring an upgrade to secure the system.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-40127?
CVE-2022-40127 is a high-severity command injection vulnerability in Apache Airflow, published on 14 Nov 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
A vulnerability in Example Dags of Apache Airflow allows an attacker with UI access who can trigger DAGs, to execute arbitrary commands via manually provided run_id parameter. This issue affects Apache Airflow Apache Airflow versions prior to 2.4.0.
Weakness: CWE-94
Which versions are affected by CVE-2022-40127?
4 open source packages ship an affected version, including apache-airflow and airflow. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
apache-airflow PyPI | All versions | 2.4.0 |
apache-airflow PyPI | All versions | 2.4.0 |
apache-airflow PyPI | All versions | 2.4.0 |
airflow Bitnami | All versions | 2.4.0 |
Products include Apache Airflow.
How do I fix CVE-2022-40127?
Upgrade apache-airflow to 2.4.0 or later.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2022-40127 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-40127 exists.
Public exploit code: 1 Nuclei template and 2 proofs of concept on GitHub.
Other vulnerabilities in Apache Airflow
- CVE-2020-13927 Apache Airflow's Experimental API Authentication Bypass
- CVE-2020-11978 Apache Airflow Command Injection
- CVE-2026-33264 Apache Airflow: DAG author RCE on webserver via unrestricted import_string() in BaseSerialization.deserialize()
- CVE-2023-25754 Apache Airflow: Privilege escalation using airflow logs
- CVE-2023-22884 Apache Airflow, Apache Airflow MySQL Provider: Arbitrary file read via MySQL provider in Apache Airflow
Sources
Also known as BIT-airflow-2022-40127, GHSA-6pw3-8h9w-32gc, PYSEC-2022-42982.