Malicious order keepers can trigger the cancellation of any order, with old blocks
Summary
Malicious order keepers can trigger the cancellation of any order by providing oracle prices from blocks unrelated to the order
Vulnerability Detail
Each order hasitsownrequirementsabout what block ranges it expects. The error handler for each order only allows orders to be retried if the keeper provided empty/invalid prices. The error handlers make no such allowances for invalid blocks.
The order keepers are supposed to be a decentralized network, so it's likely that at some point there will be a bad actor, or one who uses the rules to their advantage, at the expense of other users.
Impact
Orders will be canceled rather than retried by keepers that would have executed the order properly. This may lead to position liquidations.
IllIllI
medium
Malicious order keepers can trigger the cancellation of any order, with old blocks
Summary
Malicious order keepers can trigger the cancellation of any order by providing oracle prices from blocks unrelated to the order
Vulnerability Detail
Each order has its own requirements about what block ranges it expects. The error handler for each order only allows orders to be retried if the keeper provided empty/invalid prices. The error handlers make no such allowances for invalid blocks.
The order keepers are supposed to be a decentralized network, so it's likely that at some point there will be a bad actor, or one who uses the rules to their advantage, at the expense of other users.
Impact
Orders will be canceled rather than retried by keepers that would have executed the order properly. This may lead to position liquidations.
Code Snippet
These are three revert errors that are not caught by the various error handlers:
https://github.com/sherlock-audit/2023-02-gmx/blob/main/gmx-synthetics/contracts/oracle/OracleUtils.sol#L276-L290
Tool used
Manual Review
Recommendation
Add checks for these errors, and make the functions result in a revert rather than a cancellation