Wet-run · Test fixture

See SiftPulse react to real bugs — in under 60 seconds

Create a throwaway repo, push one of these small Python files, open a PR. Watch SiftPulse post inline comments within a minute.

Install SiftPulse on GitHub →
Free for public repos · No card needed
auth/login.py
/login — missing input validation + SQL injection
from flask import Flask, request, jsonify
import psycopg2

app = Flask(__name__)

@app.post("/login")
def login():
    username = request.json.get("username")
    password = request.json.get("password")

    conn = psycopg2.connect(dsn="dbname=app user=app")
    cur = conn.cursor()
    sql = "SELECT * FROM users WHERE name = '" + username + "' AND password = '" + password + "'"
    cur.execute(sql)
    user = cur.fetchone()

    if user:
        return jsonify({"ok": True, "user_id": user[0]})
    return jsonify({"ok": False}), 401

What SiftPulse should flag: SiftPulse should flag the SQL injection in `db.query(...)` as a blocker, plus the missing input validation on `username` / `password`.

auth/register.py
/register — unhandled duplicate-email error
from flask import Flask, request, jsonify
import psycopg2

app = Flask(__name__)

@app.post("/register")
def register():
    body = request.get_json()
    email = body["email"]
    password = body["password"]
    name = body.get("name", "")

    conn = psycopg2.connect(dsn="dbname=app user=app")
    cur = conn.cursor()
    cur.execute(
        "INSERT INTO users (email, password, name) VALUES (%s, %s, %s)",
        (email, password, name),
    )
    conn.commit()

    return jsonify({"ok": True, "email": email}), 201

What SiftPulse should flag: SiftPulse should flag the missing handling of the Postgres 23505 unique violation — a duplicate email leaks `Internal Server Error` to the client instead of a friendly 409.

auth/login_rate_limit.py
/login — no brute-force guard
from flask import Flask, request, jsonify
import psycopg2

app = Flask(__name__)

@app.post("/login")
def login():
    body = request.get_json()
    email = body.get("email", "")
    password = body.get("password", "")

    conn = psycopg2.connect(dsn="dbname=app user=app")
    cur = conn.cursor()
    cur.execute(
        "SELECT id, password_hash FROM users WHERE email = %s",
        (email,),
    )
    row = cur.fetchone()
    if not row:
        return jsonify({"ok": False}), 401
    if row[1] != password:
        return jsonify({"ok": False}), 401

    return jsonify({"ok": True, "user_id": row[0]})

What SiftPulse should flag: SiftPulse should flag the missing rate-limit / brute-force counter — every POST queries the users table, so an attacker can grind credentials at full request rate.