You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Morpho allows onBehalf repayment which can be weaponized to dos full repayment
Summary
Malicious users can frontrun calls to fully delever through deleverToZeroBorrowBalance by repaying dust amounts on behalf of the settoken to continously grief the repayment process.
Root Cause
deleverToZeroBorrowBalance calls the _repayBorrow function which invokes repay in Morpho.
Morpho's repay function is public, allowing users to repay on behalf of anyone, without any limit on how little the amount can be. From the implementation we can see that anyone could repay any other user's debt(or part of it). So when the manager tries to repay the full amount a malicious user could just front-run the transaction and repay 1 wei on behalf of the connector address, thus reverting the transaction due to underflow.
Check the shares owned and if they are less than the amount passed to repay, repay just the shares owned
The text was updated successfully, but these errors were encountered:
sherlock-admin2
changed the title
Brisk Cherry Aphid - Morpho allows onBehalf repayment which can be weaponized to dos full repayment
ZanyBonzy - Morpho allows onBehalf repayment which can be weaponized to dos full repayment
Oct 28, 2024
ZanyBonzy
Medium
Morpho allows
onBehalf
repayment which can be weaponized to dos full repaymentSummary
Malicious users can frontrun calls to fully delever through
deleverToZeroBorrowBalance
by repaying dust amounts on behalf of the settoken to continously grief the repayment process.Root Cause
deleverToZeroBorrowBalance
calls the_repayBorrow
function which invokes repay in Morpho.https://github.com/sherlock-audit/2024-10-morpho-x-index/blob/2f125406e0dd3b1fc029b9a47fe97bfbf906fce2/index-protocol/contracts/protocol/modules/v1/MorphoLeverageModule.sol#L733C1-L759C6
https://github.com/morpho-org/morpho-blue/blob/d60e123cd7e0bb1b39df7369847717237a7751cd/src/Morpho.sol#L286s
Morpho's repay function is public, allowing users to repay on behalf of anyone, without any limit on how little the amount can be. From the implementation we can see that anyone could repay any other user's debt(or part of it). So when the manager tries to repay the full amount a malicious user could just front-run the transaction and repay 1 wei on behalf of the connector address, thus reverting the transaction due to underflow.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
Full repayment DOS due to frontrun.
PoC
No response
Mitigation
Check the shares owned and if they are less than the amount passed to repay, repay just the shares owned
The text was updated successfully, but these errors were encountered: