Reproduced Exploit
NUTS Finance: A valid large feed price (>~$100k) overflows getPrice()'s plain 256-bit `compositePrice *
Chain
Other
Category
untagged
Date
Jan 1970
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
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. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 62694-arithmetic-overflow-in-getprice-when-feeds-return-large-valu. Standalone Foundry PoC and full write-up: 62694-arithmetic-overflow-in-getprice-when-feeds-return-large-valu_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/locked-funds · vuln/reward-accounting · vuln/price
Reproduction: a faithful minimal reproduction of the vulnerable finding — the vulnerable function is reproduced verbatim (marked
@>) with faithful minimal doubles; local deploy, no fork.
Root cause#
A valid large feed price (>~$100k) overflows getPrice()'s plain 256-bit compositePrice * rate multiply, reverting permanently (Panic 0x11) and freezing every dependent market that must price or liquidate through the oracle — 1000e18 collateral locked in the demo LendingMarket.
(, int256 price,,,) = feed.latestRoundData();
uint256 rate = uint256(price)
* 10**(SCALING_DECIMALS - feed.decimals());
compositePrice = (compositePrice * rate) // @> plain 256-bit multiply: `compositePrice * rate` overflows and reverts once a feed reports a large-but-valid price (> ~$100k), permanently bricking the oracle
/ SCALING_FACTOR; // 36-dec fixed-point
}
Why it's exploitable here#
A valid large feed price (>~$100k) overflows getPrice()'s plain 256-bit compositePrice * rate multiply, reverting permanently (Panic 0x11) and freezing every dependent market that must price or liquidate through the oracle — 1000e18 collateral locked in the demo LendingMarket.
Attack path#
Marked-line walkthrough (Playground)#
The EVM Playground pins each step to the exact executed source line in 0xce01759b82…:
- L169 — Read Chainlink feed price: Pulls the latest
pricefrom the feed vialatestRoundData— the input that can be legitimately very large (e.g. >$100k). - L171 — Scale price to common decimals: Multiplies the feed price up by
10**(SCALING_DECIMALS - feed.decimals()), inflating it further before the composite step. - L172 — Unchecked multiply overflows: Root-cause bug:
compositePrice * rateis a plain 256-bit multiply with no mulDiv/guard, so a large feed value overflows and reverts (Panic 0x11). - L173 — Divide back down — too late: The
/ SCALING_FACTORwould rescale the product, but the overflow already reverted on the multiply above. - L175 — Return composite price: Returns the final
compositePrice— unreachable once the multiply overflows on large inputs. - L183 — The fixed oracle variant: Setup:
ChainlinkOracleCompositeFixedis the corrected contract that uses a safe wide-multiply to avoid the overflow. - L190 — Loop over price feeds: Iterates each configured feed to build the composite price across sources.
PoC#
Registry (Foundry, local deploy — verbatim vulnerable source + harm-asserting test + negative control):
cd 62694-arithmetic-overflow-in-getprice-when-feeds-return-large-valu_exp
forge test -vvv
The browser Playground replays the same synthetic opcode-for-opcode and measures the harm: A valid large feed price (>~$100k) overflows getPrice()'s plain 256-bit compositePrice * rate multiply, reverting permanently (Panic 0x11). Both gates are green (registry forge test PASS + Playground _verify-poc VERDICT: PASS).
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 62694-arithmetic-overflow-in-getprice-when-feeds-return-large-valu_exp (evm-hack-registry mirror).
- AuditVault finding: 62694-arithmetic-overflow-in-getprice-when-feeds-return-large-valu.
- Upstream DeFiHackLabs PoC directory: src/test.
Alerts & third-party analyses
- DeFiHackLabs incident explorer: search "NUTS Finance: A valid large feed price (>~$100k) overflows getPrice()'s plain 256-bit `compositePrice *".
- 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.