In the natspec of ILogAutomation::performUpkeep it is instructed that, the input to this method should not be trusted and the input data should be validated but MarketOrderKeeper::performUpkeep function lacks this validation.
In MarketOrderKeeper::performUpkeep function the input performData parameter is processed without any validation as instructed in the natspec of this function in ILogAutomation. Natspec also mentions that, there is no guarantee that the data passed in is the performData returned from checkUpkeep.
I know that we are blindly trusting this data because we have impelmented onlyForwarder modifier to this function. Although this also results in another bug that I will submit in another report.
Source: MarketOrderKeeper.sol#L162C1-L170C6
This vulnerability could result into execution of malicious and incorrect market orders that can further result into financial losses to the protocol.
Manual review
Source: (ILogAutomation.sol#L50C1-L66C65)[https://github.com/Cyfrin/2024-07-zaros/blob/d687fe96bb7ace8652778797052a38763fbcbb1b/src/external/chainlink/interfaces/ILogAutomation.sol#L50C1-L66C65]
When extracting the tradingAccountId from the extraData, it should be validated that the account is legit, like it actually exists and created the respective market order. Furthermore, the contents of the decoded signedReport should also be validated before passing as param into fillMarketOrder function.
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.