Skip to content
Business logic Audit finding Intermediate

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.

EV_om Follow

Originally disclosed on Code4rena

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

  1. An attacker calls the claimStakingIncentives() function with the retainer address as the staking target.
  2. The function calculates the staking incentives for the retainer address.
  3. Instead of returning the incentives to the staking inflation, the incentives are sent to the retainer address.
  4. 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

kupermind (Olas) confirmed

Olas mitigated

Varun_05 (warden) commented:

Fixed.


The original report as published on Code4rena, by EV_om. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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

  1. An attacker calls the claimStakingIncentives() function with the retainer address as the staking target.
  2. The function calculates the staking incentives for the retainer address.
  3. Instead of returning the incentives to the staking inflation, the incentives are sent to the retainer address.
  4. 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.

More by EV_om

View all

23 more disclosed reports, best first.

More from Olas

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.