The setPassword function does not possess the necessary access control for the intended functionality, opening the door to every address that wants to change the address of the contract.
The below function (setPassword) is not properly guided with the correct access control. making it a vulnerable entry for attacker.
This Vulnerability create the room for an attacker to change the password of the contract which negate one of the core functionality of the smart contract. wrote the below test in foundry to confirm that truly the vulnerability is exploitable.
Foundry(unit test)
Anyone can call `setPassword` and set a new password contrary to the intended purpose.
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.