username = 'alice'TRUEPaXa Labs / 11 · Application Security
SQL Security Playground
See how unsafe query construction changes application logic and how parameters prevent it.QUERY SAFETYVULNERABLE
Fictional Login
SIMULATION PRESETS
Concatenated statement
SELECT id, username, role FROM users WHERE username = 'alice' AND password = 'demo123';APPLICATION SQL + USER INPUT INSERTED INTO SQL TEXT
users
IDUSERNAMEROLE
1aliceuser2bobuser3adminadmin4charlieuserQuery logic visualizer
ANDOPERATORpassword matches same accountTRUEUnsafe concatenation path
- 1Application receives user input.
- 2Input is concatenated directly into the SQL text.
- 3The simulator recognizes operators introduced by the input.
- 4The original WHERE condition changes.
- 5Unintended fictional rows may match.
- 6The demo application treats the result as authenticated.
Keep code and data separate
Direct concatenation makes it possible for untrusted characters to become part of the SQL structure.
HOW TO PREVENT ITUse parameterized queries or prepared statements. Do not build SQL statements by concatenating untrusted values.