Open hats-bug-reporter[bot] opened 3 days ago
Please note, this bug report explains a vulnerability that does NOT require a malicious blacklister, but simply requires an accidental blacklisting of the address(0)
.
Specifically, the array list function for adding multiple addresses to the blacklist. It's arguably entirely possible for a mistake to be made and accidentally include address(0)
in that list.
Furthermore, blacklisting address(0)
has critical but temporary DoS impact on most of the primary user facing functionality of the protocol. So it isn't simply a little issue, it's arguably a major issue(DoS of user deposits/withdrawals), which can luckily be fixed quickly but only once the protocol team has figured out what the problem was, which in this case is an accidentally blacklisted address(0)
.
Unless there's a solid valid reason for intentionally ALLOWING for address(0)
to be blacklisted, I argue that a mitigation fix should be implemented to completely eliminate this vulnerability.
thanks
Github username: -- Twitter username: 0xSCSamurai Submission hash (on-chain): 0xb3d3f3ef3cf38c0682691b6c64f2d98625923ed71596a75d3db118c391f8826d Severity: medium
Description: Description\
Since the
BLACKLISTER_ROLE
is trusted, ifaddress(0)
is accidentally added to the blacklist, which isn't an impossible scenario(mistakes happen), it will DoS most protocol functionality for users, luckily only temporarily until theWHITELISTER_ROLE
removes the blacklist status fromaddress(0)
via calling thevoid()
function.Although it's quite unlikely that the trusted
BLACKLISTER_ROLE
will accidentally addaddress(0)
to the blacklist via the single address function, it becomes much more likely for such an accident/mistake to happen when adding multiple addresses to the blacklist via the multiple addressesblacklist()
function, where an array list will be used, as there are no checks in either functions to preventaddress(0)
from being blacklisted, and it's totally possible foraddress(0)
to accidentally sneak into a larger array list without detection...And since critical protocol functionality heavily relies on the use of
address(0)
for minting and burning transactions, the main protocol functionality, deposits/mints & withdrawals/redemptions, will be temporarily DoS-ed.Much less likely for
address(0)
to accidentally sneak in here:But:
Much more likely for
address(0)
to accidentally sneak in where an array list is used:IMPACT:
address(0)
can quickly be removed from the blacklist once the cause of the DoS reverts is discovered; medium severity because it's a massive disruption to the protocol, and if the cause of the major DoS reverts isn't found quickly, it could result in a serious disruption of primary protocol functionality.Deeming this vulnerability as medium severity.
Proof of Concept (PoC Tests):
Test contract used, please ignore the generic code which I'm re-using for all my other tests:
The only block of code from above test contract that will be adjusted/modified for each of the below PoC tests:
Test 1: address(0) not blacklisted, normal expected behaviour:
Using:
Test Result:
Test 2: address(0) is now blacklisted, everything reverts(deposits, recover, withdraw):
Using:
Test Result:
address(0)
causes most of the critical user facing functions to fail due toaccount blocked
reverts.Test 3: address(0) removed from the blacklist by whitelister, and now everything works as expected again:
Using:
Test Result:
Test 4: Mitigation fix implemented. Now address(0) cannot be added to the blacklist at all:
Note: For this test I used the suggested mitigation fix that I mention at the bottom of the report after PoC tests...
Using:
Test Result:
address(0)
to the blacklist accidentally or intentionally.Suggested mitigation fix for this vulnerability:
and
Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)
Files: