Week 2 lab · about 40 minutes

SQL Injection Lab: break it, then fix it

This is a fake shop login. Behind it, the app glues your text into a database command (SQL). Watch the command change as you type. Your job: get in without knowing the password, then switch on the fix and see why it works.

🛒 TinyShop staff login

What the database receives


    

Your input is shown in yellow. Anything after -- is a comment, so the database ignores it.

Users table (normally secret)

Challenges

    Hints (try first!)
    • A single quote ' ends the text early. Try typing just ' as the username.
    • For "any user": put ' OR '1'='1 in the password box.
    • For admin: username admin'-- and anything as password. The -- comments out the password check.