diff --git a/Projects/python-fb-example/requirements/requirements.txt b/Projects/python-fb-example/requirements/requirements.txt index e2e32ae..b093c1e 100644 --- a/Projects/python-fb-example/requirements/requirements.txt +++ b/Projects/python-fb-example/requirements/requirements.txt @@ -1,3 +1,5 @@ requests==2.32.0 pandas==2.2.3 jose==1.0.0 +Flask==2.2.2 +picklescan==0.0.24 diff --git a/Projects/python-fb-example/src/app.py b/Projects/python-fb-example/src/app.py index 2ce33b5..adbbd90 100644 --- a/Projects/python-fb-example/src/app.py +++ b/Projects/python-fb-example/src/app.py @@ -1,16 +1,13 @@ -# src/app.py -import requests -import pandas as pd +from flask import Flask, request, render_template_string -def fetch_data(url): - response = requests.get(url) - return response.json() +app = Flask(__name__) -def main(): - url = 'https://api.github.com/events' - data = fetch_data(url) - df = pd.DataFrame(data) - print(df.head()) +# A simple route that renders user input without proper sanitization +@app.route('/greet', methods=['GET']) +def greet(): + user_name = request.args.get('name', 'Guest') + # Rendering user input directly without escaping + return render_template_string(f"