sherlock-audit / 2023-12-dodo-gsp-judging

6 stars 5 forks source link

IceBear - initOwner() lack of access control #71

Closed sherlock-admin2 closed 9 months ago

sherlock-admin2 commented 9 months ago

IceBear

medium

initOwner() lack of access control

Summary

initOwner() lack of access control

Vulnerability Detail

The initOwner() lacks permission control. It only checks whether it has been initialized, there is a potential front-run vulnerability.

Impact

Malicious user can front run initOwner(), setting a new owner, and then calling claimOwnership().

Code Snippet

https://github.com/sherlock-audit/2023-12-dodo-gsp/blob/main/dodo-gassaving-pool/contracts/lib/InitializableOwnable.sol#L42

Tool used

Manual Review

Recommendation

add onlyOwner on initOwner()

Duplicate of #27