Skip to content
Access control Audit finding Intermediate

`Consensus`.`checkSignatures` doesn't check duplication of signers

The signature validation function only checks the number of signatures against the threshold, not whether they come from distinct signers. An attacker with one valid signature could duplicate it to meet the threshold and execute an order that should have required multiple approvals.

0xShoonya Follow with 0xc0ffEE, 7 and 41 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-07-mellow-flexible-vaults-judging/issues/13

Found by

0xShoonya, 0xc0ffEE, 7, 8olidity, ARMoh, Brene, Caramelo10, Cybrid, Etherking, GypsyKing18, Ivcho332, Kodyvim, MaCree, Mishkat6451, Pandabear30, Pexy, PratRed, Sparrow_Jac, ZanyBonzy, akhoronko, aman, anchabadze, blockace, boredpukar, bughuntoor, ch13fd357r0y3r, coin2own, edger, iFindTheBugs2, illoy_sci, jasonxiale, joicygiore, jolyon, kangaroo, kazan, ke1caM, klaus, makeWeb3safe, rsam_eth, silver_eth, t.aksoy, teoslaf1, weblogicctf, zxriptor

Summary

SignatureQueue.validateOrder checks signatures using Consensus.checkSignatures. But this doesn't check duplication of signers, so malicious attacker can bypass threshold checking.

Root Cause

SignatureDepositQueue.deposit and SignatureRedeemQueue.redeem uses SignatureQueue.validateOrder. This checks signatures using Consensus.checkSignatures.

Solidity
    function checkSignatures(bytes32 orderHash, Signature[] calldata signatures) public view returns (bool) {
        ConsensusStorage storage $ = _consensusStorage();
 @>     if (signatures.length == 0 || signatures.length < $.threshold) {
            return false;
        }
        for (uint256 i = 0; i < signatures.length; i++) {
            address signer = signatures[i].signer;
            (bool exists, uint256 signatureTypeValue) = $.signers.tryGet(signer);
            if (!exists) {
                return false;
            }
            SignatureType signatureType = SignatureType(signatureTypeValue);
            if (signatureType == SignatureType.EIP712) {
                address recoveredSigner = ECDSA.recover(orderHash, signatures[i].signature);
                if (recoveredSigner == address(0) || recoveredSigner != signer) {
                    return false;
                }
            } else if (signatureType == SignatureType.EIP1271) {
                bytes4 magicValue = IERC1271(signer).isValidSignature(orderHash, signatures[i].signature);
                if (magicValue != IERC1271.isValidSignature.selector) {
                    return false;
                }
            } else {
                return false;
            }
        }
        return true;
    }

This checks signatures.length < $.threshold but this doesn't check duplication of signers. So attacker can bypass threshold and deposit or redeem using invalid order.

Internal Pre-conditions

.

External Pre-conditions

.

Attack Path

  1. Attacker prepares incorrect order.
  2. Attacker gets one valid signature.
  3. Attacker uses SignatureDepositQueue or SignatureRedeemQueue using signatures that has duplication of one valid signature.
  4. Attacker succeed to order.

Impact

Attacker can get profit using incorrect order bypassing threshold.

PoC

.

Mitigation

Check duplication of signers.

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/mellow-finance/flexible-vaults/pull/5/files

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

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

Impact

An attacker could bypass the threshold requirement and execute an incorrect order, potentially gaining profit.

What the attacker needed

One valid signature from a legitimate signer

The fix

The protocol team fixed this issue by adding a check for duplicate signers.

How it was found

  1. Attacker prepares an incorrect order.
  2. Attacker obtains one valid signature.
  3. Attacker submits the order to the deposit or redeem queue with multiple copies of that single signature.
  4. The order is accepted despite not meeting the intended threshold of distinct signers.

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 smart contract uses multiple signatures to approve an action, requiring a minimum number (the threshold). The code only counts how many signatures are provided, not whether they are from different people. So someone could reuse the same signature many times to reach the threshold and get an action approved that should have needed several different approvers.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by 0xShoonya

View all

8 more disclosed reports, best first.

More from Mellow Flexible Vaults

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.