Open code423n4 opened 1 year ago
trust1995 changed the severity to QA (Quality Assurance)
Does not meet the impact requirements of medium severity.
trust1995 marked the issue as grade-b
0xBebis marked the issue as sponsor disputed
sanitizing swap paths on chain would not be very sensible
Lines of code
https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/ReaperStrategyGranarySupplyOnly.sol#L156-L171 https://github.com/code-423n4/2023-02-ethos/blob/main/Ethos-Vault/contracts/mixins/VeloSolidMixin.sol#L32
Vulnerability details
Impact
The swap steps that are specified within the reaper strategy's
ReaperStrategyGranarySupplyOnly::setHarvestSteps
call are not sanitized as having a validveloSwapPath
defined, thereby permitting a swap step to be defined without a path to execute it and thus causing allReaperStrategyGranarySupplyOnly::_harvestCore
invocations to fail until a swap has been defined due to an arithmetic underflow.This can be taken advantage of when a
ReaperBaseStrategyv4::harvest
transaction has been submitted but not executed yet to cause a DoS deliberately or it can result from misuse or incorrect coordination between transactors.Proof of Concept
To illustrate the issue, the following contract has been devised:
Tools Used
Manual review.
Recommended Mitigation Steps
The
ReaperStrategyGranarySupplyOnly::setHarvestSteps
function should mandate that a validveloSwapPath
has already been defined for the swap steps being introduced to avoid unavailability of the protocol.