The keeperProxy::_check function assumes that all Chainlink price feeds return values scaled to 8 decimals by hardcoding the adjustment with the expression price = price / 10 ** (decimals - 8). This assumption is not universally valid, as Chainlink aggregators can be configured to use a different number of decimals. Hardcoding this value can lead to inaccurate price comparisons if a price feed uses a different decimal format.
Issue:
The function incorrectly assumes that all Chainlink price feeds are scaled to 8 decimals by using the expression price / 10 ** (decimals - 8).
In practice, while many Chainlink aggregators do use 8 decimals, this is not guaranteed across all deployments. Different feeds might use different decimal scales.
This hardcoding could lead to incorrect price normalization, which in turn might cause valid price differences to exceed the threshold or vice versa, potentially leading to erroneous reverts in the _check function.
Inaccurate Price Validation:
The reliance on a fixed 8-decimal format could cause the calculated price difference to be incorrect. This may lead to transactions being reverted due to "price offset too big" errors even when the price difference is within acceptable limits.
Limited Flexibility:
The contract becomes less robust to changes in the underlying price feed configurations, reducing its adaptability to different Chainlink deployments.
manual review
Dynamic Decimal Adjustment:
Instead of hardcoding the price feed decimals, retrieve the decimal value directly from the Chainlink aggregator using the decimals() function. For example:
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point. Keepers are added by the admin, there is no "malicious keeper" and if there is a problem in those keepers, that's out of scope. ReadMe and known issues states: " * System relies heavily on keeper for executing trades * Single keeper point of failure if not properly distributed * Malicious keeper could potentially front-run or delay transactions * Assume that Keeper will always have enough gas to execute transactions. There is a pay execution fee function, but the assumption should be that there's more than enough gas to cover transaction failures, retries, etc * There are two spot swap functionalies: (1) using GMX swap and (2) using Paraswap. We can assume that any swap failure will be retried until success. " " * Heavy dependency on GMX protocol functioning correctly * Owner can update GMX-related addresses * Changes in GMX protocol could impact system operations * We can assume that the GMX keeper won't misbehave, delay, or go offline. " "Issues related to GMX Keepers being DOS'd or losing functionality would be considered invalid."
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.