The collectFee function in the FeeCollector contract allows anyone to send fees without a minimum amount requirement, enabling a griefing attack where an attacker fragments fee collections into numerous small transactions. This increases gas costs and computational complexity for reward distributions, potentially rendering the distributeCollectedFees function prohibitively expensive or unusable. This fully valid medium-impact, medium-likelihood vulnerability could disrupt protocol revenue distribution.
The collectFee function permits unrestricted fee submissions with no lower bound beyond zero:
Any address can call collectFee with amounts between 1 wei and MAX_FEE_AMOUNT (1M RAAC).
Each call updates the collectedFees struct, tracked separately by feeType, adding accounting entries.
Attack Scenario:
Attacker observes a pending 100,000 RAAC fee distribution.
Repeatedly calls collectFee with 1 wei for various feeType values (e.g., 0-7).
Each call increments collectedFees fields (e.g., protocolFees, lendingFees), increasing the number of non-zero entries processed in _calculateDistribution and _processDistributions.
Gas costs for distributeCollectedFees rise due to iterating over fragmented fees, potentially exceeding block gas limits (e.g., 30M), blocking the $100,000 RAAC distribution.
No minimum amount or rate limiting prevents this, making fragmentation feasible.
The disruption of fee distributions, blocking $100,000 or more in protocol revenue, constitutes a medium-impact issue, as it affects operational efficiency and stakeholder payouts without direct fund loss. The medium likelihood reflects the ease of execution by any party with minimal RAAC (e.g., 1 wei per call), a plausible griefing tactic in a public system, especially targeting high-value distributions.
Static Analysis Tools: Slither identified the unrestricted collectFee entry point and lack of minimum amount checks, flagging potential DoS vectors.
Add a minimum fee amount and batch collection mechanism to prevent fragmentation:
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.