CVE-2021-28359
Apache Airflow XSS vulnerability
- CVSS 6.1
- CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
- Configuration Issues
- Remote
The "origin" parameter passed to some of the endpoints like '/trigger' was vulnerable to XSS exploit. This issue affects Apache Airflow versions <1.10.15 in 1.x series and affects 2.0.0 and 2.0.1 and 2.x series. This is the same as CVE-2020-13944 & CVE-2020-17515 but the implemented fix did not fix the issue completely. Update to Airflow 1.10.15 or 2.0.2. Please also update your Python version to the latest available PATCH releases of the installed MINOR versions, example update to Python 3.6.13 if you are on Python 3.6. (Those contain the fix for CVE-2021-23336 https://nvd.nist.gov/vuln/detail/CVE-2021-23336).
- CVSS base score
- 6.1
- Published
- 2021-05-02
- OWASP
- A06 Vulnerable and Outdated Components
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Configuration Issues
- Subcategory
- Cross-Site Scripting (XSS)
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Apache Airflow
- Fixed by upgrading
- Yes
Solution
Update Apache Airflow to version 1.10.15 or 2.0.2.
Vulnerable code sample
from flask import Flask, request
app = Flask(__name__)
@app.route('/trigger', methods=['GET'])
def trigger():
origin = request.args.get('origin', '')
# Vulnerable to XSS: directly using the origin parameter in the response
return f'Triggered from {origin}'
if __name__ == '__main__':
app.run()Patched code sample
from flask import Flask, request, escape
app = Flask(__name__)
@app.route('/trigger', methods=['GET'])
def trigger():
origin = request.args.get('origin', '')
# Properly escape the origin parameter to prevent XSS
safe_origin = escape(origin)
return f'Triggered from {safe_origin}'
if __name__ == '__main__':
app.run()Cite this entry
@misc{vaitp:cve202128359,
title = {{Apache Airflow XSS vulnerability}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2021},
note = {VAITP Python Vulnerability Dataset, entry CVE-2021-28359},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2021-28359/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
