Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: low
Valid

The retrieveAdmin function does not work properly

Summary

The Laundrette:retrieveAdmin() function does not work properly.

Vulnerability Details

Only the executor role has permission to execute instructions. Therefore,external call to Kernel::executeAction() within retrieveAdmin() will revert.

function retrieveAdmin() external {
kernel.executeAction(Actions.ChangeAdmin, kernel.executor());
}

POC

function test_tryToRetrieveAdmin() public {
vm.prank(godFather);
vm.expectRevert();
laundrette.retrieveAdmin();
}

Place the PoC into test/Laundrette.t.sol.t.sol, and execute with

forge test --mt test_tryToRetrieveAdmin -vvvv

Impact

The retrieveAdmin function does not work properly

Tools Used

Manual review, Foundry

Recommendations

The Godfather directly calls executeAction instead of calling it within the Laundrette contract

kernel.executeAction(Actions.ChangeAdmin, godFather)
Updates

Lead Judging Commences

n0kto Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`retrieveAdmin` not working

Support

FAQs

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