Open code423n4 opened 1 year ago
thereksfour marked the issue as primary issue
pmckelvy1 marked the issue as sponsor confirmed
pmckelvy1 marked the issue as sponsor acknowledged
thereksfour marked the issue as satisfactory
thereksfour marked the issue as selected for report
Lines of code
https://github.com/reserve-protocol/protocol/blob/e3d2681503499e81915797c77eeef8210352a138/contracts/plugins/assets/convex/vendor/ConvexStakingWrapper.sol#L296
Vulnerability details
Impact
After shutdown, checkpoints are stopped, leading to possible theft of rewards.
Proof of Concept
ConvexStakingWrapper
No morecheckpoints
aftershutdown
, i.e. no updatesreward.reward_integral_for[user]
This would result in, after
shutdown
, being able to stealrewards
by transferringtokens
to new usersExample: Suppose the current reward.reward_integral = 1000
When a
shutdown
occursalice transfers 100 to the new user, bob. Since bob is the new user and
_beforeTokenTransfer()->_checkpoint()
is not actually executed Result. balanceOf[bob] = 100 reward.reward_integral_for[bob] = 0bob executes
claimRewards()
to steal the reward reward amount = balanceOf[bob] (reward.reward_integral - reward.reward_integral_for[bob]) = 100 (1000-0)bob transfers the balance to other new users, looping steps 1-2 and stealing all rewards
Tools Used
Recommended Mitigation Steps
Still execute _checkpoint
Assessed type
Context