The comments above setPassword() claims that 'This function allows only the owner to set a new password'
However, the function does NOT impose any access control checks
and as a result, anyone can set a new password,
overwriting the previous password s_password
// Does NOT revert
// Allowing anyone to set a new password
string memory overridingPassword = "ICanSetPasswordToo";
passwordStore.setPassword(overridingPassword);
vm.stopPrank();
}
function setPassword(string memory newPassword) external {
if (msg.sender != s_owner) {
revert PasswordStore__NotOwner();
}
s_password = newPassword;
emit SetNetPassword();
}
Anyone can call `setPassword` and set a new password contrary to the intended purpose.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.