Function setPassword()
not check owner so attacker (not owner) can set new password in contract
Set new password with function setPassword()
, now when call get getPassword()
contract will return changed password. Add function test below in PasswordStore.t.sol
for detail POC:
User can't retrieve correct password or attacker can get unauthorized access if password in contract use to check authenticate in other applications/system
Manual Review/ Foundry
Implement an owner check at the beginning of the function, ex:
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.