CVE-2026-40948: apache-airflow-providers-keycloak Missing OAuth 2.0 State And Vulnerability

MODERATE
Advisory Identifier: GHSA-5w6h-pjw6-wvc6
CVSS 5.4
CWE-352
Published
Advisory Summary

CVE-2026-40948 is a MODERATE (CVSS 5.4) missing oauth 2.0 state and vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting apache-airflow-providers-keycloak libraries in the PyPI ecosystem. The issue involves missing oauth 2.0 state and pkce enables login csrf and session fixation. Remediation is available by upgrading affected packages to version 0.7.0.

CVE-2026-40948 at a Glance

CVE Identifier CVE-2026-40948
GHSA Identifier GHSA-5w6h-pjw6-wvc6
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product apache-airflow-providers-keycloak
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-40948

To remediate this vulnerability, upgrade all affected apache-airflow-providers-keycloak 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-providers-keycloak fixed: 0.7.0
pip install apache-airflow-providers-keycloak>=0.7.0
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-providers-keycloak

How to Check if You Are Affected

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

pip show apache-airflow-providers-keycloak

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. In apache-airflow-providers-keycloak, 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

The Keycloak authentication manager in `apache-airflow-providers-keycloak` did not generate or validate the OAuth 2.0 `state` parameter on the login / login-callback flow, and did not use PKCE. An attacker with a Keycloak account in the same realm could deliver a crafted callback URL to a victim's browser and cause the victim to be logged into the attacker's Airflow session (login-CSRF / session fixation), where any credentials the victim subsequently stored in Airflow Connections would be harvestable by the attacker. Users are advised to upgrade `apache-airflow-providers-keycloak` to 0.7.0 or later.

CVE-2026-40948 Affected apache-airflow-providers-keycloak Versions

1 component(s)
Fixed Versions:
0.7.0
Product / Package Ecosystem Affected Versions Fixed Version
apache-airflow-providers-keycloak
PyPI
≥ 0.0.1
< 0.7.0
0.7.0

References

Frequently Asked Questions

What is CVE-2026-40948?
CVE-2026-40948 is a security vulnerability in apache-airflow-providers-keycloak involving Missing OAuth 2.0 State and PKCE Enables Login CSRF and Session Fixation under CWE-352: Cross-Site Request Forgery (CSRF).
Which apache-airflow-providers-keycloak versions are affected?
Affected versions include releases prior to 0.7.0 across affected packages: apache-airflow-providers-keycloak.
What version fixes CVE-2026-40948?
Upgrading to 0.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is apache-airflow-providers-keycloak affected?
Yes, apache-airflow-providers-keycloak is affected in releases prior to 0.7.0. Upgrade your dependency to 0.7.0 or later.
What is the CVSS score of CVE-2026-40948?
CVE-2026-40948 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-40948?
CVE-2026-40948 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check PyPI dependencies for CVE-2026-40948?
Run the dependency tree command: 'pip show apache-airflow-providers-keycloak'. 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-5w6h-pjw6-wvc6",
  "modified" : "2026-04-22T17:36:41Z",
  "published" : "2026-04-18T15:34:15Z",
  "aliases" : [ "CVE-2026-40948" ],
  "summary" : "apache-airflow-providers-keycloak: Missing OAuth 2.0 State and PKCE Enables Login CSRF and Session Fixation",
  "details" : "The Keycloak authentication manager in `apache-airflow-providers-keycloak` did not generate or validate the OAuth 2.0 `state` parameter on the login / login-callback flow, and did not use PKCE. An attacker with a Keycloak account in the same realm could deliver a crafted callback URL to a victim's browser and cause the victim to be logged into the attacker's Airflow session (login-CSRF / session fixation), where any credentials the victim subsequently stored in Airflow Connections would be harvestable by the attacker. Users are advised to upgrade `apache-airflow-providers-keycloak` to 0.7.0 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "apache-airflow-providers-keycloak"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.1"
      }, {
        "fixed" : "0.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40948"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/airflow/pull/64114"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/airflow"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread/kc0odpr70hbqhdb9ksnz42fkqz2xld9q"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2026/04/17/14"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-22T17:36:41Z",
    "nvd_published_at" : "2026-04-18T14:16:10Z"
  }
}