Possible DoS Attack in deleteHolder()
Function
The deleteHolder()
function iterates over the entire holders
array until it finds the holder to be deleted. This operation has a time complexity of O(n), where n is the number of holders. This means that as the number of holders increases, the time taken to execute the function also increases.
If an attacker were able to add a large number of holders to the holders array
, they could potentially cause the function to take an excessively long time to complete, effectively blocking other transactions from being processed.
Moreover, the deleteHolder()
function also shifts all elements after the deleted one down to fill the gap left by the deleted element. This operation has a time complexity of O(n) as well, further exacerbating the problem.
Therefore, if the holders
array becomes too large, the deleteHolder()
function could become a significant bottleneck, leading to a potential DoS attack.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.