Stefan Friese
11 April, 2024
An SQL injection occurs when two things come together.
An SQL Query as a string embedded in other languages
sql_query = cursor.execute( "SELECT * FROM user_data where username = 'admin' and password = 's3cur3P4ssw0rd'" )
User input is possible as a part of said SQL query
sql_query = cursor.execute( "SELECT * FROM user_data where username = '%s' and password = '%s'", % (username, password) )