Skip to content
Audit finding Intermediate

Chainlink pricer is using a deprecated API

The smart contracts used Chainlink's deprecated latestAnswer function to fetch asset prices, which could stop working or return stale data. An attacker could exploit stale prices to manipulate the vault, though the report does not detail a specific attack.

cccz Follow

Originally disclosed on Code4rena

Submitted by cccz, also found by 0xDjango, 0xkatana, berndartmueller, Cr4ckM3, defsec, horsefacts, hyh, JMukesh, joshie, Jujic, pedroais, peritoflores, rayn, reassor, Ruhum, and WatchPug

According to Chainlink’s documentation, the latestAnswer function is deprecated. This function might suddenly stop working if Chainlink stops supporting deprecated APIs. And the old API can return stale data.

Proof of Concept

FungibleAssetVaultForDAO.sol#L105 NFTVault.sol#L459

Recommended Mitigation Steps

Use the latestRoundData function to get the price instead. Add checks on the return data with proper revert messages if the price is stale or the round is uncomplete. https://docs.chain.link/docs/price-feeds-api-reference/

spaghettieth (JPEG’d) confirmed

spaghettieth (JPEG’d) resolved and commented:

Fixed in jpegd/core#9.


The original report as published on Code4rena, by cccz. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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 contracts called Chainlink's deprecated latestAnswer function without checking whether the returned price was stale or the round was incomplete.

Impact

The price feed could return stale data or stop working, potentially allowing an attacker to exploit incorrect prices, though the report does not demonstrate a concrete exploit.

What the attacker needed

None

The fix

The issue was fixed by switching to the latestRoundData function and adding 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 price oracle is a service that gives a smart contract the current price of an asset. This project used an old, deprecated way to ask the oracle for the price, which might give outdated information or stop working entirely. That could let someone take advantage of the wrong price.

More by cccz

View all

104 more disclosed reports, best first.

More from JPEG'd contest

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.