Light ModeLight
Light ModeDark

One Bug Per Day

One H/M every day from top Wardens

Checkmark

Join over 1110 wardens!

Checkmark

Receive the email at any hour!

Ad

Position can be opened even when the particle position manger does not hold the Uniswap V3 Position NFT

mediumCode4rena

Lines of code

https://github.com/code-423n4/2023-12-particle/blob/a3af40839b24aa13f5764d4f84933dbfa8bc8134/contracts/protocol/ParticlePositionManager.sol#L151

Vulnerability details

Impact

Position can be opened even when the position manger does not hold the Uniswap V3 Position NFT

Proof of Concept

As long as user approve the PositionManager for as a operator of their NFT position

even the particle position manager does not hold the Uniswap V3 NFT

anyone can open the position on behalf of the original NFT owner

the original owner may incapable of calling reclaimLiquidity and the borrower just open the position to reduce the original liquidity, as long as he maintain sufficient premium, he will never be liquidated

or even the original own is capable of calling reclaim liquidity, the borrower still capable of leverage trading for LOAN_TERM length while forcefully reduce the liquidity of original nft

this is because when open the position, the code does not check if the particile position manager hold the Uniswap V3 NFT

the external call to decrease liquidity and collect the token is subject to the check

https://etherscan.io/address/0xc36442b4a4522e871399cd717abdd847ab11fe88#code#F1#L184

solidity
modifier isAuthorizedForToken(uint256 tokenId) { require(_isApprovedOrOwner(msg.sender, tokenId), 'Not approved'); _; }

while user approve ParticlePositionManager is not a normal flow

user approve particlePositionManager does not signal user wants to borrow the fund

only when user transfer the NFT into the ParticlePositionManager, borrower can borrow with lender's implicit permision

Tools Used

Manunal Review

Recommended Mitigation Steps

recommendation validting the particle position mange hold the position nft when position is opened

Assessed type

Invalid Validation