Open c4-bot-6 opened 11 months ago
0xleastwood marked the issue as primary issue
Duplicate #53
This is an interesting discovery. Our original thinking was after reclaim
, LP can withdraw liquidity in one tx via multicall. But the problem here is that the already borrowed liquidity can be extended indefinitely. We should probably just restrict new positions to be opened if reclaim
is called. And the suggested change is also valid. Thanks!
0xleastwood marked the issue as selected for report
wukong-particle (sponsor) confirmed
Lines of code
https://github.com/code-423n4/2023-12-particle/blob/a3af40839b24aa13f5764d4f84933dbfa8bc8134/contracts/protocol/ParticlePositionManager.sol#L135
Vulnerability details
Vulnerability details
If
LP
wants to retrieve theLiquidity
that has been lent out, it can set arenewalCutoffTime
throughreclaimLiquidity()
. If theborrower
does not voluntarily close,liquidatePosition()
can be used to forcibly close theposition
after the loan expires.To forcibly close the
position
, we still need to wait for the expirationblock.timestamp > lien.startTime + LOAN_TERM
.But currently,
openPosition()
is not restricted byrenewalCutoffTime
, as long as there isLiquidity
, we can open a position.In this way, malicious borrowers can continuously occupy
Liquidity
by closing and reopening before expiration. For example:open position
, LOAN_TERM = 7 daysreclaimLiquidity()
to retrieveLiquidity
closePosition()
->openPosition()
lien.startTime = block.timestamp
7 days
The borrower may need to pay a certain
fee
whenopenPosition()
. If the benefits can be expected, it is very cost-effective.Impact
Malicious borrowers can force LPs to be unable to retrieve Liquidity by closing and reopening the Position before it expires.
Recommended Mitigation
It is recommended that when
openPosition()
, if the current time is less thanrenewalCutoffTime + LOAN_TERM + 1 days
, do not allow newpositions
to be opened, givingLP
a time window for retrieval.Or set a new flag
TOKEN_CLOSE = true
to allowlp
to specify that Liquidity will no longer be lent out.Assessed type
Other