SiteShadow
Back to vulnerability library

CWE-89 SQL Injection

What this means

SiteShadow flagged code that builds SQL using untrusted input without parameterization (string concatenation, interpolation, .format(), template literals, etc.).

Why it matters

Safer examples

1) Use parameterized queries (Python)

cursor.execute("SELECT * FROM users WHERE email = %s", (email,))

2) Use parameterized queries (Node / pg)

await client.query("SELECT * FROM users WHERE email = $1", [email]);

3) If you must build dynamic SQL, only use allowlisted fragments

allowed = {"created_at", "email"}
order_by = order_by if order_by in allowed else "created_at"
sql = f"SELECT * FROM users ORDER BY {order_by} DESC"
cursor.execute(sql)  # only allowlisted identifiers are interpolated

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Request access View coverage