Platform: Code4rena
Start Date: 04/03/2024
Pot Size: $88,500 USDC
Total HM: 31
Participants: 105
Period: 11 days
Judge: ronnyx2017
Total Solo HM: 7
Id: 342
League: ETH
Rank: 93/105
Findings: 1
Award: $17.32
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: 0xjuan
Also found by: 0rpse, 0x175, 0xAlix2, 0xBugSlayer, 0xloscar01, Ali-_-Y, Arz, CaeraDenoir, JohnSmith, Ocean_Sky, SpicyMeatball, alix40, ayden, falconhoof, givn, iamandreiski, kinda_very_good, nmirchev8, nnez, novamanbg, stackachu, wangxx2026
17.3162 USDC - $17.32
https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L397-L402 https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L427-L474 https://github.com/code-423n4/2024-03-revert-lend/blob/main/src/V3Vault.sol#L1075-L1085
User can create a position that can't be liquidated by assigning the position NFT ownership to a maliciously created contract
Attack flow:
onERC721Received()
function, which will always return value that reverts the ERC721::safeTransfer()/safeTransferFrom()
functions.V3Vault::create(uint256 tokenId, address recipient)
function and as input for the recipient
address, puts the contract he created, which makes this contract the owner of the position NFT in the V3Valut
contract logic.borrow()
function through the malicious contractV3Vault::liquidate()
function is called_cleanupLoan()
function is called. It sends the position NFT to the owner of the position, which in the V3Vault
contract logic is the malicious contract with implemented onERC721Received()
that will always return value that makes the ERC721::safeTransferFrom()
function revert, which means that the V3Vlaut::liquidate()
function reverts as well.All of this means that the position can never be liquidated. This attack can be easily performed by any user, which makes its severity not high but critical!
Manual review.
This can be fixed by changing the ERC721::safeTransferFrom()
with ERC721::transferFrom()
function.
DoS
#0 - c4-pre-sort
2024-03-18T18:41:17Z
0xEVom marked the issue as sufficient quality report
#1 - c4-pre-sort
2024-03-18T18:41:50Z
0xEVom marked the issue as duplicate of #54
#2 - c4-judge
2024-03-31T16:08:45Z
jhsagd76 marked the issue as satisfactory