You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defselect(conn, form):
cursor=conn.cursor()
uname=form.get('username', '')
pwd=form.get('password', '')
sql=""" SELECT * FROM User WHERE username="{}" and password="{}" """.format(uname, pwd)
cursor.execuate(sql)
returncursor.fetchall()
假设以上代码, 用户提交的数据为:
form= {
'username': 'bobo" or "1"="1''password'=''
}
那么 sql 语句就变成了Where username="bobo" or "1"="1" and password="", 这里 username 是正确的情况下该语句恒成立(先执行 and 再执行 or), 所以可以不用输入密码就登录.
No description provided.
The text was updated successfully, but these errors were encountered: