Skip to content
Business logic Audit finding Intermediate

SecurityCouncilMemberElectionGovernor Owner Can Change votingPeriod During an Active Election

The contract owner can change the voting period or full weight duration during an active election, which can unfairly alter voting power and make results unreliable.

hals Follow with MiloTruck, HE1M and 1 other

Originally disclosed on Code4rena

Submitted by hals, also found by MiloTruck, HE1M, and Kow

https://github.com/ArbitrumFoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol#L103-L110 https://github.com/ArbitrumFoundation/governance/blob/c18de53820c505fc459f766c1b224810eaeaabc5/src/security-council-mgmt/governors/modules/SecurityCouncilMemberElectionGovernorCountingUpgradeable.sol#L77-L84

Impact

  • In SecurityCouncilMemberElectionGovernor contract : relay function enables the contract owner from making calls to any contract address.
  • And in SecurityCouncilMemberElectionGovernorCountingUpgradeable contract: setFullWeightDuration can be accessed only by invoking it from SecurityCouncilMemberElectionGovernor which is possible only via relay function.
  • So the owner can set a new value for fullWeightDuration that is used to determine the deadline after which the voting weight will linearly decrease.
  • But when setting it; there’s no check if there’s a current active proposal.
  • This makes the voting unfair and the results unreliable as the owner can control the voting power during the election; as increasing the voting power of late voters if fullWeightDuration is set to a higher value during active election.

Proof of Concept

  • Code:

    SecurityCouncilMemberElectionGovernor contract/relay function

    File:governance/src/security-council-mgmt/governors/SecurityCouncilMemberElectionGovernor.sol
    Line 103-110:
        function relay(address target, uint256 value, bytes calldata data)
            external
            virtual
            override
            onlyOwner
        {
            AddressUpgradeable.functionCallWithValue(target, data, value);
        }
    

    SecurityCouncilMemberElectionGovernorCountingUpgradeable contract/setFullWeightDuration function

    File: governance/src/security-council-mgmt/governors/modules/SecurityCouncilMemberElectionGovernorCountingUpgradeable.sol
    Line 77-84:
       function setFullWeightDuration(uint256 newFullWeightDuration) public onlyGovernance {
          if (newFullWeightDuration > votingPeriod()) {
              revert FullWeightDurationGreaterThanVotingPeriod(newFullWeightDuration, votingPeriod());
          }
    
          fullWeightDuration = newFullWeightDuration;
          emit FullWeightDurationSet(newFullWeightDuration);
      }
    
  • Foundry PoC:

  • testSetVotingPeriodDuringActiveProposal() test is added to SecurityCouncilMemberElectionGovernorTest.t.sol file; where the relay function is invoked by the contract owner to change the fullWeightDuration during an active proposal:

    function testSetVotingPeriodDuringActiveProposal() public {
     //1. initiate a proposal
     _propose(0);
     //2. change fullWeightDuration while the proposal is still active
     assertEq(governor.votingPeriod(), initParams.votingPeriod);
     vm.prank(initParams.owner);
     governor.relay(
       address(governor),
       0,
       abi.encodeWithSelector(governor.setVotingPeriod.selector, 121_212)
     );
     assertEq(governor.votingPeriod(), 121_212);
    }
    
  • Test result:

    $ forge test --match-test testSetVotingPeriodDuringActiveProposal
    [PASS] testSetVotingPeriodDuringActiveProposal() (gas: 118129)
    Test result: ok. 1 passed; 0 failed; 0 skipped; finished in 4.51ms
    Ran 1 test suites: 1 tests passed, 0 failed, 0 skipped (1 total tests)
    

Tools Used

Manual Testing & Foundry.

Recommended Mitigation Steps

Enable setting a new value for fullWeightDuration only if there’s no active election.

Assessed type

Governance

yahgwai (Arbitrum) confirmed and commented via duplicate issue #52:

Fix: https://github.com/ArbitrumFoundation/governance/pull/184. Fix is just add comments informing the caller not to set during certain times.


The original report as published on Code4rena, by hals. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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

Likely, the setter functions for voting period and full weight duration lack a check that no proposal is currently active.

Impact

The owner could manipulate voting power during an election, making results unfair and unreliable.

What the attacker needed

Owner privileges

The fix

The fix was to add comments informing the caller not to set during certain times.

How it was found

  1. Initiate a proposal.
  2. As the owner, call relay to change the voting period while the proposal is still active.
  3. Observe that the voting period has changed.

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.

In a voting system, the rules about how long voting lasts and how votes lose weight over time should not change while people are voting. Here, the person who controls the contract can change these rules mid-election, which could favour certain voters and make the outcome unfair.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by hals

View all

5 more disclosed reports, best first.

More from Arbitrum Security Council Election System

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.