Open c4-bot-4 opened 4 months ago
Hey @alex-ppg, could you please review this issue?
I think it is important to realize the impacts this issue would have, which have been stated in the Summary section. I think it is of Medium-severity risk since as explained it introduces uncertainty in the number of real whitelisted addresses existing within the limited 1k slots as well as how other users could get affected as well.
I'd like to hear your views on this, thank you!
Hey @mcgrathcoutinho, thank you for the PJQA contribution. I will preface all validation repository finding responses by stating that they are not evaluated by judges directly and are only evaluated by the validators if they are deemed unsatisfactory.
An attacker cannot make repetitive calls via the same address due to this code block, and an attack that exhausts the list is unrealistic if we consider that a new address needs to interact each time.
This paragraph is included in all of my responses and confirms that no further feedback is expected in this submission as PJQA has concluded. You are free to refute any of my statements factually, however, I strongly implore you to do this with actual code references and examples.
Lines of code
https://github.com/code-423n4/2024-06-vultisig/blob/cb72b1e9053c02a58d874ff376359a83dc3f0742/hardhat-vultisig/contracts/Whitelist.sol#L65
Vulnerability details
Summary
Context: The receive() function in the Whitelist.sol contract is called by users to self-whitelist themselves when _isSelfWhitelistDisabled is false and provided they are not blacklisted.
Issue: Currently though, this mechanism is prone to spamming/griefing since an attacker can make 0 msg.value (no upfront cost other than gas) or dust amount of msg.value calls to the receive() function.
Impact: Since there are expected to be 1k whitelist slots as per the README, the attacker can spam the whitelist with random addresses at any point in time. The impact of this is that:
Basically, as long as the self-whitelist is open, the attack can be performed with ease. This eventually breaks the whitelist functionality and introduces uncertainty as to whether the whitelist is full of spammers or not.
Even if we assume another round of self-whitelist is held without the spammer being involved, there would a certain set of legitimate users who miss out on a spot on the second try due to the limited spots. Overall, whitelisting in this manner is unguarded.
Proof of Concept
Here is a simple POC to prove 0 msg.value calls go through:
contract ContractG {
}