Back to Home

Vulnerable SQL Lab

This lab demonstrates how SQL injection attacks work. Try entering payloads like ' OR '1'='1 to see the vulnerability in action.

Search Users

Vulnerable Code:

# Python (Flask) query = "SELECT * FROM users WHERE username = '" + user_input + "'" result = db.execute(query)

Results

Enter a search query and click Search to see results

Try these payloads:

Why is this vulnerable?

The application concatenates user input directly into the SQL query string without any validation or parameterization. An attacker can inject SQL syntax to alter the query logic. For example, ' OR '1'='1 changes the WHERE clause condition to always be true, bypassing authentication or extracting unauthorized data.