{"id":675,"cve":"CVE-2015-5216","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2015-5216","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":"2020-02-17","owasp":"A03 Injection","odc":"Function","cdc":"Incorrect Functionality","category":"Configuration Issues","subcategory":"Cross-Site Scripting (XSS)","scope":"Remote","impact":"Information Disclosure","summary":"Ipsilon 0.1.0 before 1.0.1 XSS via unescaped Python exception messages","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2015-5216\/","description":"The Identity Provider (IdP) server in Ipsilon 0.1.0 before 1.0.1 does not properly escape certain characters in a Python exception-message template, which makes it easier for remote attackers to conduct cross-site scripting (XSS) attacks via an HTTP response.","solution":"Update Ipsilon to version 1.0.1 or higher.","affected_component":"Python","fixed_by_upgrading":true,"vulnerable_code":"from flask import Flask, request\n\napp = Flask(__name__)\n\n@app.route('\/error')\ndef error():\n    # Simulating an error message that could be returned\n    error_message = request.args.get('message', '')\n\n    # Not escaping the error message, which can lead to XSS\n    return f\"<html><body><h1>Error<\/h1><p>{error_message}<\/p><\/body><\/html>\"\n\nif __name__ == '__main__':\n    app.run()","patched_code":"from flask import Flask, escape, request\n\napp = Flask(__name__)\n\n@app.route('\/error')\ndef error():\n    # Simulating an error message that could be returned\n    error_message = request.args.get('message', '')\n    \n    # Properly escaping the error message to prevent XSS\n    safe_error_message = escape(error_message)\n\n    return f\"<html><body><h1>Error<\/h1><p>{safe_error_message}<\/p><\/body><\/html>\"\n\nif __name__ == '__main__':\n    app.run()","payload_needed":false,"payload":null,"payload_status":"none","published_fix":[],"references":null}