mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Merge pull request #14084 from RasmusWL/flask-jsonify
Python: Remove XSS FP from use of `flask.jsonify`
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import json
|
||||
from flask import Flask, request, make_response, escape
|
||||
from flask import Flask, request, make_response, escape, jsonify
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@@ -26,3 +26,9 @@ def unsafe_json():
|
||||
def safe_json():
|
||||
data = json.loads(request.data)
|
||||
return make_response(json.dumps(data), 200, {'Content-Type': 'application/json'}) # OK, FP
|
||||
|
||||
|
||||
@app.route("/jsonify")
|
||||
def jsonify():
|
||||
data = request.data
|
||||
return jsonify(data) # OK, FP
|
||||
|
||||
Reference in New Issue
Block a user