After the vault expires, users may still receive rewards through the StakingRewards contract
After a vault epoch ends, its tokens become worthless, but the associated StakingRewards contract may still allow staking those tokens to earn rewards. An attacker could stake expired tokens and receive rewards intended for future valid epochs.
Submitted by cccz
When the triggerEndEpoch function of the Controller contract is called, the assets in the insrVault will be sent to the riskVault, which also means that the tokens in the insrVault will be worthless.
insrVault.setClaimTVL(epochEnd, 0);
...
else {
entitledAmount = amount.divWadDown(idFinalTVL[id]).mulDivDown(
idClaimTVL[id],
1 ether
);
}
However, if the periodFinish > _epochEnd in the StakingRewards contract corresponding to the insrVault, the user can continue to stake his insrToken and receive rewards.
Proof of Concept
Recommended Mitigation Steps
Add the following code at the end of the notifyRewardAmount function of the StakingRewards contract to limit the periodFinish
lastUpdateTime = block.timestamp;
periodFinish = block.timestamp.add(rewardsDuration);
+ require(periodFinish <= id);
MiguelBits (Y2K Finance) disputed
Agree with issue; I view this as protocol leaked value (rewards) because it enables expired vault tokens that have no / little worth to “steal” rewards from future valid epochs. 1 time mint, lifetime rewards doesn’t seem right.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could stake expired, worthless tokens to earn rewards meant for future valid epochs, leaking value from the protocol.
What the attacker needed
Expired vault tokens; staking rewards contract active
The fix
The StakingRewards contract should be modified to ensure that the reward period finish time does not exceed the vault epoch end time.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A vault is a place where users lock tokens for a period. When the period ends, the tokens are supposed to be worthless. But a separate rewards contract still lets people stake those worthless tokens and earn rewards. This means someone could get rewards without having done anything useful.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.