How I Find My First Internet Bug Bounty for Apache Airflow
A logic flaw in Apache Airflow's XCom deserialisation meant that even with pickling disabled, a malicious pickle could still be deserialised and execute arbitrary commands. An attacker with DAG author permission could poison an XCom that a victim later pulls, leading to command execution on the victim's machine.
I am writing this article to share an interesting pickle deserialization vulnerability I have disclosed for Apache Airflow. I reported this finding to Airflow and got a bounty of $540 from IBB, an Internet Bug Bounty program organized by HackerOne (the purpose of IBB is to reward security research into vulnerabilities…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the fallback logic in the XCom deserialisation code attempted JSON decoding first and, on failure, fell back to pickle deserialisation regardless of the enable_xcom_pickling setting.
Impact
An attacker with DAG author permission could execute arbitrary OS commands on the machine of any user who pulls the poisoned XCom, though the vendor rated severity as low because DAG author permission is required.
What the attacker needed
DAG author permission; victim pulls the poisoned XCom
The fix
The bug was fixed by the Airflow security team after validation.
How it was found
- An attacker with DAG author permission creates a task that sets enable_xcom_pickling to True and pushes a malicious pickle object as an XCom.
- A victim task sets enable_xcom_pickling to False and pulls the attacker's XCom.
- Because JSON decoding of the pickle fails, the code falls back to pickle.loads(), executing the attacker's command.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Apache Airflow is a tool for scheduling data workflows. It stores small pieces of data called XComs, and normally these can be saved in a safe format (JSON) or an unsafe one (pickle). Pickle can run code when it is loaded, so it should be disabled. Here, a mistake meant that even when pickle was turned off, a specially crafted XCom could still be loaded as pickle and run commands on the machine of anyone who read it.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.