Other modules on a Safe can add owners without the HatsSignerGate module's checks, potentially pushing the valid signer count above maxSigners. This causes all transactions to revert, bricking the safe and freezing funds unless hat wearers renounce their hats.
The `_removeSigner` function incorrectly updates the `signerCount` and safe `threshold` when a previously inactive signer becomes active again. This can lead to an incorrect number of signatures required for transactions.
A middle-level admin could relink a child tree to a new top hat they created, then unlink that top hat, thereby removing higher-level admins' access and becoming the sole admin of the child tree. This allowed a trusted mid-level admin to steal control of sub-trees.
A signer-gate contract deployed for an existing Safe can be configured with a maximum signer count lower than the Safe's current number of valid signers. Because the pre-transaction check reverts when the valid signer count exceeds that maximum, the Safe can no longer execute any transaction until enough signers lose their hats.
The smart contract allowed creating a child hat under an admin hat that did not yet exist. When the admin hat was later created, it overwrote the child hat's properties, including its maximum supply, even if the child hat was meant to be immutable.
The contract's threshold reconciliation logic fails to lower the safe's threshold when the target threshold is set below the current safe threshold and the valid signer count exceeds the target. This leaves the safe threshold above the target, causing all subsequent transactions to revert due to a threshold validity check.
The signer-swap loop in the HatsSignerGate contract stops one owner short, so the last owner is never checked for validity. When only that final owner is invalid, a new user cannot claim the signer role even though a slot should be freed for them.
The HatsSignerGate (HSG) and Safe check signatures differently: Safe validates only the first threshold signatures, while HSG counts valid signatures among all provided. An attacker can append extra signatures, including old ones, to bypass the threshold and have an invalid signer's transaction executed.
A signer-gate contract meant to lower a Safe's signing threshold used the raw valid signer count instead of the computed minimum value. When there were more valid signers than the target threshold, the Safe's threshold was set too high, causing a post-execution check to fail and every Safe transaction to revert, potentially bricking the Safe permanently.
The post-execution check that prevents signers from adding new modules to a Safe can be bypassed by reentrancy. An attacker with enough signers can add a malicious module, giving them unlimited control over the Safe.
A module added by another module bypasses the function that increments the enabled module count, causing the guard's before and after module hash checks to differ. This permanently blocks all transactions, bricking the safe and trapping funds.
The claimSigner functions in HatsSignerGate and MultiHatsSignerGate relied on a cached signer count that could fall out of sync with the real number of valid signers, allowing more than maxSigners valid signers to exist. Once that happened, reconcileSignerCount always reverted, blocking the safe from executing transactions until a legitimate signer gave up their hat.
The HatsSignerGateBase contract does not verify that the set of owners of a Safe multisig remains unchanged after a transaction. A group of malicious signers could use a delegate call to a malicious contract to swap out opposing signers for cooperating ones, even though the replaced signers still hold their signer hats.
The reentrancy guard in the HatsSignerGate contract increments a counter in checkTransaction and decrements it in checkAfterExecution, but the logic is flawed. An attacker could exploit this to change the Safe's guard or threshold during execTransaction and execute a malicious transaction.
The contract checked that minThreshold was not above targetThreshold when setting the minimum, but did not perform the equivalent check when setting the target. An attacker or careless admin could set targetThreshold below minThreshold, causing the safe's threshold to drop below the required minimum and making all transactions fail.
When a tophat is unlinked from its admin, the pending link request stored in linkedTreeRequests is not cleared. A former admin could therefore leave a request in place and later have a chosen address approve it, taking control of a tophat that was meant to be self-sovereign.
The Hats and HatsIdUtilities contracts contain recursive functions that traverse linked hat trees without a depth limit. If a hat tree becomes very deep, these functions can consume unlimited gas and revert, making it impossible to call them and breaking operations for those hats.
The Hats contract overrides ERC1155.balanceOf to return zero for inactive hats or ineligible wearers, but it does not override balanceOfBatch, which still returns the raw stored balance. An attacker or integrator could therefore read a non-zero balance for a hat the wearer is not eligible to hold, causing inconsistent results between the two functions.
The post-execution guard that was meant to stop signers from changing a Safe's signing threshold only compared the threshold against a value recalculated from the current owner list, so a transaction that also removed owners could lower the threshold and still pass. Signers could therefore reduce the threshold and gain more control over future transactions.
The Hats protocol limits each hat to 65,536 direct children, but an admin could bypass this by setting a non-existent intermediate hat ID as the admin, creating phantom levels. This allowed unlimited direct children, violating the intended constraint.
When the signer gate is attached to an existing Safe that already has more than five modules, the gate only counts the first five, so its stored module count is wrong. Every later transaction then fails the module-hash check and reverts, leaving the Safe unusable.
The signature validation function uses ecrecover, which returns address(0) for malformed signatures. If a hat is owned by address(0), such phony signatures are accepted as valid, allowing transactions without sufficient support to execute.
The Hats.uri function builds a JSON string from the details and imageURI fields, and because those fields have no length limit, an attacker can make them so large that calling the function costs more than a block's gas limit and reverts. The attacker can also make the hat immutable after the attack, and anyone calling the function pays the high gas cost.
Changing a hat's toggle address from a contract to an EOA can cause the hat's status to revert to an unsynced local state, potentially reactivating a hat that should be off. An attacker could sandwich a transaction to exploit this, using a hat that should be disabled.
The signer gate contract checked the safe's threshold after execution but never verified that the set of owners was unchanged, so signers could add extra owners through a normal transaction. Once enough valid signers were added to exceed the immutable maximum, every later transaction reverted, freezing the safe and the funds inside it.
Linked top hats (tophats) are supposed to behave like normal hats, but their eligibility address remains permanently set to zero, disabling the badStanding mechanism. This allows all wearers of such hats to be immune to punishment from their admins.
HA
Hats
Medium
Instant results are busy. Press Enter to search every report.
No direct matches. Search every report above, or try a bug class like IDOR or SSRF.