Skip to content

Sherlock

Hats

Every publicly disclosed report for Hats and what kind of bugs they were.

disclosed reports
26
most reported class
Business logic
bug classes found
5
first disclosure
2023
Find Hats on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Hats chose to make public.

Business logic

Usage of HSG for existing safe can brick safe

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.

Hats

Medium
Business logic

Hats can be overwritten

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.

Hats

Medium
Business logic

Safe threshold can be set above target threshold, causing transactions to revert

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.

Hats

Medium
Business logic

Safe can be bricked because threshold is updated with validSignerCount instead of newThreshold

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.

Hats

High
Business logic

If another module adds a module, the safe will be bricked

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.

Hats

High
Business logic

HatsSignerGate + MultiHatsSignerGate: more than maxSignatures can be claimed which leads to DOS in reconcileSignerCount

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.

Hats

High
Access control

Owners can be swapped even though they still wear their signer hats

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.

Hats

Medium
Smart contracts

attacker can perform malicious transactions in the safe because reentrancy is not implemented correctly in the checkTransaction() and checkAfterExecution() function in HSG

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.

Hats

Medium
Business logic

targetThreshold can be set below minThreshold, violating important invariant

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.

Hats

Medium
Access control

Unlinked tophat retains linkedTreeRequests, can be rugged

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.

Hats

High
DoS

Unbound recursive function call can use unlimited gas and break hats operation

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.

Hats

Medium
Business logic

The Hats contract needs to override the ERC1155.balanceOfBatch function

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.

Hats

Medium
Access control

Signers can bypass checks and change threshold within a transaction

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.

Hats

High
Business logic

Can get around hats per level constraints using phantom levels

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.

Hats

Medium
Business logic

Changing hat toggle address can lead to unexpected changes in status

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.

Hats

Medium
Business logic

Signers can brick safe by adding unlimited additional signers while avoiding checks

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.

Hats

High
Access control

Owners of linkedin tophats cannot have eligibility revoked

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.

Hats

Medium