MultisigManager may not be able to add a valid Multisig
The MultisigManager contract limits the number of registered multisigs to 10, but there is no way to remove or replace a disabled multisig. If all 10 slots are filled and later disabled, no new valid multisig can be added, forcing continued use of the old, potentially compromised ones.
bin2chen Follow with immeas, RaymondFam and 6 others
Originally disclosed on Code4rena
Submitted by bin2chen, also found by immeas, RaymondFam, ast3ros, cryptonue, 0xhunter, adriro, 0xbepresent, and Saintcode_
When more than 10 mulitsig, it is impossible to modify or delete the old ones, making it impossible to create new valid ones.
Proof of Concept
MultisigManager limits the number of Multisig to 10, which cannot be deleted or replaced after they have been disabled. This will have a problem, if the subsequent use of 10, all 10 for some reason, be disabled. Then it is impossible to add new ones and replace the old ones, so you have to continue using the old Multisig at risk.
function registerMultisig(address addr) external onlyGuardian {
int256 multisigIndex = getIndexOf(addr);
if (multisigIndex != -1) {
revert MultisigAlreadyRegistered();
}
uint256 index = getUint(keccak256("multisig.count"));
if (index >= MULTISIG_LIMIT) {
revert MultisigLimitReached(); //***@audit limt 10, and no other way to delete or replace the old Multisig ***//
}
Recommended Mitigation Steps
Add replace old mulitsig method
function replaceMultisig(address addr,address oldAddr) external onlyGuardian {
int256 multisigIndex = getIndexOf(oldAddr);
if (multisigIndex == -1) {
revert MultisigNotFound();
}
setAddress(keccak256(abi.encodePacked("multisig.item", multisigIndex, ".address")), addr);
emit RegisteredMultisig(addr, msg.sender);
}
emersoncloud (GoGoPool) confirmed
0xju1ie (GoGoPool) disagreed with severity and commented:
I’d argue Low since its unlikely.
emersoncloud (GoGoPool) commented:
I disagree @0xju1ie. I think it’s an oversight not to have a way to delete old multisigs with the limit in place rather than a quality assurance issue.
#349 has an interesting fix for this issue
emersoncloud (GoGoPool) commented:
Which was: “Count only the validated/enabled multisigs in order to control the limit.”
Alex the Entreprenerd (judge) commented:
The Warden has shown how, due to a logic flaw, the system can only ever add up to 10 multi sigs, even after disabling all, no more multi sigs could be added.
Because this shows how an external condition can break the functionality of the MultisigManager, I agree with Medium Severity.
emersoncloud (GoGoPool) commented:
Acknowledged.
Not fixing right now, we don’t foresee having many multisigs at launch, and will upgrade as necessary to support more.
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 enforces a hard limit of 10 registered multisigs but provides no function to delete or replace a disabled multisig, so the count never decreases.
Impact
If all 10 multisig slots are filled and later disabled, no new valid multisig can be added, forcing continued use of the old, potentially risky multisigs.
What the attacker needed
10 multisigs already registered; all 10 multisigs disabled
The fix
The contract should be fixed by adding a method to replace an old multisig with a new one, or by counting only enabled multisigs toward the limit.
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 multisig is a wallet that requires multiple people to approve transactions. The contract allows only 10 such wallets to be registered, but once a wallet is disabled, it still counts toward the limit and cannot be removed. So if all 10 are used and later disabled, no new wallet can be added, leaving the system stuck with old, possibly unsafe wallets.
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.