Open howlbot-integration[bot] opened 6 months ago
gzeoneth (sponsor) disputed
Expected behavior. https://github.com/code-423n4/2024-05-arbitrum-foundation/blob/6f861c85b281a29f04daacfe17a2099d7dad5f8f/src/rollup/BOLDUpgradeAction.sol#L345-L346
// since we for-loop these stakers we set an arbitrary limit - we dont
// expect any instances to have close to this number of stakers
This is the expected behavior so this report falls within misconfiguration issues
Picodes changed the severity to QA (Quality Assurance)
This previously downgraded issue has been upgraded by Picodes
Picodes changed the severity to QA (Quality Assurance)
Picodes marked the issue as grade-b
Lines of code
https://github.com/code-423n4/2024-05-arbitrum-foundation/blob/6f861c85b281a29f04daacfe17a2099d7dad5f8f/src/rollup/BOLDUpgradeAction.sol#L347-L349
Vulnerability details
Impact
The
StakerCount
variable take hold of the count of stakers in an instance, The Natspec comfirms that thestakerCount
is not expected to be > 50, but this is not implemented in the code and there didn't seem to be restriction for that. This means there is a chance of the count to be more than 50.The stakeCount is a list of stakers that stake in an instance and is of
RollUpCore.sol
func.What can go wrong here? well, during the cleanupOldRollup function call, the
stakerCount
has been set to 50 if its > 50, remember, this is just for the loop not to be arbitrary and lead toout-Of gas
issue or something unexpected.The problem here is that the count has now been lost to only 50 whenever there's > 50
stakerCount
, this is problematic as the number has been lost forever and this also means that some staker will be missed out when a call is made tocleanupOldRollup()
function, potentially leaving them behind without being touchedProof of Concept
Tools Used
Manual Review
Recommended Mitigation Steps
I recommend putting the restriction in place to make sure there's not more than 50 stakers in an instance, this will ensure that no
staker
is left behind during the function call.The createNewStake function should be adjusted to something like:
This adjustment will ensure the stakers to be included in the
cleanupOldRollup()
function call without leaving any behind.Assessed type
Loop