---
id: "CVE-2022-40189"
kind: "vulnerability"
aliases: ["CVE-2022-40189", "GHSA-rmf2-pwfq-h75j"]
title: "OS Command Injection in Apache Airflow"
severity: "critical"
cvss: 9.8
epss: 0.04078
exploited: false
status: "open"
category: "package"
products: [{"name": "apache-airflow", "fixed": ["2.3.0"], "affected": "< 2.3.0", "ecosystem": "pypi"}, {"name": "apache airflow", "fixed": ["2.3.0"], "affected": "< 2.3.0", "ecosystem": "vendor"}, {"name": "apache apache-airflow-providers-apache-pig", "fixed": ["4.0.0"], "affected": "< 4.0.0", "ecosystem": "vendor"}]
ecosystems: ["pypi", "vendor"]
tags: ["apache-airflow", "cwe-78", "package", "python", "self-hosted"]
not_affected_if: ["airflow-2.3.0-plus-without-pig", "no-pig-provider"]
published_at: "2022-11-22T10:15:16+00:00"
first_seen_at: "2026-10-26T21:11:44+00:00"
updated_at: "2026-10-26T21:20:32+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-rmf2-pwfq-h75j", "first_seen_at": "2026-10-26T21:11:44+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-40189", "first_seen_at": "2026-10-26T21:20:32+00:00"}]
---

# OS Command Injection in Apache Airflow

The Apache Airflow Pig Provider passes attacker-controlled input into OS commands executed in the task execution context. An attacker who can control task parameters can run arbitrary commands without needing write access to DAG files.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:apache-airflow affected < 2.3.0 fixed 2.3.0
- vendor:apache airflow affected < 2.3.0 fixed 2.3.0
- vendor:apache apache-airflow-providers-apache-pig affected < 4.0.0 fixed 4.0.0

## How to check

- Run `pip show apache-airflow-providers-apache-pig` to see whether the Pig Provider is installed and its version
- Run `airflow version` to check the Airflow core version
- Check whether the Pig Provider is listed in your requirements or constraints files

## Fix

- Upgrade the Pig Provider to `4.0.0` (`pip install apache-airflow-providers-apache-pig==4.0.0`), which is required even on Airflow 2.3.0+
- Upgrade Apache Airflow to `2.3.0` or later if the Pig Provider is installed

## Timeline

- 2026-10-26T21:11:44+00:00 ghsa https://github.com/advisories/GHSA-rmf2-pwfq-h75j
- 2026-10-26T21:20:32+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2022-40189

## From the sources

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') vulnerability in Apache Airflow Pig Provider, Apache Airflow allows an attacker to control commands executed in the task execution context, without write access to DAG files. This issue affects Pig Provider versions prior to 4.0.0. It also impacts any Apache Airflow versions prior to 2.3.0 in case Pig Provider is installed (Pig Provider 4.0.0 can only be installed for Airflow 2.3.0+). Note that you need to manually install the Pig Provider version 4.0.0 in order to get rid of the vulnerability on top of Airflow 2.3.0+ version.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
