No slippage applied when Withdrawing collateral from the vault and dst != collateralToken
#31
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-10
🤖_primary
AI based primary recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-10-loopfi/blob/d219f0132005b00a68f505edc22b34f9a8b49766/src/proxy/PositionActionPendle.sol#L55-L84
Vulnerability details
Proof of Concept
Take a look at https://github.com/code-423n4/2024-10-loopfi/blob/d219f0132005b00a68f505edc22b34f9a8b49766/src/proxy/PositionActionPendle.sol#L55-L84
This function is used to withdraw collateral from the vault.
In the new scope there is a check to see if
dst != collateralToken
then a pool action param is then needed to withdraw the collateral from PENDLE, issue however is that when doing this we hardcode the slippage to0
, causing for loss of funds for users.Impact
Loss of funds for users when withdrawing from the vault and
dst != collateralToken
, consideringminOut
has been hardcoded to0
allowing even0
value to be given to them post their exit from Pendle.Recommended Mitigation Steps
Allow users pass in a slippage protected value and in the case where
dst != collateralToken
this value should be attached tominOut
:Assessed type
Context
The text was updated successfully, but these errors were encountered: