Use of deprecated Chainlink function latestAnswer
The smart contract used the deprecated Chainlink latestAnswer function, which returns 0 if no answer is available, potentially feeding an incorrect price to the Buoy3Pool. This could cause deposits and withdrawals to stop, halting the protocol.
Submitted by shw
According to Chainlink’s documentation (Deprecated API Reference, Migration Instructions, and API Reference), the latestAnswer function is deprecated. This function does not throw an error if no answer has been reached, but instead returns 0, causing an incorrect price to be fed to the Buoy3Pool. See Buoy3Pool.sol L207 and L214-L216.
Recommend using the latestRoundData function to get the price instead. Also recommend adding checks on the return data with proper revert messages if the price is stale or the round is incomplete, for example:
(uint80 roundID, int256 price, , uint256 timeStamp, uint80 answeredInRound) = oracle.latestRoundData();
require(answeredInRound >= roundID, "...");
require(timeStamp != 0, "...");
kristian-gro (Gro) disagreed with severity:
disagree with severity (Low risk) Issue would cause deposits and withdrawals to stop, no funds lost
kristian-gro (Gro) confirmed:
Confirmed and shares have been removed from release version.
In my opinion halting the protocol deserves medium risk. While no funds are lost, from brand perspective it’s a second worst thing. Keeping as medium risk.
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 use of the deprecated latestAnswer function, which returns 0 instead of reverting when no answer is available, without checks for stale or incomplete rounds.
Impact
Deposits and withdrawals could stop, halting the protocol, but no funds are lost.
What the attacker needed
None
The fix
The project removed the affected shares from the release version, and the recommendation is to use latestRoundData with checks for stale or incomplete rounds.
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 relied on an old way to get price data from Chainlink, which can return zero when no price is available. That zero price could break the pool's calculations and stop people from depositing or withdrawing.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.