VAITP Dataset

← Back to the dataset

CVE-2015-5607

IPython 2/3 REST API Cross-Site Request Forgery

  • CVSS 8.8
  • CWE-352: Cross-Site Request Forgery (CSRF)
  • Configuration Issues
  • Remote

Cross-site request forgery in the REST API in IPython 2 and 3.

CVSS base score
8.8
Published
2017-09-20
OWASP
A07 Identification and Authentication Failures
Orthogonal defect classification
Checking
Code defect classification
Incorrect Check
Category
Configuration Issues
Subcategory
Cross-Site Request Forgery (CSRF)
Accessibility scope
Remote
Impact
Unauthorized Access
Fixed by upgrading
Yes

Solution

Update to IPython version 7.31.0 or higher

Vulnerable code sample

from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route('/api/resource', methods=['POST'])
def update_resource():
    data = request.json
    return jsonify({"status": "success", "data": data}), 200

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

Patched code sample

from flask import Flask, request, jsonify
from flask_wtf.csrf import CSRFProtect

app = Flask(__name__)
app.secret_key = 'your_secret_key'
csrf = CSRFProtect(app)

@app.route('/api/resource', methods=['POST'])
@csrf.exempt
def update_resource():
    data = request.json
    return jsonify({"status": "success", "data": data}), 200

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

Cite this entry

@misc{vaitp:cve20155607,
  title        = {{IPython 2/3 REST API Cross-Site Request Forgery}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2017},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2015-5607},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2015-5607/}}
}
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 ::