Skip to content
Smart contracts Audit finding Intermediate

IPletherOracle.PriceSnapshot.publishTime is documented as the earliest component publish time, but the implementation returns the newest

The oracle's snapshot getter returns the newest component publish time, while its documentation says the field is the earliest component publish time. A consumer trusting the documentation would treat the basket as fresher than its weakest component, making staleness checks optimistic rather than conservative.

crypt0n1337 Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#99199 [SC-Insight] IPletherOracle.PriceSnapshot.publishTime is documented as the earliest component publish time, but the implementation returns the newest

Submitted on Nov 12th 2026 at 11:18:12 UTC by @crypt0n1337 for Audit Competition | Plether

Description

IPletherOracle.PriceSnapshot.publishTime is documented as the earliest component publish time, but PletherOracle returns the newest. The getter builds the snapshot at PletherOracle.sol:874, where the publish time is taken from the newest component rather than the oldest, so a caller who trusts the NatSpec and treats the value as the oldest data in this basket will underestimate the freshness of the basket, not overestimate it.

The distinction matters wherever the snapshot is used as a freshness input. A consumer that compares publishTime against its own staleness bound expects the value to be the conservative one, the oldest component, because that is the component most likely to be stale. Receiving the newest makes the basket look fresher than its weakest component, which is the opposite of the conservative reading.

No value moves on this path: the snapshot is a read surface, and the execution paths apply their own staleness and divergence checks against the components directly. The finding is therefore documentation and API semantics, the same class as the ClosePreview fee field, and it is worth correcting because integrations that display or gate on this field will be systematically optimistic.

Recommendation: either change the getter to return the earliest component publish time as documented, or correct the NatSpec to state that the field is the newest component publish time and, if the conservative value is useful, expose the earliest as a separate field.

Proof of Concept

This is a read-surface semantics insight, so the reproduction compares the documented meaning with the returned value.

Step 1. Construct a basket whose components have different publish times, for example one at t0 and one at t0+10 seconds, and accept it.

Step 2. Call the snapshot getter on the oracle and read publishTime.

Step 3. Compare with the component publish times. The returned value equals the newest component (t0+10), while the NatSpec on IPletherOracle.PriceSnapshot describes the field as the earliest (t0).

Step 4. The consequence is directional: a consumer that treats the field as the conservative oldest-data bound will consider the basket fresher than its weakest component by up to the divergence window, which is exactly the wrong direction for a staleness gate.

Suggested fix verification: after the fix, either the returned value should equal the earliest component (t0) and match the NatSpec, or the NatSpec should say newest and the tests should assert t0+10 so the documented meaning is pinned.

The original report as published on Immunefi, by crypt0n1337. 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 getter picks the newest component publish time when building the snapshot, contradicting the NatSpec that describes the field as the earliest component publish time.

Impact

No funds move on this path, but integrations that display or gate on the field could treat the basket as fresher than its weakest component, which is the wrong direction for a staleness check.

What the attacker needed

A basket with components of differing publish times

The fix

Either the getter should return the earliest component publish time as documented, or the NatSpec should state that the field is the newest component publish time, with the earliest exposed separately if useful.

How it was found

  1. Build a basket whose components have different publish times, for example one at t0 and one ten seconds later, and accept it.
  2. Call the snapshot getter on the oracle and read the publish time.
  3. Compare the returned value with the component publish times; it equals the newest component rather than the earliest as documented.

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.

An oracle is a contract that feeds outside data, such as prices, into a smart contract. Here the price data is built from several parts, each with its own timestamp, and the code returns the newest timestamp while the written documentation promises the oldest one. Anyone who reads the documentation and relies on that value would think the data is fresher than it really is.

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 crypt0n1337

View all

23 more disclosed reports, best first.

More from Plether

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.