The MultiHopOracle contract's constructor lacks validation for empty oracle arrays, allowing deployment of an unusable contract state. This oversight creates a permanent vulnerability where the core _getData() function will consistently revert due to array access on an empty array.
Here's the vulnerable constructor code:
When this constructor is called with an empty array, it completes successfully. However, the first line of _getData() will always revert:
The constructor accepts any array length without validation, including zero-length arrays. This violates the core assumption of the _getData() function, which requires at least one oracle to operate.
The contract can be deployed in an permanently unusable state. Because the constructor only runs once upon deployment, this condition cannot be fixed post-deployment.
Manual review
Here's the corrected constructor with proper validation:
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.