Open sherlock-admin2 opened 9 months ago
1 comment(s) were left on this issue during the judging contest.
takarez commented:
invalid
The protocol team fixed this issue in PR/commit https://github.com/arcadia-finance/lending-v2/pull/133.
Fix consists out of two PR's:
Fix looks good. Removes the updateActionTimestampByCreditor call and instead uses a callback to enforce nonreentrant and prevent ERC777s from reentering
The Lead Senior Watson signed off on the fix.
0x52
medium
LendingPool#flashAction
is broken when trying to refinance position acrossLendingPools
due to improper access controlSummary
When refinancing an account,
LendingPool#flashAction
is used to facilitate the transfer. However due to access restrictions onupdateActionTimestampByCreditor
, the call made from the new creditor will revert, blocking any account transfers. This completely breaks refinancing across lenders which is a core functionality of the protocol.Vulnerability Detail
LendingPool.sol#L564-L579
We see above that
account#updateActionTimestampByCreditor
is called beforeflashActionByCreditor
.AccountV1.sol#L671
When we look at this function, it can only be called by the current creditor. When refinancing a position, this function is actually called by the pending creditor since the
flashaction
should originate from there. This will cause the call to revert, making it impossible to refinance acrosslendingPools
.Impact
Refinancing is impossible
Code Snippet
LendingPool.sol#L529-L586
Tool used
Manual Review
Recommendation
Account#updateActionTimestampByCreditor()
should be callable by BOTH the current and pending creditor