code-423n4 / 2023-05-maia-findings

20 stars 12 forks source link

Reward clarinets can claim rewards multiple times #909

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

Lines of code

https://github.com/code-423n4/2023-05-maia/blob/cfed0dfa3bebdac0993b1b42239b4944eb0b196c/src/rewards/rewards/FlywheelGaugeRewards.sol#L234

Vulnerability details

Impact

Reward claimers can call the get accrued reward function multiple times and maybe even drain the contract

Proof of Concept

As we can see there’s no check setting the accrued reward to zero after the rewards have been transferred

Tools Used

Manual review

Recommended Mitigation Steps

Add a setter than sets the reward to zero after the function has been called

Assessed type

Reentrancy

c4-judge commented 1 year ago

trust1995 marked the issue as unsatisfactory: Invalid