CVE-2022-40127 Apache Airflow <2.4.0 has an RCE in a bash example

High 8.8 Published Updated

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.

PackageAffectedFixed in
apache-airflow PyPIAll versions2.4.0
apache-airflow PyPIAll versions2.4.0
apache-airflow PyPIAll versions2.4.0
airflow BitnamiAll versions2.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.

All Apache Airflow vulnerabilities

Sources

Also known as BIT-airflow-2022-40127, GHSA-6pw3-8h9w-32gc, PYSEC-2022-42982.

Is CVE-2022-40127 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free