code-423n4 / 2021-05-88mph-findings

0 stars 0 forks source link

Unchecking the ownership of `mph` in function `distributeFundingRewards` could cause several critical functions to revert #23

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

shw

Vulnerability details

Impact

In contract MPHMinter, the function distributeFundingRewards does not check whether the contract itself is the owner of mph. If the contract is not the owner of mph, mph.ownerMint could revert, causing functions such as withdraw, rolloverDeposit, payInterestToFunders in the contract DInterest to revert as well.

Proof of Concept

Referenced code: MPHMinter.sol#L121 DInterest.sol#L1253 DInterest.sol#L1420

Tools Used

None

Recommended Mitigation Steps

Add a mph.owner() != address(this) check as in the other functions (e.g., mintVested).

ZeframLou commented 3 years ago

Fixed in https://github.com/88mphapp/88mph-contracts/commit/026dde3d30bddedbc1eeca6c87bce4bc5b5c7ee5