Issue Overview
The AaveDIVAWrapper contract does not validate duplicate tokens in batch registrations. This allows users to submit the same collateral token multiple times, leading to:
Denial of service (DoS) if duplicate entries cause reverts.
Inconsistencies in collateral mappings, potentially leading to unexpected protocol behavior.
Operational disruptions, as failed batch transactions waste gas and affect users.
Batch functions directly iterate over user-provided input arrays without checking for duplicate tokens before calling _registerCollateralToken.
Problem:
If a duplicate token is processed, it may revert or cause unintended mapping updates.
If _registerCollateralToken does not handle duplicates, it could overwrite existing mappings, leading to data corruption.
Step 1: A user submits a batch request with the same collateral token twice.
Step 2: The _registerCollateralToken function processes the first instance successfully.
Step 3: The second instance is processed, potentially causing:
A revert if _registerCollateralToken rejects duplicates.
An overwrite of collateral mappings if duplicates are not properly handled.
Step 4: If the transaction reverts, no tokens in the batch are processed, causing a DoS for legitimate users.
A DEX integrates AaveDIVAWrapper and attempts to register 100 collateral tokens at once.
Due to a frontend bug, two tokens are accidentally duplicated in the batch request.
The entire batch transaction fails, forcing the DEX to retry manually.
Consequence:
The exchange wastes gas fees on failed transactions.
Users cannot add new collateral tokens until the issue is resolved.
The protocol loses credibility due to unexpected reverts.
✅ Likelihood: High – No restrictions prevent duplicate registrations.
✅ Impact: Moderate – Causes DoS and inconsistencies in the protocol's mapping system.
Denial of Service (DoS):
Users cannot register legitimate tokens if batch transactions fail.
Exchanges face transaction failures, reducing usability.
Protocol Mapping Inconsistencies:
Duplicate registrations could cause unexpected collateral behavior.
If a mapping is overwritten, previous data may be lost.
User Frustration & Gas Wastage:
Users pay gas fees for transactions that fail due to duplicates.
Lack of proper error handling could make troubleshooting difficult.
Solidity contract demonstrates how duplicate registrations cause batch failures.
✅ The batch transaction fails completely due to duplicate entries.
✅ Gas fees are wasted and no collateral tokens are registered.
Before executing _registerCollateralToken, ensure no duplicates exist in the input array.
✅ Ensures no duplicate tokens are processed.
✅ Prevents transaction failures due to duplicate entries.
✅ Enhances batch transaction reliability.
✅ Prevents re-registering existing collateral tokens.
✅ **Ensures protocol data integrity remains intact. **
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.