The setPassword() function lacks access control, which results in anyone being able to call this function and set a new password.
The protocol's goal is to allow only s_owner to call setPassword() and set a new password. However, the setPassword() function lacks access control therefore allowing anyone to call it.
Anyone can call setPassword() and set a new password, which leads the password previously set by s_owner not being stored in s_password anymore.
The following test fails as is and passes when the vm.expectRevert(); line is uncommented, proving that address(1) can set a new password:
Foundry
Add access control to the setPassword() function:
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.