Summary
The contract allows functions like claimAndSwap
and addRoute
to be called repeatedly without restrictions, introducing risks of asset depletion, gas exhaustion, or operational inefficiencies.
Root Cause
The claimAndSwap
and addRoute
functions lack mechanisms to restrict the frequency of calls. This design oversight permits excessive or repeated executions, exposing the protocol to abuse and inefficiencies.
The claimAndSwap
function:
The addRoute
function:
Setup: A Keeper calls claimAndSwap
repeatedly in rapid succession.
Execution: Each call interacts with the transmuter
and router
, potentially exploiting slippage or timing conditions.
Impact: Rapid depletion of protocol assets or excessive gas consumption, leading to financial losses and operational inefficiencies.
Setup: A Manager repeatedly calls addRoute
to add numerous routes.
Execution: The nRoutes
counter grows unbounded, filling mappings with excessive data.
Impact: Storage bloat and operational delays due to high gas costs, potentially leading to DoS conditions.
Setup: Repeated calls to critical functions like claimAndSwap
within a single transaction.
Execution: Excessive operations exhaust the gas limit, causing transaction failures.
Impact: Disruption of protocol operations and inability to process legitimate user requests.
Operational Risk: Gas exhaustion disrupts protocol functionality, affecting user experience and trust.
Financial Risk: Rapid or excessive function calls can lead to fund depletion and reduced profitability.
Exploitation Risk: Malicious actors exploit unrestricted access to manipulate or overload the system.
Deploy the contract.
Call claimAndSwap
repeatedly in a single block using high gas fees to prioritize execution.
Observe gas exhaustion or fund depletion due to lack of rate-limiting.
Repeated calls to claimAndSwap
within the cooldown period are blocked with an appropriate error message.
Attempting to add routes beyond the maximum limit is restricted, maintaining operational efficiency.
Mitigation Recommendations
Introduce cooldown periods to limit the frequency of function calls:
For addRoute
, implement constraints to ensure the number of routes stays manageable:
Track and log function usage to identify patterns of abuse or inefficiencies:
Use events to log each call to claimAndSwap
or addRoute
.
Implement monitoring dashboards to analyze function call frequency.
Require multi-signature approval or a governance vote for adding or modifying routes to enhance security and accountability.
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.