Security Council can undermine any DAO votes to remove a member
The Security Council can re-add a member who was removed by a DAO vote, because the contract does not track removed members. This undermines the DAO's ability to remove a council member mid-term.
Submitted by dirk_y
https://github.com/ArbitrumFoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/SecurityCouncilManager.sol#L183-L190 https://github.com/ArbitrumFoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/SecurityCouncilManager.sol#L161-L173 https://github.com/ArbitrumFoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/SecurityCouncilManager.sol#L176-L180 https://github.com/ArbitrumFoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/SecurityCouncilManager.sol#L143-L159
As stated in the updated constitution text:
“Security Council members may only be removed prior to the end of their terms under two conditions:
- At least 10% of all Votable Tokens have casted votes “in favour” of removal and at least 5/6 (83.33%) of all casted votes are “in favour” of removal; or
- At least 9 of the Security Council members vote in favour of removal.”
However, since the Security Council are the only party with the ability to add a member, they can simply re-add the member that was removed by a DAO vote if they disagree with the vote. This entirely defeats the point of giving the DAO the ability to remove a member of the council mid-term.
Proof of Concept
A member of the Security Council can be removed mid-term by calling removeMember in SecurityCouncilManager.sol. This can only be called by addresses that have the MEMBER_REMOVER_ROLE role; the SecurityCouncilMemberRemovalGovernor.sol contract and the 9 of 12 emergency Security Council:
function removeMember(address _member) external onlyRole(MEMBER_REMOVER_ROLE) {
if (_member == address(0)) {
revert ZeroAddress();
}
Cohort cohort = _removeMemberFromCohortArray(_member);
_scheduleUpdate();
emit MemberRemoved({member: _member, cohort: cohort});
}
The actual member removal is performed by _removeMemberFromCohortArray:
function _removeMemberFromCohortArray(address _member) internal returns (Cohort) {
for (uint256 i = 0; i < 2; i++) {
address[] storage cohort = i == 0 ? firstCohort : secondCohort;
for (uint256 j = 0; j < cohort.length; j++) {
if (_member == cohort[j]) {
cohort[j] = cohort[cohort.length - 1];
cohort.pop();
return i == 0 ? Cohort.FIRST : Cohort.SECOND;
}
}
}
revert NotAMember({member: _member});
}
As you can see, the member that has been removed isn’t tracked/stored anywhere for later querying. So, let’s assume that the DAO has successfully voted to remove a member. The removeMember method is called when the vote is successful and the update is schedule in the L2 timelock.
The Security Council now have the ability (as the only party with the MEMBER_ADDER_ROLE role) to add a new member to fill the relevant cohort on the council by calling addMember:
function addMember(address _newMember, Cohort _cohort) external onlyRole(MEMBER_ADDER_ROLE) {
_addMemberToCohortArray(_newMember, _cohort);
_scheduleUpdate();
emit MemberAdded(_newMember, _cohort);
}
Where _addMemberToCohortArray looks like:
function _addMemberToCohortArray(address _newMember, Cohort _cohort) internal {
if (_newMember == address(0)) {
revert ZeroAddress();
}
address[] storage cohort = _cohort == Cohort.FIRST ? firstCohort : secondCohort;
if (cohort.length == cohortSize) {
revert CohortFull({cohort: _cohort});
}
if (firstCohortIncludes(_newMember)) {
revert MemberInCohort({member: _newMember, cohort: Cohort.FIRST});
}
if (secondCohortIncludes(_newMember)) {
revert MemberInCohort({member: _newMember, cohort: Cohort.SECOND});
}
cohort.push(_newMember);
}
As you can see, this method only checks to ensure the member being added doesn’t already exist in either cohort, however there is no validation whether or not this member has been removed before in the current term. As a result, any DAO votes to remove a member can be usurped by the Security Council since they can simply restate the member that was voted to be removed.
Recommended Mitigation Steps
Any member removals mid-term should be tracked for the lifecycle of the term (6 months) to ensure that the same member can’t be re-added. This array should be wiped when a cohort is replaced with a call to replaceCohort.
Assessed type
Invalid Validation
yahgwai (Arbitrum) acknowledged and commented:
Acknowledge: The system is working as intended here. The constitution does not specify who the council can or cannot add. This issue is therefore a critique of the constitution (which was not in scope) rather than the code. However we appreciate this critique of the constitution and believe it to be a valid concern.
Just wanted to add some more context here as I’m expecting some debate around this.
In my view the Security Council could still be acting in good faith but simply disagree with the vote of the DAO. The security council might have some inside knowledge or existing relationships with the removed member, and they still trust the removed member and trust them to act in good faith for any emergency/non-emergency votes. Maybe they’re simply the best person for the job.
Imagine a democratic vote for a new prime minister where the existing prime minister simply declines the result of the vote and remains in office anyway…i.e. a dictatorship. The dictator still believes they’re acting in the best interests of the nation state. In summary the security council can still be acting in good faith, but their actions are undermining trust in the system (in particular the DAO is losing trust in the security council, despite the security council believing they are acting in the best interests of the DAO).
And yes you could argue this is a critique of the constitution but I actually believe this is a critique of the current implementation. Similarly to using OZ roles, you could have a role that can undermine another role’s action; this could be a valid medium assuming the two roles weren’t owned by the same user.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The contract does not track members removed during a term, so the addMember function only checks current membership and allows re-adding a removed member.
Impact
The Security Council can undermine any DAO vote to remove a member, defeating the purpose of giving the DAO that power.
What the attacker needed
Security Council disagrees with DAO removal vote; Security Council holds MEMBER_ADDER_ROLE
The fix
Track members removed mid-term for the duration of the term and prevent them from being re-added until the cohort is replaced.
How it was found
- The DAO votes to remove a Security Council member and the removal is executed.
- The Security Council calls addMember to re-add the removed member to the same cohort.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A DAO is a group that votes on decisions using tokens. The Security Council is a smaller group with special powers. The report says that if the DAO votes to remove a council member, the Security Council can just put that person back, because the code does not remember who was removed.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.