PositionActionPendle exits pendle without slippage protection #32
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
duplicate-10
🤖_41_group
AI based duplicate group 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#L64-L74
Vulnerability details
Proof of Concept
PositionActionPendle exits pendle without slippage protection which will leave functions dependent on the
_onWithdraw
hook vulnerable to sandwich attacks.The hardcoded
PoolActionParams
in_onWithdraw
hardcodes the minimum amount out to 0, meaning any amount received from pendle interaction is accepted without any issues.These params are passed on to
exit
in PoolAction.solWhich is the called when redeeming while exiting pendle.
Since the contracts are deployed on Ethereum, which is notorious for MEV bots and frontrunning, malicious users can monitor transactions that rely on
_onWithdraw
hook to gain unfair advantages and disrupt protocol operations for their own benefit.Recommended Mitigation Steps
Recommend allowing the
minOut
to be specified, or hardcoding a more conventional amount, e.g 95% or using a setter function that allows the owner set the value.Assessed type
MEV
The text was updated successfully, but these errors were encountered: