Improper Upper Bound Definition on the Fee
The contract's emission rate parameter lacks upper and lower bounds, so an owner could set an excessively large value. This would cause reversions in critical functions that rely on the rate.
Submitted by Jujic
The rJoePerSec does not have any upper or lower bounds. Values that are too large will lead to reversions in several critical functions.
Proof of Concept
function updateEmissionRate(uint256 _rJoePerSec) external onlyOwner {
updatePool();
rJoePerSec = _rJoePerSec;
emit UpdateEmissionRate(msg.sender, _rJoePerSec);
}
Tools Used
Remix
Recommended Mitigation Steps
Consider define upper and lower bounds on the _rJoePerSec.
cryptofish7 (Trader Joe) confirmed, but disagreed with severity and commented:
Confirming issue but disagree with severity.
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 setter function for the emission rate lacks validation to ensure the value falls within a safe range, allowing an excessively large number that causes arithmetic overflows or other failures downstream.
Impact
An excessively large emission rate could cause critical functions to revert, potentially disrupting staking or reward distribution, though only the owner can set the value.
What the attacker needed
Owner privileges
The fix
The issue was fixed by adding bounds to the emission rate parameter, as indicated by the linked pull request.
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 has a setting for how many reward tokens are given out per second. The person who controls this setting can put in any number, even one so huge that the maths in other parts of the contract breaks and those functions stop working. The report says this should be limited to a sensible range.
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.