Closed c4-bot-7 closed 9 months ago
bytes032 marked the issue as insufficient quality report
The Warden specifies how a DoS attack can naturally occur as the troves of a user expand to a significant size. The referenced function is not utilized in any sensitive functions in the system and is a function meant to be externally invoked. While pagination can be introduced, this is more of a QA (NC) recommendation rather than an HM vulnerability.
alex-ppg changed the severity to QA (Quality Assurance)
alex-ppg marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2024-01-opus/blob/4720e9481a4fb20f4ab4140f9cc391a23ede3817/src/core/abbot.cairo#L108
Vulnerability details
Proof of Concept
This loop iterates through
user_troves
to collect trove IDs associated with a particular user. The potential for a DoS attack arises ifuser_troves_count
is very large, causing the loop to execute a large number of iterations. Each iteration involves reading from storage and appending totrove_ids
.If an attacker can manipulate the contract state such that
user_troves_count
for a specific user is excessively large, they could force the loop to consume a significant amount of gas, potentially leading to out-of-gas errors or significantly delaying the execution of this function.Recommended Mitigation Steps
To mitigate this potential DoS vulnerability, you should consider:
user_troves_count
oruser_troves
to prevent excessive gas consumption.By implementing these measures, you can help protect the contract against potential DoS attacks.
Assessed type
DoS