GoGoPool contest - simon135's results

Liquid staking for Avalanche.

General Information

Platform: Code4rena

Start Date: 15/12/2022

Pot Size: $128,000 USDC

Total HM: 28

Participants: 111

Period: 19 days

Judge: GalloDaSballo

Total Solo HM: 1

Id: 194

League: ETH

GoGoPool

Findings Distribution

Researcher Performance

Rank: 95/111

Findings: 1

Award: $17.37

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

17.3743 USDC - $17.37

Labels

bug
2 (Med Risk)
partial-50
duplicate-702

External Links

Lines of code

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

Vulnerability details

Impact

When a multisig gets disabled, the multsig that is attached to that minipool can still call functions and cause harm even though the protocol disabled it.

Proof of Concept

	function recordStakingEnd(
		address nodeID,
		uint256 endTime,
		uint256 avaxTotalRewardAmt
	) external payable {
		int256 minipoolIndex = onlyValidMultisig(nodeID);
		requireValidStateTransition(minipoolIndex, MinipoolStatus.Withdrawable);

		uint256 startTime = getUint(keccak256(abi.encodePacked("minipool.item", minipoolIndex, ".startTime")));
		if (endTime <= startTime || endTime > block.timestamp) {
			revert InvalidEndTime();
		}

in onlyValidMultisig

function onlyValidMultisig(address nodeID) private view returns (int256) { int256 minipoolIndex = requireValidMinipool(nodeID); address assignedMultisig = getAddress(keccak256(abi.encodePacked("minipool.item", minipoolIndex, ".multisigAddr"))); if (msg.sender != assignedMultisig) { revert InvalidMultisigAddress(); } return minipoolIndex; }

It gets the multsig that is assigned in the create mini pool function and it doesn't check if that multisig is disabled which can lead to a loss for node operators if the multisig is hacked.

Tools Used

Vim

add a check for that multsig address that is enabled in the protocol

/// pseudo-code

	function onlyValidMultisig(address nodeID) private view returns (int256) {
		int256 minipoolIndex = requireValidMinipool(nodeID);

		address assignedMultisig = getAddress(keccak256(abi.encodePacked("minipool.item", minipoolIndex, ".multisigAddr")));
		if (msg.sender != assignedMultisig) {
			revert InvalidMultisigAddress();
		}
               unit index=getIndexOf(assignedMultisig); 
              (address mulit,bool enabled)=getMultisig(index);
              if(enabled==false){
               revert();
}

		return minipoolIndex;
	}

#0 - c4-judge

2023-01-08T12:54:48Z

GalloDaSballo marked the issue as duplicate of #618

#1 - c4-judge

2023-02-01T19:57:26Z

GalloDaSballo marked the issue as duplicate of #702

#2 - GalloDaSballo

2023-02-02T11:57:09Z

See #618

#3 - c4-judge

2023-02-02T11:57:15Z

GalloDaSballo marked the issue as partial-50

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter