Use of deprecated Chainlink API
The contract uses Chainlink's deprecated latestAnswer() function, which could stop working if Chainlink removes support. This would prevent the protocol from obtaining prices, causing it to halt and requiring redeployment.
Submitted by 0xRajeev, also found by cmichel and leastwood.
Impact
The contract uses Chainlink’s deprecated API latestAnswer(). Such functions might suddenly stop working if Chainlink stopped supporting deprecated APIs.
Impact: Deprecated API stops working. Prices cannot be obtained. Protocol stops and contracts have to be redeployed.
See similar Low-severity finding L11 from OpenZeppelin’s Audit of Opyn Gamma Protocol: https://blog.openzeppelin.com/opyn-gamma-protocol-audit/
This was a Medium-severity finding even in the previous version of WildCredit contest as well: https://github.com/code-423n4/2021-07-wildcredit-findings/issues/75 where it was reported that ”latestAnswer method will return the last value, but you won’t be able to check if the data is fresh. On the other hand, calling the method latestRoundData allows you to run some extra validations.”
Proof of Concept
See https://docs.chain.link/docs/deprecated-aggregatorinterface-api-reference/#latestanswer.
Tools Used
Manual Analysis
Recommended Mitigation Steps
Use V3 interface functions: https://docs.chain.link/docs/price-feeds-api-reference/
talegift (Wild Credit) acknowledged::
We’ll remove dependence on Chainlink completely.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the contract uses a deprecated Chainlink API function (latestAnswer) instead of the current recommended function (latestRoundData), which could be removed without notice.
Impact
If Chainlink stops supporting the deprecated API, the protocol cannot obtain prices and must be redeployed.
What the attacker needed
Chainlink discontinues the deprecated API
The fix
The contract should be updated to use the current Chainlink interface functions, such as latestRoundData, instead of the deprecated latestAnswer.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract relies on an outside service (Chainlink) to get price data. It uses an old, deprecated function that the service might turn off. If that happens, the contract can't get prices and stops working.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.