Hunt prep
Before you test Hats
What 26 disclosed reports say about Hats: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing
Not written yet for this program. The numbers below are up to date.
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 14 | 0 | – | – | $0 |
| Access control lesson | 6 | 0 | – | – | $0 |
| DoS lesson | 3 | 0 | – | – | $0 |
| Smart contracts lesson | 2 | 0 | – | – | $0 |
| Crypto lesson | 1 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
Other module can add owners to safe that push us above maxSigners, bricking safe
The module should either provide a mechanism to reduce the number of signers instead of reverting, or restrict the HatsSignerGate module to Safes with no other modules.
Disclosed
-
[Medium][Outdated State] `_removeSigner` incorrectly updates `signerCount` and safe `threshold`
The fix should change the condition to check if validSignerCount is greater than or equal to currentSignerCount, and the issue was fixed according to the discussion.
Disclosed
-
middle level admins can steal child trees because function unlinkTopHatFromTree() is callable by them
The fix should restrict relinking so that the destination is either the same local tree or the top-level tree, or require the caller to wear the top hat.
Disclosed
-
Usage of HSG for existing safe can brick safe
The maximum signer count should be changeable by the owner, or a check should run at wiring-up time to confirm the gate is safe for the existing Safe; a fix PR was referenced.
Disclosed
-
Hats can be overwritten
The fix was to prevent overwriting the lastHatId when creating a hat, so that existing child hats are not modified.
Disclosed
-
Safe threshold can be set above target threshold, causing transactions to revert
The if statement in `reconcileSignerCount()` should be modified to always lower the threshold to the target if it exceeds it, and the update condition should check if the new threshold differs from the current one.
Disclosed
-
Swap Signer fails if final owner is invalid due to off by one error in loop
The loop should iterate up to `ownerCount` rather than `ownerCount - 1` so every owner is checked; the report notes a fix was approved.
Disclosed
-
HatsSignerGateBase: valid signer threshold can be bypassed because HSG checks signatures differently from Safe which allows exploitation
The HSG should check only the first threshold signatures, matching the Safe's check, and remove redundant length checks.
Disclosed
-
Safe can be bricked because threshold is updated with validSignerCount instead of newThreshold
The function call should pass newThreshold rather than validSignerCount to changeThreshold; the text notes a fix was approved.
Disclosed
-
Signers can bypass checks to add new modules to a safe by abusing reentrancy
The reentrancy guard should be fixed by setting `_guardEntries = 1` in `checkTransaction()` or checking that it is zero at the start.
Disclosed
-
If another module adds a module, the safe will be bricked
The module guarding logic should be rethought, and the team chose to disallow other modules on safes that use this functionality.
Disclosed
-
HatsSignerGate + MultiHatsSignerGate: more than maxSignatures can be claimed which leads to DOS in reconcileSignerCount
The claimSigner functions were changed to call reconcileSignerCount first, and the fix also blocked signers from adding owners directly and tracked the valid signer count dynamically.
Disclosed
-
Owners can be swapped even though they still wear their signer hats
The contract should perform a pre- and post-flight comparison of the Safe owners, similar to the existing check for modules.
Disclosed
-
attacker can perform malicious transactions in the safe because reentrancy is not implemented correctly in the checkTransaction() and checkAfterExecution() function in HSG
The guard counter should be set to 1 and decremented in checkTransaction, then incremented in checkAfterExecution.
Disclosed
-
targetThreshold can be set below minThreshold, violating important invariant
A check should be added in _setTargetThreshold that reverts when the new target is below minThreshold; the linked pull request and 'Fix Approved' label indicate it was fixed.
Disclosed