CVE-2025-54941: Apache airflow Apache Airflow Has A Command Vulnerability

MODERATE
Advisory Identifier: GHSA-v3c9-j6h9-66v4
CWE-78
Published
Advisory Summary

CVE-2025-54941 is a MODERATE apache airflow has a command vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Apache airflow libraries in the PyPI ecosystem. The issue involves apache airflow has a command injection vulnerability in "example_dag_decorator". Remediation is available by upgrading affected packages to version 3.0.5.

CVE-2025-54941 at a Glance

CVE Identifier CVE-2025-54941
GHSA Identifier GHSA-v3c9-j6h9-66v4
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Apache airflow
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-54941

To remediate this vulnerability, upgrade all affected Apache airflow dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

apache-airflow fixed: 3.0.5
pip install apache-airflow>=3.0.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show apache-airflow

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-54941, inspect your installed packages using pip:

pip show apache-airflow

Analyze the terminal output to locate any version of Apache airflow in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.5), your application is affected.

Note: The pip show apache-airflow command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Apache airflow, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

An example dag `example_dag_decorator` had non-validated parameter that allowed the UI user to redirect the example to a malicious server and execute code on worker. This however required that the example dags are enabled in production (not default) or the example dag code copied to build your own similar dag. If you used the `example_dag_decorator` please review it and apply the changes implemented in Airflow 3.0.5 accordingly.

CVE-2025-54941 Affected Apache airflow Versions

1 component(s)
Fixed Versions:
3.0.5
Product / Package Ecosystem Affected Versions Fixed Version
apache-airflow
PyPI
≥ 3.0.0
< 3.0.5
3.0.5

References

Frequently Asked Questions

What is CVE-2025-54941?
CVE-2025-54941 is a security vulnerability in Apache airflow involving Apache Airflow has a command injection vulnerability in "example_dag_decorator" under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Apache airflow versions are affected?
Affected versions include releases prior to 3.0.5 across affected packages: apache-airflow.
What version fixes CVE-2025-54941?
Upgrading to 3.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is apache-airflow affected?
Yes, apache-airflow is affected in releases prior to 3.0.5. Upgrade your dependency to 3.0.5 or later.
What CWE is associated with CVE-2025-54941?
CVE-2025-54941 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2025-54941?
Run the dependency tree command: 'pip show apache-airflow'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v3c9-j6h9-66v4",
  "modified" : "2025-11-05T20:55:04Z",
  "published" : "2025-10-30T12:31:11Z",
  "aliases" : [ "CVE-2025-54941" ],
  "summary" : "Apache Airflow has a command injection vulnerability in \"example_dag_decorator\"",
  "details" : "An example dag `example_dag_decorator` had non-validated parameter that allowed the UI user to redirect the example to a malicious server and execute code on worker. This however required that the example dags are enabled in production (not default) or the example dag code copied to build your own similar dag. If you used the `example_dag_decorator` please review it and apply the changes implemented in Airflow 3.0.5 accordingly.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "apache-airflow"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-54941"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/airflow"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/c6q6nofc6xl5bms039ks9b34v0v36df1"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2025/10/29/6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-10-30T17:09:19Z",
    "nvd_published_at" : "2025-10-30T10:15:35Z"
  }
}