Reproduced Exploit

A rejected price update still moves cumulativePrice

updatePrice adds averagePrice * elapsedTime into cumulativePrice, then computes the average, then rejects the update when currentPrice is outside maxSlippage. The add is already stored when the function returns false.

Jan 2026•Ethereum•oracle•2 min read

Loss

cumulativePrice ends at 40,000. The same two updates write 30,000 when the add waits for the check

Chain

Ethereum

Category

oracle

Date

Jan 2026

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

The attack replays in your browser. Step through it by Solidity line or by opcode.

The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 65739-h-11-cumulativeprice-is-corrupted-when-price-updates-are-rej. Standalone Foundry PoC and full write-up: 65739-h-11-cumulativeprice-is-corrupted-when-price-updates-are-rej_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/oracle/cumulative-price · vuln/logic/check-order

Key info#

FieldValue
LosscumulativePrice ends at 40,000. The same two updates write 30,000 when the add waits for the check
Vulnerable contractOracle.updatePrice
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit at 0x15452ec016c4dc8c549e7fe6ff4b26324ea8b7a4
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2026-01
Compilersolc 0.8.27, cancun, via IR
Bug classcumulativePrice += averagePrice * elapsedTime runs before the slippage check returns false
flowchart TD A["cumulativePrice is 10,000 and averagePrice is 100"] --> B["After 100 seconds updatePrice is called with price 200"] B --> C["VULN cumulativePrice becomes 20,000 before the 10 percent check"] C --> D["The check rejects 200 and the extra 10,000 stays"] D --> E["The next update at price 105 stores 40,000"] C --> F["Control writes the add only after the check passes"] F --> G["The same second update stores 30,000"]

TL;DR#

updatePrice adds averagePrice * elapsedTime into cumulativePrice, then computes the average, then rejects the update when currentPrice is outside maxSlippage. The add is already stored when the function returns false.

The finding's numbers are the inputs. cumulativePrice starts at 10,000, averagePrice at 100, and maxSlippage is 10. After 100 seconds a price of 200 is rejected, and cumulativePrice is 20,000. After another 100 seconds a price of 105 is accepted and cumulativePrice is 40,000. The control keeps 10,000 on the rejected call and stores 30,000 on the accepted call. The gap is the finding's extra 10,000.

The vulnerable code#

SOLIDITY
lastElapsed = elapsedTime;
cumulativePrice += averagePrice * elapsedTime; // @> VULN: a rejected update still keeps this add
computedAverage = average;
lastAccepted = false;

Impact#

Every later TWAP is computed from a cumulative that includes the rejected interval. The worked example is 40,000 against the control's 30,000.

How to reproduce#

BASH
cd 65739-h-11-cumulativeprice-is-corrupted-when-price-updates-are-rej_exp
forge test -vv

test_exploit_rejected_update_leaves_40000 asserts cumulativePrice 40,000 and a 10,000 marker. test_control_rejected_update_lands_on_30000 asserts the rejected call leaves 10,000 and the accepted call stores 30,000.

Sources#


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.