Closed code423n4 closed 1 year ago
The submission does not provide any demonstration of the issue, reasoning and specific code blocks.
0xSorryNotSorry marked the issue as low quality report
alcueca marked the issue as unsatisfactory: Insufficient proof
Lines of code
https://github.com/code-423n4/2023-07-moonwell/blob/fced18035107a345c31c9a9497d0da09105df4df/src/core/MToken.sol#L942-L943
Vulnerability details
addToMarketInternal
ensure that borrowers are added to the necessary markets so that their assets can be included in liquidity calculations. Without verifying theaccountAsset
mapping against the borrower to ensure the correctmToken
market is being targeted for liquidation, it may result in an improper liquidation.Impact
The liquidation process lacks proper validation to check for the specific
mToken
market being liquidated during the liquidation process. This allows an attacker to intentionally liquidate a different market, potentially causing unintended consequences, financial losses, or disruption of the protocol.This can have several potential impacts:
Proof of Concept
An attacker can intentionally liquidate a different
mToken
market than the one associated with the borrower's account. By doing this, they can potentially manipulate the liquidation process and cause unintended consequences, such as stealing collateral or disrupting the stability of the protocol.borrower
account with an open loan in the protocol.mToken
market.Tools Used
Manual Review
Recommended Mitigation Steps
Should be updated as follows:
mToken
market associated with the borrower's account.accountAsset
mapping to prevent unauthorized associations, ensuring each account is correctly mapped to its respectivemToken
market.Add a check in the
liquidateBorrowFresh
add a require statement that checks whether the borrower's
accountAssets
mapping contains themTokenCollateral
address. If the check fails, indicating an invalidmToken
market, the function will revert and stop the liquidation process.}
Assessed type
Invalid Validation