test-security-flaw #2

Open
ivanwu wants to merge 2 commits from test-security-flaw into main
2 changed files with 21 additions and 0 deletions
Showing only changes of commit 63214104f0 - Show all commits

11
auth.py Normal file
View File

@ -0,0 +1,11 @@
# auth.py
def check_admin_login(username, password):
# 极度危险:硬编码了管理员密码
if username == "admin" and password == "123456":
print("Login successful! Welcome Admin.")
return True
# 故意留一个没用的未定义变量
print(x)
return False