Code RoomSQL injection in query parameter
EasyPrep Room Coding #4462

SQL injection in query parameter

Vibe & agenticSecurityDatabases & SQLEntry–Mid~12 min

An AI agent wrote this Node.js handler to look up a user by the `email` query param. It runs and returns the right user in your testing. What injection problem should you spot on review, what input would expose it, and how do you fix it without rewriting the whole function?

Implement
build_user_lookup_query(filters: list[str]) → list[str]
Examples
in[["email=alice@example.com"]]out["SELECT id, name FROM users WHERE email = $1","alice@example.com"]
in[["email=' OR '1'='1","status=active"]]out["SELECT id, name FROM users WHERE email = $1 AND status = $2","' OR '1'='1","active"]
in[[]]out["SELECT id, name FROM users"]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 12 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.