Skip to content
Smart contracts Audit finding Intermediate

Oracle functions mislead integrators as it is not compatible with Chainlink Price feed behaviour

Spectra's oracles implement the Chainlink AggregatorV3Interface but do not behave like a real Chainlink price feed: getRoundData ignores the roundId and returns the same data as latestRoundData, and the roundId, startedAt, updatedAt and answeredInRound fields are always zero. Integrators who follow Chainlink's guidance would treat the returned price as invalid and could be misled about historical rounds.

holydevoti0n Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#43314 [SC-Insight] Oracle functions mislead integrators as it is not compatible with Chainlink Price feed behaviour

Submitted on Apr 4th 2025 at 14:14:13 UTC by @holydevoti0n for Audit Comp | Spectra Finance

Description

Vulnerability Details

All the new oracles from Spectra inherits from AggregatorV3Interface which is the Chainlink interface for price feeds. Problem is all oracles from Spectra that implement this interface do not behave as expected for a Chainlink Price Feed Integration.

First issue is:

Solidity
    function getRoundData(
        uint80
    )
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        )
    {          // @audit - `latestRoundData` return same output, regardless of the input passed in `getRoundData`
@>        return (0, int256(_getQuoteAmount()), 0, 0, 0);
    }


    /** @dev See {AggregatorV3Interface-latestRoundData}. */
    function latestRoundData()
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        )
    {        // @audit - `latestRoundData` and `getRoundData` return same output, regardless of the input passed in `getRoundData`
@>        return (0, int256(_getQuoteAmount()), 0, 0, 0);
    }
  • Second issue is that: the returned variables roundId, startedAt, updatedAt and answeredInRound are always zero. Integrators use those variables to check whether the current price is still valid. As Spectra always returns those variables with the value 0, this means the current price being returned is INVALID.

You can see this is the Chainlink recommendation for consuming valid price from the price feed oracles: https://docs.chain.link/data-feeds#check-the-timestamp-of-the-latest-answer

So Spectra implements Chainlink Price Feed interface for an oracle that do not reflect the Chainlink Implementation's behaviour.

Impact Details

  • The current implementation always returns an "invalid price" according to Chainlink, which will mislead integrators to avoid using Spectra's oracles.
  • getRoundData will mislead integrators that wants to check specific rounds for prices as this function works exactly as latestRoundData returning the latest price.

Recommendation

Spectra should not use AggregatorV3Interface to its oracles as they are not reflecting a Chainlink Price Feed.

Spectra should create a specific interface based on its current implementation and remove the Chainlink functions completely.

Proof of Concept

Proof of Concept

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

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 oracle reused the Chainlink AggregatorV3Interface without implementing its round and timestamp semantics, returning hardcoded zeros and ignoring the roundId argument.

Impact

Integrators following Chainlink's guidance would see the price as invalid and may avoid Spectra's oracles, and getRoundData could mislead anyone trying to read a specific historical round.

What the attacker needed

Integrator consumes the oracle via Chainlink interface

The fix

Spectra should stop using AggregatorV3Interface and define its own interface matching its actual behaviour, removing the Chainlink functions.

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 contract that tells other contracts what an asset is worth. Many projects expect oracles to follow Chainlink's standard interface, which includes extra fields such as when the price was last updated. Here the oracle uses that standard interface but fills those fields with zeros and ignores the requested round, so anyone relying on the standard checks would think the price is stale or invalid.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by holydevoti0n

View all

28 more disclosed reports, best first.

More from Spectra Finance

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.