The MultiHopOracle contract exhibits a critical architectural vulnerability in its immutable design structure. Upon inspection, the contract's core implementation reveals a complete absence of administrative capabilities or safety mechanisms:
The architectural design creates an inflexible system where oracle configurations become permanent upon deployment. This rigidity manifests in the contract's inability to adapt to security incidents or respond to market anomalies. The absence of administrative interfaces prevents any form of oracle management, while the lack of circuit breaker mechanisms leaves the system vulnerable during critical failures.
Within QuantAMM's TFMM framework, this vulnerability poses systemic risks as oracle reliability directly impacts pool operations. The immutable nature of the contract creates a scenario where compromised oracles remain active indefinitely, price validation remains static, and emergency situations cannot be addressed without complete system redeployment. This architectural limitation extends beyond mere operational constraints - it represents a fundamental security risk where the system must continue operating with known vulnerabilities until a full migration occurs.
The impact permeates through multiple layers of the QuantAMM ecosystem. A compromised oracle in a widely-used path could trigger cascading failures across interconnected pools, with no mechanism available for emergency intervention or graceful degradation. The absence of bounds checking on oracle prices compounds this risk, as there's no way to filter out obviously manipulated values, while the lack of pause functionality means the system must continue processing potentially harmful data even when issues are identified.
Consider this scenario:
Alice notices that the Chainlink oracle for ETH/USD starts reporting obviously incorrect prices
Bob, a protocol admin:
Identifies the compromised oracle
Wants to switch to a backup oracle source
Cannot modify the oracle path due to lack of admin functions
Charlie, another admin:
Tries to pause affected pools to prevent losses
Discovers no emergency pause functionality exists
Meanwhile:
Pools continue using corrupted price data
Users execute trades at incorrect prices
Strategy calculations use wrong inputs
The protocol team:
Must rush to deploy new oracle contracts
Has to coordinate emergency migration of all affected pools
Faces significant operational risks during migration
During the entire migration process:
The system continues operating with known bad data
No way to pause or halt operations
Users continue to be exposed to risk
Several pools suffer losses before migration can be completed
The incident highlights the critical need for administrative controls and circuit breakers
Implement OpenZeppelin's AccessControl:
Add emergency functions:
Add price validation bounds:
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.