Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixes vuln in Multisig Plugin #338

Merged
merged 2 commits into from
Mar 23, 2023
Merged

Conversation

mathewmeconry
Copy link
Contributor

@mathewmeconry mathewmeconry commented Mar 23, 2023

Description

Code4rena finding: code-423n4/2023-03-aragon-findings#140

When the Multisig settings and addresses are updated and in the same block another proposal gets created an attacker could trigger a race condition:

Consider the addresses 0x01, 0x02, 0x03 to be a member of the Multisig, and the minApprovals is set to 2 during block 1.
Now 0x03 is considered a bad actor and a proposal is created and approved by 0x01 and 0x02 during block 2 but not yet executed to remove 0x03 from the member list and reduce minApprovals to 1.

0x03 can now swoop in with a MEV sandwich block 3 and execute the proposal and create a new proposal in the same block and auto-execute it resulting in 0x03 taking over the Multisig.

This problem is because createProposal() uses the members list from the previous block (2) but the new settings from block 3 resulting in 0x03 still being a member of the Multisig but having already minApprovals set to 1. So 0x03 can create any proposal, approve it and execute it in the same TX.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have selected the correct base branch.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • Any dependent changes have been merged and published in downstream modules.
  • I ran all tests with success and extended them if necessary.
  • I have updated the CHANGELOG.md file in the root folder.
  • I have tested my code on the test network.

whereas old addresses would have been used with the new settings when a proposal is created in the same block as the settings have been changed
Rekard0
Rekard0 previously approved these changes Mar 23, 2023
Copy link
Contributor

@Rekard0 Rekard0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

heueristik
heueristik previously approved these changes Mar 23, 2023
@mathewmeconry mathewmeconry dismissed stale reviews from heueristik and Rekard0 via 58c817a March 23, 2023 11:39
@mathewmeconry mathewmeconry merged commit 1b1a321 into develop Mar 23, 2023
@mathewmeconry mathewmeconry deleted the fix/multisig_vuln branch March 23, 2023 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants