Reproduced Exploit

Prophet: ten addresses that never pledged drain a 1,000 BOND NoResolution pot

When a dispute status is NoResolution, claimEscalationReward sets _numberOfPledges to 1 and credits amountPerPledger to whatever address the caller passes. The address does not need a pledge for or against the request. Ten fresh contracts each take 100 BOND and forward it. The accounting contract i…

May 2024•Ethereum•logic•4 min read

Loss

1,000 BOND. Each of 10 addresses receives one 100 BOND pledge without having pledged

Chain

Ethereum

Category

logic

Date

May 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: 41798-dispute-pledges-for-a-noresolution-dispute-can-be-stolen-by. Standalone Foundry PoC and full write-up: 41798-dispute-pledges-for-a-noresolution-dispute-can-be-stolen-by_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/missing-check · vuln/access-control/missing-auth

Key info#

FieldValue
Loss1,000 BOND. Each of 10 addresses receives one 100 BOND pledge without having pledged
Vulnerable contractBondEscalationAccounting.claimEscalationReward
Attacker EOA0x000000000000000000000000000000000000a346
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2024-05
Compilersolc 0.8.27, cancun, via IR
Bug classNoResolution hardcodes the pledge count to 1 for any address

TL;DR#

When a dispute status is NoResolution, claimEscalationReward sets _numberOfPledges to 1 and credits amountPerPledger to whatever address the caller passes. The address does not need a pledge for or against the request. Ten fresh contracts each take 100 BOND and forward it. The accounting contract is left with 0. The control counts real pledges, both of which are 0, and pays nothing.

Background#

Trail of Bits' May 2024 review of Wonderland Prophet, by Tjaden Hess. BondEscalationAccounting lets pledgers withdraw after an escalated dispute resolves. The report's scenario is 1,000 tokens pledged and 100 per account. Eve creates 10 accounts and claims once for each.

The vulnerable code#

SOLIDITY
if (_status == IOracle.DisputeStatus.NoResolution) {
    // @> VULN: NoResolution credits one pledge to any address, pledged or not
    _numberOfPledges = 1;
} else {
    _numberOfPledges = _status == IOracle.DisputeStatus.Won
        ? _result.bondEscalationModule.pledgesForDispute(_requestId, _pledger)
        : _result.bondEscalationModule.pledgesAgainstDispute(_requestId, _pledger);
}

The credit and the pot update use that count:

SOLIDITY
uint256 _claimAmount = _amountPerPledger * _numberOfPledges;
balanceOf[_pledger][_token] += _claimAmount;
unchecked {
    pledges[_disputeId][_token] -= _claimAmount;
}

Root cause#

The NoResolution branch ignores pledgesForDispute and pledgesAgainstDispute. Any unused address is treated as a pledger of exactly one unit. pledgerClaimed only stops the same address from claiming twice.

Preconditions#

  • An escalation result exists. amountPerPledger is 100 BOND and the token is set, so the empty-result revert does not fire.
  • The oracle status for the dispute is NoResolution.
  • The accounting contract holds 1,000 BOND and pledges[dispute][token] is 1,000.
  • The caller is not a module or a real pledger.

Attack walkthrough#

  1. The pot is 1,000 BOND. Ten sock contracts have never pledged.
  2. Each sock calls claimEscalationReward with itself as the pledger.
  3. The status is NoResolution, so the pledge count is forced to 1 and 100 BOND is credited.
  4. withdraw pays that credit and the sock forwards it to the attacker.
  5. After ten calls the attacker holds 1,000 BOND and the pot is 0.
  6. The control adds pledgesForDispute and pledgesAgainstDispute. Both are 0, so the same call pays nothing and the pot stays 1,000.

Diagrams#

flowchart TD A["NoResolution dispute holds 1,000 BOND"] --> B["claimEscalationReward is passed a fresh address"] B --> C["VULN sets the pledge count to 1"] C --> D["100 BOND is credited and the pot drops by 100"] D --> E["withdraw pays the credit to that address"] E --> F["Ten addresses forward 1,000 BOND to the attacker"] B --> G["Control sums pledges for and against"] G --> H["Both counts are 0 so the pot stays 1,000"]

Impact#

Anyone can drain the pledge tokens for a NoResolution dispute. In this run the attacker receives the entire 1,000 BOND. Real pledgers are left with a claim against an empty balance. The control pays the attacker 0.

Remediation#

On NoResolution, set the pledge count from pledgesForDispute plus pledgesAgainstDispute for that address, which is the short-term fix in the Trail of Bits report. An address that never pledged then receives 0.

How to reproduce#

BASH
cd 41798-dispute-pledges-for-a-noresolution-dispute-can-be-stolen-by_exp
forge test -vv

test_exploit_ten_addresses_drain_1000_pledges asserts the attacker holds 1,000 BOND and the accounting balance is 0. test_control_zero_pledges_pay_nothing asserts a zero-pledge claim leaves the 1,000 BOND pot in place. Captured output is output.txt.

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.