research-school-2024/examples/insecure-data.py
Ari Archer 2dd94a9bc5
Implement a bunch of vulnerabile examples.
Signed-off-by: Ari Archer <ari@ari.lt>
2024-12-05 01:30:06 +02:00

17 lines
338 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Insecure data handling"""
from flask import Flask, request
app: Flask = Flask(__name__)
@app.route("/", methods=["GET"])
def index():
alloc = [42] * 10 # Imagine data allocation
return str(alloc[int(request.args["idx"])])
if __name__ == "__main__":
app.run(debug=True)