Fix the query
Most SQL injection bugs come from one habit: gluing what users type into database commands. Read each piece of code, pick the fix a security reviewer would approve, and see the tests run.
Practice for defenders. This lab trains the skills SOC analysts, incident responders and sysadmins use to protect systems. Everything runs in your browser. The companies, people, data and IP addresses are made up, and nothing here touches a real system. Only use security skills on systems you own or have written permission to test.
Tests
Which fix would you approve?