Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create test2.py #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions test2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from flask import Flask, request, render_template_string

app = Flask(__name__)

@app.route('/')
def home():
return "Welcome to the simple web server!"

@app.route('/hello', methods=['GET'])
def hello():
name = request.args.get('name', 'World')
# Potential security risk: Reflected Cross-Site Scripting (XSS)
return render_template_string(f'Hello, {name}!')

Check warning

Code scanning / CodeQL

Reflected server-side cross-site scripting Medium test

Cross-site scripting vulnerability due to a
user-provided value
.

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

Check failure

Code scanning / CodeQL

Flask app is run in debug mode High test

A Flask app appears to be run in debug mode. This may allow an attacker to run arbitrary code through the debugger.
Loading