Open c4-bot-1 opened 2 months ago
Thank you for your submission.
Although there is a certain safe way to kill a gauge, etc., the described case is possible if the gauge is killed in the middle of an epoch for some reason, and as a result, the veNFT cannot be unhooked from the strategy for some time.
I am not sure that the recommended mitigation is optimal. Redistribution of votes between live pools decision is also not ideal
Thank you for participation
alcueca marked the issue as satisfactory
alcueca marked the issue as selected for report
Lines of code
https://github.com/code-423n4/2024-09-fenix-finance/blob/main/contracts/core/VoterUpgradeableV2.sol#L564
Vulnerability details
Impact
Users' veNFT might be temporarily undetachable, preventing users from performing action on their own veNFT.
Proof-of-Concept
When users invoke
dettachFromManagedNFT
to get their veNFT back from ManagedNFT,_poke
is called at the end of the function to update voting power across gauges voted by this ManagedNFT._poke
loads a list of pools and weights voted by ManagedNFT then recast votes again to the same set of pools and weights via calling into_vote
.However,
_vote
reverts when one of the pool/gauge has already been killed.Now consider this situation:
_poke
will attempt to recast the vote on gaugeB.As a result, users' veNFT might be temporarily undetachable when the described scenario happens.
Recommended Mitigations
Users are expected to only include active pools in normal
vote
flow.If one of the pool is inactive, we can safely set its weight to zero and skip over it (gracefully ignore it).
Assessed type
DoS