Summary
Apache Airflow's scheduler fully deserializes XCom values written by task code while evaluating task dependencies. When a less-trusted DAG author can control those values and the scheduler processes an affected dependency, the scheduler may deserialize attacker-controlled data in a higher-privilege context.
Affected context
The issue arises in Apache Airflow deployments where DAG authors are less trusted than Deployment Managers, but can control values written to XCom by task code. It becomes relevant when the scheduler evaluates a task dependency that reads one of those task-written XCom values.
Exploit preconditions
- Attack surface: XCom deserialization during scheduler-side task dependency evaluation
- Required access: Ability to author or control a DAG task that writes an XCom value
- Trust condition: The deployment treats DAG authors as less trusted than Deployment Managers
- Trigger point: The scheduler evaluates a dependency that reads the task-written XCom value
- Why exploitation is possible: The scheduler fully deserializes the value in a process with greater trust and authority than the worker-scoped capability assigned to DAG authors
Why this happens
The scheduler fully deserializes task-controlled XCom values while evaluating dependencies, treating serialized input as safe despite its control by a lower-trust DAG author. This is CWE-502: Deserialization of Untrusted Data. The insecure pattern is allowing rich object deserialization across a privilege boundary rather than limiting inputs to constrained, non-executable data.
Potential impact
- Attacker-controlled deserialization may compromise the scheduler process.
- Scheduler integrity or availability could be affected.
- An attacker may gain access to data or operations available to the scheduler.
- The issue could enable actions beyond the worker-scoped execution capability intended for DAG authors.
General mitigation guidance
Mitigation centers on reducing trust in serialized task data and constraining what the scheduler accepts.
- Restrict dependency evaluation to primitive, non-executable values.
- Prefer safe, narrowly scoped serialization formats over general-purpose object deserialization.
- Validate XCom types and schemas before values cross into scheduler-side logic.
- Preserve privilege boundaries between DAG authors, workers, and scheduler processes.
- Limit scheduler permissions and access to sensitive resources according to least-privilege principles.
How teams detect issues like this
- Review scheduler paths that deserialize or consume XCom values, especially during dependency evaluation.
- Use static analysis to identify general-purpose deserialization of values originating from task code.
- Check code review guidance and security policies for requirements that scheduler inputs remain primitive and schema-constrained.
- Audit trust boundaries and permissions for DAG authors, worker processes, and scheduler components.
- Automated code review tools may help flag unsafe deserialization patterns for further assessment.

