IPletherOracle NatSpec contradicts the implementation: snapshot publishTime is the newest component time (since the MED-23 fix), and empty payloads are valid replays
The interface documentation for the Plether oracle contradicts the actual implementation in two ways: it describes the snapshot publish time as the earliest component time when the code stores the newest, and it describes update payloads as non-empty when empty data is accepted as a zero-fee replay. An integrator relying on the documentation could reason incorrectly about price freshness or wrongly assume empty-payload calls are invalid.
Originally disclosed on Immunefi
- Disclosed after under an hour
#97794 [SC-Insight] IPletherOracle NatSpec contradicts the implementation: snapshot publishTime is the newest component time (since the MED-23 fix), and empty payloads are valid replays
Submitted on Nov 3rd 2026 at 08:40:23 UTC by @W3B_SR_0xki for Audit Competition | Plether
- Report ID: #97794
- Report Type: Smart Contract
- Report severity: Insight
- Target: https://github.com/immunefi-team/audit-comp-plether/tree/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src
- Impacts:
Description
Target: packages/perps/src tree at a82d4fefb02768e5b3bddcc97dee371eee24fea8 (interfaces/IPletherOracle.sol, PletherOracle.sol)
Impact: Insight — Documentation improvements
Description
Keepers and integrators code against IPletherOracle. Two parts of its NatSpec no longer describe what PletherOracle does.
1. publishTime is documented as the earliest component time; the code returns the newest
- Interface:
PriceSnapshot.publishTimeandLiquidationBatchSnapshot.publishTimeare documented as the "Earliest component publish time" (interfaces/IPletherOracle.sol:31 and :53). - Implementation:
- The basket builder sets
basket.publishTime = uint64(maxPublishTime)and stores the minimum separately asbasket.oldestPublishTime(PletherOracle.sol:874-875). _snapshotFromBasketcopies the newest time intosnapshot.publishTime(PletherOracle.sol:889). The liquidation snapshots do the same (PletherOracle.sol:294, :319).
- The basket builder sets
- Why it changed: this is the behaviour the Cecuro MED-23 fix introduced ("The live basket's progress marker uses the newest component timestamp"). ORACLE_SYNCHRONIZATION.md:26 agrees ("Its publish time is the newest component time").
- The interface was not updated:
- The same interface still says "Earliest" in both structs.
- Elsewhere it describes the liquidation return value as the "newest publish time" (interfaces/IPletherOracle.sol:320).
- So the interface contradicts itself.
- Consequence:
- The router installs this value as the Engine mark time (
engine.updateMarkPrice(..., snapshot.publishTime), router/OrderLiquidationBatchLogic.sol:610; OrderRouterExecutionSidecar.sol:1058-1059). - An integrator who follows the struct NatSpec will assume every component is at least as new as
publishTime. - In fact a component can be older by up to the configured divergence limit.
- The router installs this value as the Engine mark time (
2. Payloads are documented as "Nonempty", but empty data is a valid zero-fee replay
- Interface:
updateLiquidationBatchPrice,updateLiquidationPrice,updatePrice(address,bytes[])andgetUpdateFeedocumentpythUpdateDataas "Nonempty Pyth update payloads" (interfaces/IPletherOracle.sol:306, :318, :331, :400). - Implementation:
_resolveCurrentBaskettreatspythUpdateData.length == 0as a replay of the accepted live basket (PletherOracle.sol:758-760).getUpdateFeereturns 0 for empty data (PletherOracle.sol:465-466).- The implementation's own NatSpec says "Signed Pyth payloads, or empty for replay" (PletherOracle.sol:195), and ORACLE_SYNCHRONIZATION.md:29-30 documents the empty replay.
- Self-contradiction: the
getUpdateFeeinterface docblock contradicts itself. Its@devsays "Returns zero for an empty replay" (interfaces/IPletherOracle.sol:399), and its@paramsays "Nonempty".
Impact
- No funds are at risk.
- Item 1 misdescribes a value the Engine uses as its mark time, so freshness reasoning built on the interface is wrong.
- Item 2 hides a supported zero-fee path (empty-payload replay) from keepers. It also implies that calls with empty data are invalid.
Recommendation
- Change both
publishTimedescriptions (interfaces/IPletherOracle.sol:31, :53) to "Newest component publish time". Mention that the oldest component may lag it by up to the configured divergence limit. - Change the four
pythUpdateDatadescriptions to "Signed Pyth update payloads, or empty to replay the accepted live basket at zero fee". This matches PletherOracle.sol:195.
Proof of Concept
Proof of Concept
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 interface NatSpec was not updated after a prior fix changed the implementation to use the newest component timestamp and to accept empty payloads as replays.
Impact
No funds are at risk, but integrators may misjudge price freshness and may not know that an empty-payload replay is a supported zero-fee path.
What the attacker needed
None
The fix
The documentation should be corrected so both publishTime descriptions say the newest component time and the payload descriptions mention that empty data replays the accepted live basket at zero fee.
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.
This is a documentation bug, not an exploitable flaw. The written description of how a price oracle works no longer matches the code, so developers building on top of it may make wrong assumptions about how fresh the prices are or whether an empty update is allowed. No money is at risk here.