Unauthorized claiming of staking incentives for retainer
The Dispenser contract allows anyone to call claimStakingIncentives() with the retainer address as the target, sending staking incentives to the retainer instead of returning them to staking inflation. This diverts funds that should have been returned, causing a loss of staking incentives.
Submitted by EV_om
The Dispenser contract is responsible for distributing staking incentives to various targets. One of the functionalities provided by the contract is the ability to claim staking incentives for a specific staking target using the claimStakingIncentives() function. This function calculates the staking incentives for a given target and distributes them accordingly.
The retain() function, on the other hand, is designed to retain staking incentives for the retainer address and return them back to the staking inflation.
However, there is no check to ensure users cannot call the claimStakingIncentives() function for the retainer address and send the staking incentives to the retainer instead of returning them to the staking inflation.
This means anyone can divert the retainer rewards, which are meant to be sent back to the staking inflation, to the retainer itself. In that scenario, there is no way to return the funds to the staking incentive.
Impact
Loss of staking incentives that should have been returned to the staking inflation.
Proof of Concept
- An attacker calls the
claimStakingIncentives()function with the retainer address as the staking target. - The function calculates the staking incentives for the retainer address.
- Instead of returning the incentives to the staking inflation, the incentives are sent to the retainer address.
- The attacker successfully redirects the staking incentives to the retainer, bypassing the intended logic of the
retain()function.
Recommended Mitigation Steps
Restrict the claimStakingIncentives() function to prevent the claiming of rewards for the retainer address.
Assessed type
Invalid Validation
Fixed.
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
Root cause
Likely missing validation in claimStakingIncentives() to prevent using the retainer address as the staking target.
Impact
Loss of staking incentives that should have been returned to the staking inflation.
What the attacker needed
None
The fix
The claimStakingIncentives() function should be restricted to prevent claiming rewards for the retainer address; the report notes it was mitigated.
How it was found
- An attacker calls the claimStakingIncentives() function with the retainer address as the staking target.
- The function calculates the staking incentives for the retainer address.
- Instead of returning the incentives to the staking inflation, the incentives are sent to the retainer address.
- The attacker successfully redirects the staking incentives to the retainer, bypassing the intended logic of the retain() function.
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 smart contract lets people claim rewards for staking. Normally, rewards for a special 'retainer' address are supposed to be sent back to the staking pool. But the contract doesn't stop anyone from claiming those rewards directly for the retainer, so the money goes to the retainer instead of back to the pool. This means the staking pool loses funds it should have kept.
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.