Airflow SSH provider before 7.0.1 runs environment values as shell
SSHRemoteJobOperator quotes templated environment values only once inside an already-quoted wrapper, so $(...) runs remotely.
Command injection in Airflow SSH provider environment values
In apache-airflow-providers-ssh before 7.0.1, SSHRemoteJobOperator quotes templated environment values only once, even though they sit inside an already-quoted wrapper script. Shell syntax such as $(...) in a value then runs on the remote SSH host. A user who can trigger, but not author, a Dag that feeds trigger-time input (params or dag_run.conf) into environment can run arbitrary commands as the SSH connection's user.
What to do: Upgrade apache-airflow-providers-ssh to 7.0.1 or later.
| Product | Affected | Fixed in |
|---|---|---|
| apache-airflow-providers-ssh | before 7.0.1 | 7.0.1 |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
In apache-airflow-providers-ssh before 7.0.1, SSHRemoteJobOperator quoted the values of its templated `environment` parameter only once, although they are placed inside an already-quoted wrapper script, so shell syntax such as `$(...)` in a value was executed on the remote SSH host. In a Dag that passes trigger-time input such as `params` or `dag_run.conf` into `environment`, a user who can trigger that Dag but cannot author Dags could run arbitrary commands on the remote host as the SSH connection's user. Users are advised to upgrade apache-airflow-providers-ssh to 7.0.1 or later.
SSHRemoteJobOperator quotes templated environment values only once inside an already-quoted wrapper, so $(...) runs remotely.
Today 625 readers · 755 views · 574 reads · all time 158K views