Horizon Alert
Summary of the vulnerability and why it matters
This advisory addresses a critical vulnerability in Apache Airflow's example code that could allow an attacker to inject commands into a worker's shell if specific example DAGs are loaded and triggered with a custom URL. While the affected code is not intended for production, it represents an incomplete fix for a previous vulnerability and requires attention if example DAGs are enabled.
- Example code allows command injection if enabled.
- It's a repeat fix; re-check previous remediation.
- Confirm relevance if example Dags are active.
Attack Path
How an attacker could exploit the issue
An attacker can exploit this vulnerability by sending a specially crafted HTTP request to a vulnerable Apache Airflow instance. This request would target the `example_dag_decorator` example DAG, which is loaded when the `load_examples` setting is enabled. By manipulating the `url` parameter within this request, the attacker can inject malicious shell commands that will be executed on the Airflow worker. This vulnerability is a partial fix for a previous issue.
- Requires example DAGs to be enabled.
- Triggered by a custom URL parameter.
- Allows remote command injection.
Live Threat
Current exploitation, exposure, and threat context
When example DAGs are loaded and a user can trigger a DAG with a custom URL parameter, it could lead to shell commands being injected and executed on the worker. This occurs because the system improperly validates an IP address fetched over HTTP, allowing for arbitrary characters in the input to be placed into a shell command.
- Worker execution environment.
- Loading example DAGs with custom URL.
- Remote code execution on workers.
Operational Fix
Recommended remediation, mitigation, and detection steps
The Apache Airflow platform owners and security teams are most likely responsible for addressing this vulnerability. The immediate first step is to identify all Airflow instances, confirm if example DAGs are enabled, and determine if these instances are exposed or critical. This will allow for an informed decision on remediation or mitigation strategies, such as upgrading Airflow or disabling example DAGs.
- Airflow platform and security teams own remediation.
- Verify example DAGs enabled and production impact.
- Upgrade Airflow or disable example DAGs.