Summary
The AaveDIVAWrapper
contract contains batch functions such as batchRegisterCollateralToken
and batchCreateContingentPool
that iterate over unbounded input arrays. This lack of size limitation exposes the protocol to Denial of Service (DoS) attacks via gas exhaustion, disrupting essential administrative operations and protocol scalability.
Unrestricted looping in batch functions processes input arrays without size validation, making them vulnerable to transactions that exceed the block gas limit:
Unbounded Loops: The function processes all elements in _collateralTokens
without any limit.
Gas Limit Sensitivity: Large input arrays can cause the transaction to exceed the block gas limit, reverting the entire operation.
Setup:
An attacker or a legitimate user submits a transaction with an excessively large input array (e.g., 500+ tokens).
Execution:
The batch function iterates over the input array, consuming increasing amounts of gas for each iteration.
Once the transaction’s gas consumption exceeds the block gas limit, it reverts.
Impact:
Operational Halt: Legitimate administrative actions like registering collateral tokens or creating pools are blocked.
Gas Wastage: Failed attempts to process large batches lead to unnecessary gas fees.
Setup:
An attacker identifies the absence of batch size limits.
Execution:
The attacker submits repeated large input arrays to intentionally cause transaction failures.
This delays legitimate operations and frustrates administrators.
Impact:
Reduced Scalability: The protocol becomes unable to handle large-scale updates efficiently.
Reputation Damage: Users and stakeholders lose confidence in the protocol’s robustness.
DoS Potential: Attackers can exploit the unbounded loops to disrupt key protocol functions.
Economic Loss: Repeated failed transactions incur significant gas costs for administrators and users.
Scalability Challenges: Unrestricted loops hinder the protocol’s ability to handle large-scale operations effectively.
Limit the maximum allowable size of input arrays to prevent gas exhaustion:
Minimize gas usage per iteration by avoiding unnecessary storage writes:
Use memory variables for interim calculations.
Reduce function calls within loops where possible.
Advise administrators to split large batches into smaller, manageable transactions. Develop frontend tools to automate array splitting.
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.