In VoterProxy the address veAsset is not added to protectedTokens[] list so it's possible to call withdraw() with veAsset address by stash protocol and withdraw veAsset Balance of VoterProxy #255
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
invalid
This doesn't seem right
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Lines of code
https://github.com/code-423n4/2022-05-vetoken/blob/2d7cd1f6780a9bcc8387dea8fecfbd758462c152/contracts/VoterProxy.sol#L108-L121
Vulnerability details
Impact
Stash
contract can withdraw extra incentive reward tokens out ofVoterProxy
contract. andStash
callswithdraw
function ofVoterProxy
for extrareward
tokens of gauges. butveAsset
was ingauges
reward tokens thenStash
will callwithdraw()
withveAsset
address and it will withdrawveAsset
balance ofVoterProxy
which can make other logics wrong and funds would be wrongly distributes. becauseveAsset
is used for other things inVoterProxy
Proof of Concept
This is
withdraw()
function code inVoterProxy
:As you can see it's only callable by
Stash
contract and ifprotectedTokens[address(_asset)] == true
then code don't do anything. for anylpToken
andgauge
address contract setsprotectedTokens[address(_asset)] = true
so if they were in extraReward address, contract don't withdraw them because they are used in stacking and other logics. but contract don't setveAsset
asprotectedToken
so it's possible thatStash
callwithdraw()
withveAsset
address and withdrawVoterProxy
'sveAsset
balance which can cause fund lose becauseveAsset
token has been used to stake inVoterEscrow
and also other rewarding logics ifStash
withdrawveAsset
balance ofVoterProxy
those logics will be broken and funds would distributes wrongly.Tools Used
VIM
Recommended Mitigation Steps
add
veAsset
token address toprotectedTokens
too.The text was updated successfully, but these errors were encountered: