Vault rewards last claim time not always initialized
The reward calculation uses an uninitialised last-claim timestamp for synths the user never deposited, so the elapsed time becomes the entire block timestamp. An attacker could claim a huge amount of rewards by harvesting a synth they never deposited.
Vader Protocol contest
Originally disclosed on Code4rena
The harvest calls calcCurrentReward which computes _secondsSinceClaim = block.timestamp - mapMemberSynth_lastTime[member][synth];. As one can claim different synths than the synths that they deposited, mapMemberSynth_lastTime[member][synth] might still be uninitialized and the _secondsSinceClaim becomes the current block timestamp.
The larger the _secondsSinceClaim the larger the rewards. This bug allows claiming a huge chunk of the rewards.
Recommend letting users only harvest synths that they deposited.
strictly-scarce (vader) confirmed:
This is valid.
The member should only claim against synths they have deposited, where the time would be initialised.
strictly-scarce (vader) commented:
Would place this as severity: 2, since the anyone can participate in claiming rewards, but no extra inflation occurs.
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
The contract does not initialise the last-claim timestamp for synths a user has not deposited, and it allows harvesting any synth.
Impact
An attacker could claim a huge chunk of the rewards, though the project noted no extra inflation occurs.
What the attacker needed
None
The fix
The contract should only let users harvest synths they have deposited, so the timestamp is initialised.
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 tracks when each user last claimed rewards for each asset (synth). If a user claims for an asset they never deposited, that timestamp is zero, so the contract thinks they have been waiting since the beginning of time and gives them a huge reward. The fix is to only allow claiming for assets the user actually deposited.
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.