The vulnerability stems from the absence of access control in the setPassword
function, allowing anyone to set a new password.
The vulnerability resides in the setPassword
function of the PasswordStore
smart contract. Currently, there is no access control mechanism in place, which means that anyone, regardless of their permissions or identity, can set a new password for the contract.
The potential consequences of this vulnerability are significant. Given that everyone, including malicious actors, can freely set a new password, it introduces a substantial security risk. This unauthorized access can lead to unauthorized control and manipulation of the contract, compromising both the protocol's integrity and the security of the user.
Manual Review
To address this vulnerability, it is crucial to implement proper access control within the setPassword
function. Access should be restricted to authorized users or the contract owner. A possible solution is to add an access control statement, as shown below:
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.