/

CVE-2026-42359

Severity:

HIGH RISK

(8.8)

Unsafe XCom Deserialization & Forbidden Key Bypass (CWE-502) in Apache Airflow Triggerer

CVE-2026-42359

Analyzed

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution on the Airflow Triggerer

Severity:

HIGH RISK

(8.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's XCom PATCH endpoint (PATCH /api/v2/xcomEntries/{key}) allowed authenticated users with XCom write permission on a DAG to store serialized payloads under reserved keys, such as return_value, that should have been blocked.

Because the triggerer deserializer treated these payloads as code when deferred tasks resumed, an attacker with such permissions could achieve remote code execution (RCE) on the triggerer component in affected deployments.

Affected context

This vulnerability arises in Apache Airflow environments that:

  • Expose the REST API or Web UI to users who are not fully trusted
  • Grant those users XCom write permissions on DAGs that make use of deferrable operators or otherwise defer to the triggerer
  • Rely on XCom entries with reserved keys (e.g., return_value) to be protected by validation

The issue affects the PATCH endpoint for XCom entries, which did not enforce the FORBIDDEN_XCOM_KEYS validation already present on the corresponding POST/set path. When a deferred task resumes, the triggerer deserializes certain XCom values and can be tricked into executing attacker-controlled code.

Exploit preconditions

  • Attack surface: Airflow REST API and Web UI, specifically the PATCH /api/v2/xcomEntries/{key} endpoint.
  • Required access: Authenticated Airflow user with XCom write permission on at least one DAG that uses deferrable tasks or otherwise interacts with the triggerer.
  • Trigger point: The vulnerable XCom PATCH is used to:
  1. Write a crafted serialized payload under a reserved key name (e.g., return_value).
  2. Allow the corresponding task to defer and later resume, causing the triggerer to deserialize the XCom value.
  • Why exploitation is possible:
  • The PATCH path did not enforce FORBIDDEN_XCOM_KEYS, enabling writes to keys that are trusted by the triggerer.
  • The triggerer's deserializer accepts payload shapes that are interpreted as executable code rather than inert data.
  • Combined, this lets an attacker influence both the key and the serialized content consumed by a privileged component.

Why this happens

The core bug is a combination of unsafe deserialization and incomplete validation of security-sensitive keys:

  • The XCom subsystem allows arbitrary serialized payloads to be stored and later deserialized by the triggerer.
  • Reserved XCom keys (such as return_value) are treated specially by downstream logic and are not meant to be user-controlled, so they are guarded by FORBIDDEN_XCOM_KEYS.
  • A prior fix added validation for these forbidden keys on the POST/set endpoint but did not apply the same validator to the PATCH endpoint, creating a fix-bypass path.
  • When a deferred task resumes, the triggerer deserializer processes XCom values associated with these special keys using a mechanism that can instantiate or evaluate objects instead of treating them as plain data.

This maps directly to CWE-502: Unsafe Deserialization, where untrusted data is passed into a deserializer capable of interpreting it as code, made more severe by the bypass of key-level protections that were assumed to be universal.

Potential impact

  • Remote code execution on the Airflow triggerer process with its effective runtime privileges
  • Full compromise of task orchestration for affected DAGs, including alteration or injection of results
  • Lateral movement within the Airflow deployment, depending on the triggerer's network and credential access
  • Tampering with workflow outputs, leading to data integrity issues and downstream pipeline poisoning
  • Potential use of the triggerer as a foothold for broader infrastructure compromise

General mitigation guidance

Effective mitigation focuses on removing unsafe deserialization paths from untrusted control and tightening XCom key handling:

  • Apply uniform validation: ensure that all endpoints capable of creating or modifying XCom entries (POST, PATCH, PUT, bulk operations) consistently enforce forbidden/reserved key policies.
  • Constrain deserialization: prefer deserialization mechanisms that operate on strictly typed, schema-validated data structures and cannot instantiate arbitrary code or objects.
  • Reduce trust in XCom inputs: treat any user-supplied or indirectly user-influenced XCom data as untrusted; avoid using such values in code paths that support executable constructs.
  • Harden triggerer privileges: run the triggerer with least-privilege OS and platform permissions, limiting the blast radius if code execution is achieved.
  • Enforce role separation: avoid granting XCom write permissions on deferrable DAGs to users who are not fully trusted operators; separate operational and untrusted roles.
  • Centralize security checks: design API layers so that key-level and payload validation lives in shared components, minimizing the chance that one HTTP method or path omits a critical guard.

How teams detect issues like this

Detection typically combines code-level review with runtime monitoring:

  • Static analysis & code review:
  • Flag deserialization calls that operate on data reachable from HTTP handlers, UI inputs, or multi-tenant workflows.
  • Search for duplicated or inconsistent validation logic across similar endpoints (e.g., POST vs PATCH for the same resource).
  • Identify code paths where special/reserved keys or magic values receive different treatment and confirm all input paths enforce the same rules.
  • Policy enforcement:
  • Introduce CI checks that verify that every XCom write operation passes through common validation utilities (including forbidden-key checks).
  • Maintain internal security guidelines requiring safe deserializers or schema-driven formats for any value that can be user-controlled.
  • Runtime monitoring:
  • Log and alert on XCom writes using reserved or unexpected keys, especially when modified through PATCH.
  • Monitor triggerer logs for deserialization errors or anomalous exceptions that could reflect exploitation attempts.
  • Automated tooling:
  • Use SAST and API security scanners configured with rules for unsafe deserialization and inconsistent validation across REST endpoints.

Sources

SourceLink
github.comgithub.com/apache/airflow/pull/65915
lists.apache.orglists.apache.org/thread/g8dqykpf1p90tysq8tln4qtkqwb1038s
cve.orgcve.org/CVERecord?id=CVE-2026-33858

Frequently asked

questions

Yes, but only via authenticated access. An attacker must be able to reach the Airflow Web UI or REST API and authenticate as a user who has XCom write permissions on at least one DAG that uses deferrable tasks or the triggerer. It is not exploitable by anonymous network traffic alone.

The attacker needs valid Airflow credentials with permissions to write XCom entries for a DAG that defers execution to the triggerer. They do not need direct host-level access to the triggerer, but they must be able to send crafted PATCH requests to the XCom endpoint or perform equivalent operations through the UI.

The strongest pattern is to treat all workflow metadata and cross-task communication (like XCom) as untrusted input and to ensure that it is never deserialized with mechanisms that can execute code. Pair this with centralized, consistently applied validation for reserved keys and security-sensitive fields across all API endpoints and internal paths.

Future prevention should combine design and process: use safe, schema-bound serialization formats; centralize validation logic and enforce its use for every API method; adopt static analysis and code review checklists for unsafe deserialization; and restrict powerful workflow permissions (such as XCom writes on deferrable DAGs) to fully trusted operator roles only.

Find out what's already
exploitable in your codebase.