Closed code423n4 closed 1 year ago
The function calls _scheduleUpdate()
internally and it calls getScheduleUpdateInnerData()
.
getScheduleUpdateInnerData()
calls SecurityCouncilMemberSyncAction.perform()
,
and perform()
updates the members of security council multisig to match provided array.
Invalid assumption.
0xSorryNotSorry marked the issue as low quality report
The addMember method doesn't revert when the cohort.length == cohortSize is false, it reverts when it's true; invalid report.
DZGoldman marked the issue as sponsor disputed
0xean marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/arbitrumfoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/SecurityCouncilManager.sol#L166-L167 https://github.com/arbitrumfoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/SecurityCouncilManager.sol#L176-L180
Vulnerability details
Impact
The
SecurityCouncilManager._removeMemberFromCohortArray
function is used to remove amember
from a specificcohort
. The function will replace the removing member with the last element of thecohort
array and willpop
the last element of the array as shown below:The issue here is, once the last element of the
cohort
array is removed thearray.length
will be reduced by one.This will
DoS
theSecurityCouncilManager.addMember
function since the(cohort.length == cohortSize)
condition will be false and the transaction will revert inside theSecurityCouncilManager._addMemberToCohortArray
function.This will further
DoS
theSecurityCouncilManager.replaceMember
function as well. ThereplaceMember
function calls the_swapMembers
internal function. The_swapMembers
function first calls the_removeMemberFromCohortArray
function which removes_addressToRemove
element from thecohort
array. This will reduce the length of thecohort
array by one.Next it calls the
_addMemberToCohortArray
function to add the_addressToAdd
member. But inside the_addMemberToCohortArray
function there is the length equality check (cohort.length == cohortSize
) which will revert since thecohort.length
is one less after the removal of themember
.Proof of Concept
https://github.com/arbitrumfoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/SecurityCouncilManager.sol#L166-L167
https://github.com/arbitrumfoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/SecurityCouncilManager.sol#L176-L180
Tools Used
Manual Review and VSCode
Recommended Mitigation Steps
Since the
cohort.length
is used for conditional checks when adding new members to thecohort
, it is recommended to only delete the specific member from thecohort
when calling the_removeMemberFromCohortArray
rather than reducing the array by one element.This can be done as follows:
Assessed type
DoS