/

CVE-2026-41084

Severity:

HIGH RISK

(7.5)

Authorization Bypass via Inconsistent Resource Scoping (CWE-639) in Apache Airflow Bulk Task Instances API

CVE-2026-41084

Analyzed

Vulnerability type

Category:

Authorization Bypass / Insecure Direct Object Reference

CWE:

CWE-639

Impact:

Cross-DAG Task State Manipulation / Authorization Scope Escalation

Severity:

HIGH RISK

(7.5)

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 bulk Task Instances API improperly evaluated authorization using the dag_id from the URL path while applying changes to Task Instances identified by dag_id and dag_run_id fields in the request body.

An authenticated user with edit permission on one DAG could change Task Instance state in other DAGs by keeping the authorized DAG in the path and specifying arbitrary DAGs in the payload, undermining per-DAG isolation between teams.

Affected context

This vulnerability affects Apache Airflow deployments that:

  • Use the bulk Task Instances API endpoints:
  • PATCH /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances
  • DELETE /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances
  • Rely on per-DAG edit permissions to isolate Task Instance state between different teams or projects
  • Allow authenticated UI/API users to perform bulk operations on Task Instances

The issue surfaces when the server trusts the dag_id / dag_run_id identifiers in the request body more than the access control scope implied by the URL path parameters.

Exploit preconditions

  • Attack surface: Airflow REST API v2 bulk Task Instances endpoints, either directly or via the UI that calls them.
  • Required access:
  • Valid authenticated Airflow user account.
  • Edit permission on at least one DAG (the "attacker-controlled" DAG used in the URL path).
  • Trigger point:
  • Sending a PATCH or DELETE request to the bulk Task Instances endpoint where:
  • The URL path references a DAG and DAG Run the user is authorized to edit.
  • The JSON request body contains Task Instance entities that reference a different target DAG or DAG Run.
  • Why exploitation is possible:
  • Authorization checks are tied only to the dag_id from the URL path.
  • The server then performs state changes on Task Instances identified by dag_id and dag_run_id in the request body without revalidating access to those specific resources.
  • This mismatch between authorization scope (path) and operation targets (body) enables horizontal privilege escalation across DAGs.

Why this happens

The root cause is an authorization logic flaw where access control is evaluated against one set of identifiers while operations are carried out on another.

Specifically, the API checks whether the caller has edit rights on the DAG referenced by the URL path but then mutates Task Instances based on dag_id / dag_run_id fields from the JSON payload.

This pattern maps to CWE-639: Authorization Bypass Through User-Controlled Key, where a user-controlled identifier in the request body determines which resource is affected, without consistent or repeated authorization checks.

At an abstract level, the insecure pattern is:

  • Authorize once using a "trusted" key (path param).
  • Accept untrusted resource identifiers in the body.
  • Apply state changes to resources named in the body without verifying that the caller is authorized for each target.

Potential impact

  • An authenticated user could:
  • Force Task Instances in another team's DAGs into success, failed, or skipped states.
  • Delete or bulk-clear Task Instances in DAGs they should not control.
  • Disrupt scheduled workflows, causing jobs to be skipped or re-run incorrectly.
  • Corrupt operational visibility by falsifying Task Instance status and run history.
  • Indirectly impact data quality by altering execution state of ETL or ML pipelines owned by other teams.

General mitigation guidance

Effective mitigation focuses on consistent resource scoping and defensive authorization patterns:

  • Bind authorization to actual operation targets:
  • Ensure that every resource identified in the request (e.g., each Task Instance's dag_id / dag_run_id) is checked against the caller's permissions.
  • Reject any payload entities whose DAGs or DAG Runs the caller cannot edit, rather than silently applying changes.
  • Align URL and body semantics:
  • Design APIs so that the URL path fully and exclusively identifies the resource scope; body data should not be able to expand that scope.
  • Consider enforcing that all entities in the payload must match the path-level dag_id / dag_run_id.
  • Fail closed on mismatches:
  • Treat any inconsistency between path parameters and body identifiers as an error condition.
  • Limit breadth of bulk operations:
  • Impose validation rules and optional quotas on bulk operations to reduce blast radius if there is a misconfiguration.
  • Apply least-privilege authorization:
  • Restrict edit permissions to only those DAGs a user truly needs to manipulate.
  • Use role-based access control to separate day-to-day operators from highly privileged maintainers.

How teams detect issues like this

Detection can rely on both code-level analysis and runtime monitoring:

  • Static analysis and code review:
  • Flag patterns where:
  • Authorization is performed only on URL path parameters, but operations reference identifiers sourced from the request body.
  • A handler accepts arbitrary dag_id / dag_run_id fields from JSON and passes them to persistence or scheduler layers without permission checks.
  • Review API handlers for:
  • Bulk operations that iterate over entities from the body and call lower-level services directly.
  • Missing or inconsistent calls to central authorization helpers per resource.
  • Policy and framework enforcement:
  • Enforce centralized authorization policies that require resource-scoped checks for every access, not just per-endpoint.
  • Adopt patterns where resource lookup and permission checks are coupled (e.g., "load-and-authorize" helpers).
  • Runtime logging and anomaly detection:
  • Log bulk Task Instance mutations with the caller identity and target DAG IDs.
  • Monitor and alert on:
  • Users modifying Task Instances in many unrelated DAGs.
  • Access patterns where the DAG in the URL differs from DAGs in the affected Task Instances.
  • Automated tools:
  • Use API security testing tools to fuzz combinations of path and body identifiers.
  • Integrate SAST or custom linters in CI to detect IDOR-like patterns involving user-controlled keys.

Sources

SourceLink
github.comgithub.com/apache/airflow/pull/64288
lists.apache.orglists.apache.org/thread/w0hdcqfr71hf9rl1bwvpjs7q9yp1bldk
openwall.comopenwall.com/lists/oss-security/2026/05/31/7

Frequently asked

questions

Yes, but only by authenticated users who can reach the Airflow API or UI. It does not allow anonymous or unauthenticated access; the issue lies in over-permissive cross-DAG actions for already logged-in users.

The attacker must have a valid Airflow account with edit permission on at least one DAG. With that scope, they can craft bulk Task Instance operations that target other DAGs they should not control.

Ensure that authorization is performed against the actual resources being modified. Concretely, validate that every dag_id / dag_run_id referenced in the request body is within the caller's authorized scope, and reject requests that attempt to operate outside that scope or that mismatch the path parameters.

Adopt a design where:

  • Resource scope is derived from canonical identifiers (often URL path parameters), and payload data cannot expand that scope.
  • Authorization checks are centralized and automatically applied per resource access.
  • Code reviews and automated checks specifically look for mismatches between identifiers used for authorization and identifiers used for data operations, especially in bulk or batch APIs.
Find out what's already
exploitable in your codebase.