The vulnerability lies in an insecure JSON-RPC endpoint exposed by the Apache Airflow Edge3 provider when used with Airflow 2. This endpoint was intended for development and testing but was inadvertently enabled in a way that could be accessed by DAG authors.
The analysis of the provided patch, specifically commit 369b2e88d01d65c981e2b2deed950ea761645be6, reveals the root cause. The file providers/edge3/src/airflow/providers/edge3/worker_api/routes/_v2_routes.py defined a function rpcapi_v2 that handled requests to the /rpcapi endpoint. This function would deserialize a JSON-RPC request and use the method parameter from the request body to look up and execute a corresponding internal Airflow function.
This design is inherently dangerous as it creates a proxy for internal API calls. A user with permissions to author DAGs could make an HTTP request from within a task to this endpoint, specifying a sensitive internal function (e.g., one that can execute system commands or manipulate configurations) as the method, and provide crafted parameters. This would lead to Remote Code Execution (RCE) in the context of the Airflow webserver process.
The fix applied was to completely remove support for Airflow 2 from the Edge3 provider. This involved deleting the compatibility code for Airflow 2, including the file containing the vulnerable rpcapi_v2 function and the associated OpenAPI specification (edge_worker_api_v1.yaml). By doing so, the vulnerable endpoint is no longer exposed, mitigating the RCE risk.