# Oracle data feed can be outdated yet used anyways which will impact payment logic

Juicebox's Chainlink price feed used latestRoundData() answer without checking updatedAt staleness, so outdated prices skewed token minting, distributions, allowances and overflow calculations.

- Payout: Contest reward
- Severity: high
- Program: Juicebox
- Credited: 0xNineDec
- Disclosed: 2022-10-11
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-07-juicebox-findings/issues/138
- Library page: https://bugbountylibrary.com/r/c4%3A2022-07-juicebox%3AH-01
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:oracle-manipulation

**Target:** Chainlink V3 price feed adapter (JBChainlinkV3PriceFeed) used by JBPrices and JBSingleTokenPaymentTerminalStore
**Root cause:** JBChainlinkV3PriceFeed.currentPrice() reads only the `answer` from latestRoundData() and ignores `updatedAt`/`answeredInRound`, so a stale or incomplete round is accepted as valid.
**Steps:**
1. Read JBChainlinkV3PriceFeed.currentPrice() at L44: calls `feed.latestRoundData()` and returns only `answer`.
2. Note no comparison of `updatedAt` against `block.timestamp` (no heartbeat tolerance) and no `answeredInRound >= roundId` check.
3. Trace consumers: JBPrices.priceFor() -> JBSingleTokenPaymentTerminalStore.recordPaymentFrom (L387 `_weightRatio`), recordDistributionFor (L585), recordUsedAllowanceOf, _overflowDuring (L827), _currentTotalOverflowOf (L866).
4. When the feed is stale (low volatility heartbeat, upstream outage, volatile market), the outdated `answer` flows into tokenCount, distributedAmount, usedAmount and overflow values.
5. Result: incorrect token minting, distribution amounts, allowance accounting and overflow balances for all projects.
**How found:** Code review of the Chainlink adapter against Chainlink's documented guidance: noticed only `answer` was consumed from latestRoundData() and that the recommended `updatedAt` staleness check and round-completeness check were absent, then traced each downstream consumer of priceFor().
**Escalation:** Miscalculation propagates to every project and every token holder since pricing feeds all payment/distribution/overflow logic.
**Insight:** When auditing oracle adapters, diff the return tuple against Chainlink's documented checks: missing `updatedAt` heartbeat tolerance and `answeredInRound >= roundId` are the two most commonly dropped fields; then enumerate every downstream consumer of the price to size impact.
