Closed code423n4 closed 1 year ago
GalloDaSballo marked the issue as duplicate of #796
GalloDaSballo marked the issue as duplicate of #478
In contrast to the original dups of 478 these dups are not as accurate, awarding half
GalloDaSballo marked the issue as partial-50
Lines of code
https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/tokens/TokenggAVAX.sol#L88-L109
Vulnerability details
Impact
In the current rewards accounting, vault shares in deposit() and redeem() can not correctly record the spot yields generated by the staked asset. Yields are released over the next rewards cycle. As a result, malicious users can steal yields from innocent users by picking special timing to deposit() and redeem().
Proof of Concept
https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/tokens/TokenggAVAX.sol#L88-L109
Tools Used
Recommended Mitigation Steps
for the lastRewardsAmt_ not released, allow the users to redeem as it is linearly released later. for the accumulated yields, only allow users to redeem the yields received after 1 rewards cycle after the deposit.