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

Single Multisig is assigned all pools and cannot be changed #560

Closed
code423n4 opened this issue Jan 3, 2023 · 2 comments
Closed

Single Multisig is assigned all pools and cannot be changed #560

code423n4 opened this issue Jan 3, 2023 · 2 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate-702 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/MinipoolManager.sol#L236
https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/MultisigManager.sol#L67

Vulnerability details

Impact

All pools get assigned to the same multisig, assuming the protocol runs at least 1 active pool every time.
Every minipool created is assigned a multisig, which cannot be changed later. The protocol selects a multisig for this using MinipoolManager.requireNextActiveMultisig, which returns the first enabled multisig.

Filename: contracts/contract/MinipoolManager.sol
236:    		address multisig = multisigManager.requireNextActiveMultisig();

To configure, such that any new pool gets assigned a new multisig, the previous has to be disabled. But comments indicate that disabling a multisig, will also disable validations by any pools that have that multisig.

Filename: contracts/contract/MultisigManager.sol
67:    	/// @dev this will prevent the multisig from completing validations. The minipool will need to be manually reassigned to a new multisig
68:   	function disableMultisig(address addr) external guardianOrSpecificRegisteredContract("Ocyticus", msg.sender) {

The code doesn't contain any function to reassign a pool to a new multisig. So, if the protocol always has at least 1 minipool running, it becomes impossible to change the multisig.

Proof of Concept

Creating a new pool will assign to it the first enables multisig.
Any new pool created from when this pool started to when this pool ends, will have the same multisig, since disabling that multisig to change to another, will disable validation by the earlier pool.
So, assuming the protocol always has 1 pool active, that multisig could never be changed.

Tools Used

Manual inspection

Recommended Mitigation Steps

Add a function to reassign all pools of a to-be-disabled multisig to a different multisig.
This may include logic to transfer the staking funds plus any rewards, from the old multisig to the new multisig, through the reassigning function.

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Jan 3, 2023
code423n4 added a commit that referenced this issue Jan 3, 2023
C4-Staff added a commit that referenced this issue Jan 6, 2023
@c4-judge
Copy link
Contributor

c4-judge commented Jan 8, 2023

GalloDaSballo marked the issue as duplicate of #702

@c4-judge c4-judge closed this as completed Jan 8, 2023
@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Feb 8, 2023
@c4-judge
Copy link
Contributor

c4-judge commented Feb 8, 2023

GalloDaSballo marked the issue as satisfactory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate-702 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants