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

Only Owner Check Missing

Summary

It's scaring, I found that anyone can set or update the password. The owner of the Smart contract PasswordStore has no protection in place to authoritatively set a new password or update an existing one.

Vulnerability Details

modifier onlyOwner() {
if (msg.sender != s_owner) revert PasswordStore__NotOwner();
_;
}
// function setPassword(string memory newPassword) external { ❌ onlyowner check is missing.
function setPassword(string memory newPassword) external onlyOwner {
// onlyowner check was missing , I accomplish DRY. Therefore using onlyOwner modifier. ✅
// statements...
}

Impact

The PasswordStore Smart contract is worthless if it has no authorized Password store & update mechanism. Therefore it would be considered a crap without that mechanism.

Tools Used

Manually Hunted.

Recommendations

Use my modifier if you also empower DRY or use a if check inside setPassword function.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year 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.