Missions / Spot the hole

Mission 4 of 6

Spot the hole

This function decides who may open the admin panel. It has a serious bug.

def can_open(user, password):
    if user == "admin" or password == STORED[user]:
        return True
    return False

Which username gets in with any password at all?

The lesson: The "or" should be "and", and the check should compare the password for that exact user. One word can open a whole system.