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

Ragnarok - DoS Attack by Malicious Signer in HatsSignerGate #34

Open
sherlock-admin3 opened this issue Nov 23, 2024 · 0 comments
Open

Comments

@sherlock-admin3
Copy link

sherlock-admin3 commented Nov 23, 2024

Ragnarok

Medium

DoS Attack by Malicious Signer in HatsSignerGate

Summary

Malicious signer, who have already been revoked the signer hat but have not been removed yet, can submit a signature to Safe transaction, resulting in the transaction revert.

Root Cause

In the HatsSignerGate::checkTransaction function have a check to make sure that have enough valid signatures to execute the transaction.

HatsSignerGate::checkTransaction function:

function checkTransaction(
  ...
  bytes memory signatures,
  ...
) public override {
  ...
  // count the number of valid signatures and revert if there aren't enough
=>if (_countValidSignatures(txHash, signatures, threshold) < threshold) revert InsufficientValidSignatures();
}

The _countValidSignatures(txHash, signatures, threshold) < threshold condition will happen when have one signer, who submit one signature in the list signatures, currently is not the wearer of the registered hat and haven't removed yet. As a result, the transaction will revert.

HatsSignerGate::_countValidSignatures function:

function _countValidSignatures(bytes32 dataHash, bytes memory signatures, uint256 sigCount)
  internal
  view
  returns (uint256 validSigCount)
{
  ...
  for (i; i < sigCount; ++i) {
    ...
=>  if (isValidSigner(currentOwner)) {
      unchecked {
        ++validSigCount;
      }
    }
  }
}

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

  1. Malicious signer, who have already been revoked the signer hat but have not been removed yet, submit a signature to Safe transaction.
  2. This cause the HatsSignerGate::checkTransaction function revert and the transaction revert too.

Impact

Malicious signer can DOS the transaction execute until them is removed.

PoC

No response

Mitigation

No response

@sherlock-admin2 sherlock-admin2 changed the title Elegant Carbon Nightingale - DoS Attack by Malicious Signer in HatsSignerGate Ragnarok - DoS Attack by Malicious Signer in HatsSignerGate Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant