getInflationAmt()
IS SUSCEPTIBLE TO DOS WITH BLOCK GAS LIMIT
#634
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-302
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/RewardsPool.sol#L74
Vulnerability details
getInflationAmt()
is a public function and it contains the following code:It is an unbounded loop, depending on the inflation intervals
If
inflationIntervalsElapsed
is big enough, the block gas limit may be hit.Proof of Concept
https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/RewardsPool.sol#L74
Recommended Mitigation Steps
Limit the max number of loop iterations to prevent hitting the block gas limit.
Reference:
https://consensys.github.io/smart-contract-best-practices/attacks/denial-of-service/#dos-with-block-gas-limit
The text was updated successfully, but these errors were encountered: