Reproduced Exploit

Dumont: a spot MONT quote inflates player rewards

getMontPrice is quoteExactInputSingle on the current pool. transferPlayerRewards pays ((houseFee 1e18 8) / 10) / price. Selling 9000 MONT moves the spot quote from 1e6 to 1e4. A 10 USDT house fee then pays 800 MONT instead of 8. The player buys the MONT back. The spot quote is 1e6 again and the pla…

Sep 2024•Other•oracle•3 min read

Loss

A 10 USDT house fee pays 800 MONT instead of 8

Chain

Other

Category

oracle

Date

Sep 2024

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

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: 38016-h-02-mont-price-can-be-manipulated-to-earn-more-rewards-pash. Standalone Foundry PoC and full write-up: 38016-h-02-mont-price-can-be-manipulated-to-earn-more-rewards-pash_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/oracle/spot-price · vuln/logic/reward-calculation

Key info#

FieldValue
LossA 10 USDT house fee pays 800 MONT instead of 8
Vulnerable contractMontRewardManager.transferPlayerRewards
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateLocal synthetic · 2024-09
Compilersolc 0.8.27, cancun, via IR
Bug classReward divides by a Uniswap spot quote

TL;DR#

getMontPrice is quoteExactInputSingle on the current pool. transferPlayerRewards pays ((houseFee * 1e18 * 8) / 10) / price. Selling 9000 MONT moves the spot quote from 1e6 to 1e4. A 10 USDT house fee then pays 800 MONT instead of 8. The player buys the MONT back. The spot quote is 1e6 again and the player holds 9800 MONT.

The vulnerable code#

SOLIDITY
function transferPlayerRewards(address player, uint256 houseFee) external {
    uint256 price = getMontPrice();
    uint256 reward = ((houseFee * 1e18 * 8) / 10) / price;
    mont.transfer(player, reward);
}

getMontPrice reads the pool's spot reserves. A TWAP or a fixed oracle is the report's recommendation.

Root cause#

The reward denominator is a same-block pool quote. The player can move that quote before the reward is paid and trade back after.

Preconditions#

  • The pool quotes 1 MONT at 1e6 before the sale.
  • The player can sell 9000 MONT into that pool and buy it back.
  • A 10 USDT house fee is converted to MONT at the depressed quote.

Attack walkthrough#

  1. The spot quote is 1e6, so a fair reward on 10 USDT is 8 MONT.
  2. The player sells 9000 MONT and the quote falls to 1e4.
  3. The manager pays 800 MONT.
  4. The player buys the sold MONT back. The quote is 1e6 again and the player holds 9800 MONT.

Diagrams#

flowchart TD A["Spot quote is 1e6"] --> B["Player sells 9000 MONT"] B --> C["Quote falls to 1e4"] C --> D["10 USDT house fee pays 800 MONT"] D --> E["Player buys back and holds 9800 MONT"]

Impact#

Rewards denominated in MONT are inflated by the same trade that moves the quote. This run pays 800 MONT instead of 8 and leaves the player with 9800 MONT.

How to reproduce#

BASH
cd 38016-h-02-mont-price-can-be-manipulated-to-earn-more-rewards-pash_exp
forge test -vv

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.