/

CVE-2026-33264

Severity:

CRITICAL RISK

(9.8)

Unsafe DAG Deserialization (CWE-502) in Apache Airflow

CVE-2026-33264

Analyzed

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution in Control Plane Components

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Apache Airflow contained an unsafe deserialization flaw where BaseSerialization.deserialize() could import attacker-controlled classes when loading serialized DAGs.

A malicious DAG author could embed a crafted trigger to achieve remote code execution within the Scheduler or API Server processes whenever the DAG is deserialized.

Affected context

The vulnerability arises in Apache Airflow deployments that use serialized DAGs and allow users to submit or modify DAG definitions.

It is most relevant in environments where DAG author code is intended to run only in worker contexts, yet serialized DAGs are parsed by central components such as the Scheduler and API Server.

The risk increases when DAG authors are semi-trusted or untrusted, and when configuration does not restrict the set of classes that may be deserialized.

Exploit preconditions

  • Attack surface: Airflow control plane components (Scheduler / API Server) that load serialized DAGs.
  • Required access: Ability to create, modify, or upload DAGs that will be serialized and later deserialized by the control plane.
  • Trigger point: Deserialization of DAGs via BaseSerialization.deserialize() during DAG loading, refresh, or processing.
  • Why exploitation is possible: The deserialization logic allowed unrestricted import_string() of class paths embedded in serialized DAG data, enabling untrusted DAG authors to cause arbitrary classes or code paths to be imported and executed in processes where their code should never run.

Why this happens

This issue is a classic instance of unsafe deserialization (CWE-502) in a workflow orchestration context.

The BaseSerialization.deserialize() method trusted class identifiers embedded in serialized DAG structures and used import_string() without applying a strict allowlist or validation.

By treating serialized DAG content as authoritative and fully trusted, Airflow blurred the boundary between data and executable logic, allowing untrusted DAG authors to influence which classes are imported and instantiated inside high-privilege components like the Scheduler and API Server.

Potential impact

  • Attackers could gain remote code execution within the Airflow Scheduler process.
  • Attackers could gain remote code execution within the Airflow API Server process.
  • Compromise of the Airflow control plane, including access to DAG metadata and configuration.
  • Lateral movement to connected systems through credentials, connections, or hooks managed by Airflow.
  • Disruption of scheduled workflows and potential tampering with orchestration logic.

General mitigation guidance

Mitigation typically focuses on tightening deserialization semantics and reinforcing trust boundaries between DAG authors and control-plane components.

Common defensive patterns include:

  • Applying strict allowlists for classes that may be deserialized, limiting imports to a small, known-safe subset of Airflow internals.
  • Treating serialized DAG data as untrusted input and validating or normalizing it before deserialization, especially when it originates from DAG authors.
  • Separating responsibilities so that high-privilege processes avoid executing or importing any DAG-author-controlled code paths.
  • Reducing the privileges of control-plane components (Scheduler / API Server) and limiting their access to sensitive resources, following least-privilege principles.
  • Establishing governance around DAG author trust levels, ensuring that untrusted or semi-trusted authors cannot submit DAGs that are automatically promoted to production control-plane environments.

How teams detect issues like this

Detection can be approached through both preventative and retrospective techniques:

  • Static analysis and code review: Look for deserialization routines that call generic import helpers (such as import_string() or dynamic __import__) using values derived from serialized or user-controlled data, particularly in DAG serialization/deserialization paths.
  • Configuration review: Audit Airflow configurations for permissive deserialization settings, such as broad or unset [core] allowed_deserialization_classes, and flag deployments where DAG authorship is not fully trusted.
  • Control-plane monitoring: Instrument the Scheduler and API Server to log class loading and dynamic imports during DAG deserialization, alerting on unexpected modules or packages being imported.
  • Automated tooling: Use security scanners or custom linting rules integrated into CI/CD pipelines to detect patterns of unsafe deserialization and dynamic imports in orchestrator code and plugins.

Sources

SourceLink
github.comgithub.com/apache/airflow/pull/66002
github.comgithub.com/apache/airflow/pull/68528
lists.apache.orglists.apache.org/thread/otvdw8qt2y7xy2n5nq9xby9ky4rf5ltj
openwall.comopenwall.com/lists/oss-security/2026/07/07/1

Frequently asked

questions

Exploitability primarily depends on who can author or modify DAGs.

In environments where DAG authors are untrusted or semi-trusted and their DAGs are serialized and processed by the central Airflow components, an attacker could craft malicious serialized content to execute code on the Scheduler or API Server.

An attacker needs the ability to submit or change DAGs that will be serialized and later deserialized by the Airflow control plane.

This may be via direct file system access, version-controlled DAG repositories, or Airflow-integrated deployment pipelines.

The safest pattern is to restrict deserialization to a tightly controlled set of known-safe classes and to treat all serialized DAG content as untrusted data.

Implementing and enforcing an allowlist for deserializable classes, combined with refactoring deserialization code to avoid generic dynamic imports, provides a strong baseline fix.

To prevent similar vulnerabilities, design serialization formats so they encode data, not executable types, avoid dynamic imports based on user-supplied identifiers, and enforce clear trust boundaries between DAG authors and control-plane processes.

Incorporating security reviews for serialization/deserialization logic, adding automated checks in CI, and establishing conservative default configurations for class loading all help reduce the risk of future unsafe deserialization flaws.

Find out what's already
exploitable in your codebase.