VAITP Dataset

← Back to the dataset

CVE-2015-5216

Ipsilon 0.1.0 before 1.0.1 XSS via unescaped Python exception messages

  • CVSS 6.1
  • CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
  • Configuration Issues
  • Remote

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.

CVSS base score
6.1
Published
2020-02-17
OWASP
A03 Injection
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Configuration Issues
Subcategory
Cross-Site Scripting (XSS)
Accessibility scope
Remote
Impact
Information Disclosure
Affected component
Python
Fixed by upgrading
Yes

Solution

Update Ipsilon to version 1.0.1 or higher.

Vulnerable code sample

from flask import Flask, request

app = Flask(__name__)

@app.route('/error')
def error():
    # Simulating an error message that could be returned
    error_message = request.args.get('message', '')

    # Not escaping the error message, which can lead to XSS
    return f"<html><body><h1>Error</h1><p>{error_message}</p></body></html>"

if __name__ == '__main__':
    app.run()

Patched code sample

from flask import Flask, escape, request

app = Flask(__name__)

@app.route('/error')
def error():
    # Simulating an error message that could be returned
    error_message = request.args.get('message', '')
    
    # Properly escaping the error message to prevent XSS
    safe_error_message = escape(error_message)

    return f"<html><body><h1>Error</h1><p>{safe_error_message}</p></body></html>"

if __name__ == '__main__':
    app.run()

Cite this entry

@misc{vaitp:cve20155216,
  title        = {{Ipsilon 0.1.0 before 1.0.1 XSS via unescaped Python exception messages}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2020},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2015-5216},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2015-5216/}}
}

Download this entry as JSON Download the whole dataset

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 ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.