# money-market-contracts/oracle#feed_prices() delayed transaction may disrupt price feeds

Anchor oracle feed_prices stamped last_updated_time with current block time, so delayed feeder transactions stored stale prices as fresh, enabling wrongful liquidations.

- Payout: Audit contest
- Severity: high
- Program: Anchor
- Found by: WatchPug
- Disclosed: 2023-01-18
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-02-anchor-findings/issues/47
- Library page: https://bugbountylibrary.com/r/c4%3A2022-02-anchor%3AH-02
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:solidity technique:source-review vuln:liquidation vuln:oracle-manipulation

**Target:** CosmWasm oracle contract feed_prices endpoint
**Root cause:** feed_prices() accepts only asset and price and always sets last_updated_time to the current block.time, so a transaction delayed in the mempool is recorded as a fresh price regardless of when the price was actually observed.
**Steps:**
1. Read `contracts/money-market-contracts/contracts/oracle/src/contract.rs#L106-L113`: `feed_prices` takes `(asset, price)` and stores `last_updated_time = env.block.time`.
2. Feeder submits `updateMainFeedData()` with ETH=$8,000 while network is congested; tx sits in mempool.
3. Price rebounds to $10,000 and Alice borrows more against her position.
4. Delayed tx lands; contract records $8,000 with current timestamp, treating stale price as fresh.
5. Liquidation logic reads the stale price and liquidates Alice's now-healthy position.
**How found:** Code reading of feed_prices showed no timestamp parameter and unconditional assignment of last_updated_time to block.time; author reasoned about mempool delay scenarios to construct a liquidation sequence.
**Exploitation:** Precondition: congested network or degraded feeder endpoint causing delayed oracle transactions. Attacker (or unlucky user) has a position; when the delayed stale-price tx lands, the protocol values collateral at the stale low price and liquidates the position, causing fund loss to the user.
**Insight:** When an oracle write endpoint derives freshness from block time rather than a caller-supplied observation timestamp, any mempool delay converts stale data into 'fresh' data; check whether the price source timestamp is carried through and validated against a valid_period.
