The StrategyMainnet:: addRoute
function does not validate the provided _route
paths for correctness. This could lead to invalid or malicious routes being stored and later used in critical operations such as StrategyMainnet:: claimAndSwap
. If _route
is incorrect, it can cause transaction failures or asset mismanagement during swaps, impacting the functionality of the protocol.
The _route
parameter in the StrategyMainnet:: addRoute
function is an array of 11 addresses used to define the swap path. The first address should always represent the input token (in this contract, WETH), and the last valid non-zero address should represent the output token (in this contract, alETH). Intermediate addresses represent pools or zaps. Unused array slots must be filled with ZERO_ADDRESS
.
However, the contract does not validate the following:
Whether the first address in _route
is indeed the input token.
Whether the last valid non-zero address is the output token.
Without these validations, a misconfigured _route
could be added, potentially causing subsequent operations like StrategyMainnet::claimAndSwap
to fail or behave unpredictably. For example, if _route
contains invalid or mismatched tokens, the router.exchange
call in StrategyMainnet::claimAndSwap
might revert, leading to functional disruptions.
Due to the lack of validation for the _route
parameter, the management could inadvertently configure an incorrect route, causing subsequent functionalities (such as claimAndSwap
) to fail. This could lead to the following consequences:
Operational Disruption: The StrategyMainnet:: claimAndSwap
function might fail, affecting the normal operation of the system.
Financial Loss: An incorrect _route
might result in unexpected token swaps or misdirected funds.
Security Risk: While only managers can call the StrategyMainnet:: addRoute
function, misconfigured routes might introduce unintended risks, especially in complex trading scenarios.
Manual
Add validation logic for the _route
parameter in the StrategyMainnet:: addRoute
function to ensure the validity of the input token (first address) and the output token (last non-zero address).
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.