the contract can allow another person to save another password and overwrite the owner's password.
the setPassword() function is loose and not restricted to the owner.
POC
'''solidity
contract interactWithPaassStore{
PasswordStore public passwordstore;
string public password;
constructor(address victimAddress) {
passwordstore = PasswordStore(victimAddress);
}
function store(string memory _newpass) external {
password = _newpass;
passwordstore.setPassword(password);
}
'''
with this code, the setPassword() function gets updated without the owner's knowledge. when the owner calls getPassword() function, it returns the updated password, not the owner's password.
password variable can be updated by anyone
remixIde
add this revert checks to setPassword()
'''solidity
if (msg.sender != s_owner) {
revert PasswordStore__NotOwner();
'''
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.