Closed code423n4 closed 1 year ago
array not likely to grow huge, so gas DoS is not a big issue:
for (uint k = 0; k < ticks.length - 2; k++)
ticks[ticks.length - 2 - k] = ticks[ticks.length - 3 - k];
}
QA might be more appropriate.
141345 marked the issue as primary issue
141345 marked the issue as low quality report
gzeon-c4 marked the issue as unsatisfactory: Overinflated severity
Lines of code
https://github.com/code-423n4/2023-08-goodentry/blob/4b785d455fff04629d8675f21ef1d1632749b252/contracts/GeVault.sol#L115-L132
Vulnerability details
Impact
GeVault.pushTick
andGeVault.shiftTick
functions both add an extra array item toticks
, there is nowhere in the code that reduces theticks
array.With low market cap tokens the ticks array could grow to a large enough number such that any calls to
GeVault.getActiveTickIndex
results in an out of gas revert which would causeGeVault.deployAssets
to revert. This function is called every block by therebalance
function renderiung the contract un-usableProof of Concept
https://github.com/code-423n4/2023-08-goodentry/blob/4b785d455fff04629d8675f21ef1d1632749b252/contracts/GeVault.sol#L115-L132
https://github.com/code-423n4/2023-08-goodentry/blob/4b785d455fff04629d8675f21ef1d1632749b252/contracts/GeVault.sol#L137-L161
https://github.com/code-423n4/2023-08-goodentry/blob/4b785d455fff04629d8675f21ef1d1632749b252/contracts/GeVault.sol#L297-L307
Tools Used
Manual Review
Recommended Mitigation Steps
Reduce the size of the array when possible, ie. when a tick does not contain any liquidity.
Assessed type
DoS