Moonwell

Moonwell
DeFiFoundry
15,000 USDC
View results
Submission Details
Severity: low
Invalid

`getCashPrior` can be manipulated

Summary

MErc20DelegateFixer::getCashPrior is used to determine the cash available for the market. However, it is susceptible to a Donation Attack where a user can manipulate the available cash by donating a large sum of underlying token directly to the contract. The function would return a higher available cash amount than is available and when used for calculating any rates, it can lead to issues such as inflation.

Vulnerability Details

MErc20DelegateFixer::getCashPrior #L131-135

function getCashPrior() internal view returns (uint256) {
return EIP20Interface(underlying).balanceOf(address(this)) + badDebt;
}

Impact

Potentially inflated rates and loss of funds.

Tools Used

Manual Review.

Recommendations

Avoid using balanceOf and instead rely on internal counting.

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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