This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
0x52 - Creditor can maliciously burn UniV3 position to permanently lock funds #78
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
High
A valid High severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
0x52
high
Creditor can maliciously burn UniV3 position to permanently lock funds
Summary
LP NFT's are always controlled by the lender. Since they maintain control, malicious lenders have the ability to burn their NFT. Once a specific tokenID is burned the ownerOf(tokenID) call will always revert. This is problematic as all methodologies to repay (even emergency) require querying the ownerOf() every single token. Since this call would revert for the burned token, the position would be permanently locked.
Vulnerability Detail
NonfungiblePositionManager
When querying a nonexistent token, ownerOf will revert. Now assuming the NFT is burnt we can see how every method for repayment is now lost.
LiquidityManager.sol#L306-L308
If the user is being liquidated or repaying themselves the above lines are called for each loan. This causes all calls of this nature to revert.
LiquidityBorrowingManager.sol#L727-L732
The only other option to recover funds would be for each of the other lenders to call for an emergency withdrawal. The problem is that this pathway will also always revert. It cycles through each loan causing it to query ownerOf() for each token. As we know this reverts. The final result is that once this happens, there is no way possible to close the position.
Impact
Creditor can maliciously lock all funds
Code Snippet
LiquidityBorrowingManager.sol#L532-L674
Tool used
Manual Review
Recommendation
I would recommend storing each initial creditor when a loan is opened. Add try-catch blocks to each
ownerOf()
call. If the call reverts then use the initial creditor, otherwise use the current owner.The text was updated successfully, but these errors were encountered: