DevGuard AI

Autonomous vulnerability scan & refactor

Model routing: standby
untitled.py
Loading editor…
# Paste code to scan — or run this sample (it's deliberately vulnerable)
from flask import Flask, request
import sqlite3

app = Flask(__name__)

@app.route("/user")
def get_user():
    uid = request.args.get("id")
    conn = sqlite3.connect("app.db")
    # CWE-89: user input concatenated straight into SQL
    row = conn.execute("SELECT name FROM users WHERE id = " + uid).fetchone()
    # CWE-79: reflected back to the browser without escaping
    return "<h1>Welcome " + row[0] + "</h1>"