withdrawAllAndUnwrap() the clpToken transfer to AMO.sol may be locked in the contract #6
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
M-09
primary issue
Highest quality submission among a set of duplicates
selected for report
This submission will be included/highlighted in the audit report
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2023-05-xeth/blob/d86fe0a9959c2b43c62716240d981ae95224e49e/src/CVXStaker.sol#L177
Vulnerability details
Impact
in
withdrawAllAndUnwrap()
the clpToken transfer to AMO.sol may be locked in the contract
Proof of Concept
withdrawAllAndUnwrap()
You can specifysendToOperator==true
to transfer theclpToken
tooperator
The code is as follows:
current protocols,
operator
is currently set toAMO.sol
as normalBut
AMO.sol
doesn't have any way to use the transferredclpToken
The reason is that in AMO.sol, the method that transfers the
clpToken
, the number of transfers is from the newly generatedclpToken
fromcurvePool
It doesn't include
clpToken
that already exists inAMO.sol
contract, for example (rebalanceDown/addLiquidity/addLiquidityOnlyStETH)example
rebalanceDown
:So the
clpToken
transferred to 'AMO.sol' bywithdrawAllAndUnwrap()
will stays in the AMO contract and it is be locked.Tools Used
Recommended Mitigation Steps
modify
withdrawAllAndUnwrap()
, directly transfer tomsg.sender
.Assessed type
Context
The text was updated successfully, but these errors were encountered: