Open c4-submissions opened 1 year ago
bytes032 marked the issue as primary issue
bytes032 marked the issue as insufficient quality report
jhsagd76 changed the severity to QA (Quality Assurance)
jhsagd76 marked the issue as grade-a
jhsagd76 marked the issue as selected for report
jhsagd76 marked the issue as not selected for report
Lines of code
https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Governor.sol#L73-L91 https://github.com/code-423n4/2023-10-badger/blob/f2f2e2cf9965a1020661d179af46cb49e993cb7e/packages/contracts/contracts/Governor.sol#L96-L115
Vulnerability details
Impact
According to comments, the contract can support up to 256 roles. But
Governor.getRolesForUser
andGovernor.getRolesFromByteMap
can only return 255 roles at mostProof of Concept
In Governor.getRolesForUser, in the for-loop, i is between between [0, 255), which makes 255 results at most
Similar code in Governor.getRolesFromByteMap
Tools Used
VIM
Recommended Mitigation Steps
Assessed type
Loop