Internal reward tokens can and likely will over commit rewards
Internal reward tokens accrue indefinitely without an end timestamp or a check that the contract holds enough tokens to cover the committed rewards. This can cause the contract to over-commit rewards, and once the token balance is exhausted, all further claims will fail.
Source: https://github.com/sherlock-audit/2023-02-olympus-judging/issues/128
Found by
tives, Bahurum, 0xlmanini, minhtrng, 0x52
Summary
Internal reward tokens accrue indefinitely with no way to change the amount that they accrue each block (besides removing them which has other issues) or input a timestamp that they stop accruing. Additionally there is no check that the contract has enough tokens to fund the rewards that it has committed to. As a result of this the contract may over commit reward tokens and after the token balance of the contract has been exhausted, all further claims will fail.
Vulnerability Detail
Internal reward tokens are added with a fixed _rewardPerSecond that will accrue indefinitely because it does not have an ending timestamp. As a result the contract won't stop accruing internal rewards even if it has already designated it's entire token balance. After it has over committed it will now be impossible for all users to claim their balance. Additionally claiming rewards is an all or nothing function meaning that once a single reward token starts reverting, it becomes impossible to claim any rewards at all.
Impact
Internal reward tokens can over commit and break claiming of all reward tokens
Code Snippet
Tool used
ChatGPT
Recommendation
I recommend adding an end timestamp to the accrual of internal tokens. Additionally, the amount of tokens needed to fund the internal tokens should be transferred from the caller (or otherwise tracked) when the token is added.
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 the reward accrual mechanism lacks an end timestamp and does not verify or reserve sufficient token balance when internal reward tokens are added.
Impact
Internal reward tokens can over-commit and break claiming of all reward tokens, causing all further claims to fail once the balance is exhausted.
What the attacker needed
Internal reward tokens added; no end timestamp set; insufficient token balance
The fix
The recommendation is to add an end timestamp to the accrual of internal tokens and to transfer or track the amount of tokens needed to fund the internal tokens when the token is added.
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 promised to pay out reward tokens at a fixed rate forever, but it never checked whether it actually had enough tokens to keep those promises. When the tokens ran out, everyone's claims started failing, and because claims are all-or-nothing, no one could get any reward at all.
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.