SQL Injection
A safe, intentionally vulnerable data layer that teaches how injection arises and how parameterisation prevents it.
Scenario
A search or lookup feature builds a database query from user input by concatenation. You'll demonstrate that the data/code boundary is broken and then show the safe implementation.
Objective
Retrieve the flagged record through the vulnerable parameter without destructive actions, then rewrite the query safely.
Your approach
- Identify inputs that reach a database query.
- Probe gently and non-destructively to confirm the input alters query behaviour.
- Retrieve only the flagged record needed to prove impact — never damage data.
- Document the vulnerable pattern with evidence.
- Rewrite the query using bound parameters and least-privilege database access.
Rules of engagement
Run this lab only in the isolated environment provided — the downloadable bundle runs on your own machine in a private Docker network. Only interact with the lab's target, keep testing non-destructive, and never use these techniques on systems you don't own or aren't authorised to test. When you've met the objective, submit the flag (format SS{...}) to score.
Remediation focus
Use parameterised queries / prepared statements everywhere, apply least-privilege database accounts, and never build SQL by string concatenation.
Deliverable
Write up what you did, what you observed, the business impact, and a clear remediation — exactly as you would in a professional report.
Hints
Hint 1
Re-read the matching knowledge-base entry before you start.
Hint 2
Capture reproducible evidence as you go — you'll need it for the write-up.
Hint 3
For every finding, identify the single control that would prevent it.
Study the theory
Read the SQL Injection knowledge-base entry