{"id":565,"cve":"CVE-2021-28359","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2021-28359","cwe":"CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')","cwe_number":79,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/79","cvss_score":6.1,"published":"2021-05-02","owasp":"A06 Vulnerable and Outdated Components","odc":"Function","cdc":"Incorrect Functionality","category":"Configuration Issues","subcategory":"Cross-Site Scripting (XSS)","scope":"Remote","impact":"Arbitrary Code Execution","summary":"Apache Airflow XSS vulnerability","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2021-28359\/","description":"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).","solution":"Update Apache Airflow to version 1.10.15 or 2.0.2.","affected_component":"Apache Airflow","fixed_by_upgrading":true,"vulnerable_code":"from flask import Flask, request\n\napp = Flask(__name__)\n\n@app.route('\/trigger', methods=['GET'])\ndef trigger():\n    origin = request.args.get('origin', '')\n    # Vulnerable to XSS: directly using the origin parameter in the response\n    return f'Triggered from {origin}'\n\nif __name__ == '__main__':\n    app.run()","patched_code":"from flask import Flask, request, escape\n\napp = Flask(__name__)\n\n@app.route('\/trigger', methods=['GET'])\ndef trigger():\n    origin = request.args.get('origin', '')\n    # Properly escape the origin parameter to prevent XSS\n    safe_origin = escape(origin)\n    return f'Triggered from {safe_origin}'\n\nif __name__ == '__main__':\n    app.run()","payload_needed":false,"payload":null,"payload_status":"none","published_fix":[],"references":null}