Vulnerable Construction
// ❌ string concatenation
const sql = "SELECT id FROM users WHERE username='" + user + "' AND password='" + pass + "';";
Difficulty: Hard
Identify a vulnerable pattern, the classic bypass, and the proper defense.
New to SQLi? Read the SQL Injection Tutorial
A legacy login uses string concatenation to build a SQL query. You’ll spot the issue and copy the right answers to capture flags.
This is a safe, read-only example.
// ❌ string concatenation
const sql = "SELECT id FROM users WHERE username='" + user + "' AND password='" + pass + "';";
' OR '1'='1
Copy each answer exactly from the demo above (or wrap as CXA{...}). Case-insensitive.
0/3 flags captured
Hint: Two numbers and an equals sign; include the leading OR.
Hint: It’s how the SQL string is built from user and pass.
Hint: They’re also called prepared statements.