From 6cc313ce50998351b093f578144add941b0cf4a2 Mon Sep 17 00:00:00 2001 From: try-panwiac <93744932+try-panwiac@users.noreply.github.com> Date: Tue, 27 Feb 2024 22:26:30 -0800 Subject: [PATCH] Create example.py --- example.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 example.py diff --git a/example.py b/example.py new file mode 100644 index 0000000..c78931d --- /dev/null +++ b/example.py @@ -0,0 +1,23 @@ +import os +from flask import Flask, request +import bleach +app = Flask(__name__) + +# curl -X GET "http://localhost:5000/tainted7/touch%20HELLO" +@app.route("/tainted7/") +def test_sources_7(something): + + os.system(request.remote_addr) + + return "foo" + +@app.route("/sanitized/") +def test_sources_7(something): + data = flask.request.args.get("key") + sanitized_data = bleach.clean(data) + os.system(sanitized_data) + + return "bar" + +if __name__ == "__main__": + app.run(debug=True)