Reproduced Exploit

BondEscalationAccounting — a self-created request drains the pledge escrow

onlyAllowedModule asks the oracle whether msg.sender is a module on the request. Anyone can create a request and list their own address. releasePledge then treats that caller as authorized and transfers the dispute's pledge escrow. A request that lists someone else reverts. An accounting contract t…

May 2024•Other•access-control•2 min read

Chain

Other

Category

access-control

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: 41794-ineective-access-control-can-lead-to-user-funds-being-stolen. Standalone Foundry PoC and full write-up: 41794-ineective-access-control-can-lead-to-user-funds-being-stolen_exp in the evm-hack-registry mirror.


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

Key info#

ProtocolWonderland Prophet
FindingTrail of Bits, AuditVault 41794
Vulnerable codeonlyAllowedModule
HarmThe caller takes 100000 USDC of pledges. An unlisted request and a fixed module both revert.
Chainlocal synthetic

TL;DR#

onlyAllowedModule asks the oracle whether msg.sender is a module on the request. Anyone can create a request and list their own address. releasePledge then treats that caller as authorized and transfers the dispute's pledge escrow. A request that lists someone else reverts. An accounting contract that accepts only one fixed module also reverts, and its 100000 stays put.

The vulnerable code#

SOLIDITY
modifier onlyAllowedModule(bytes32 _requestId) {
    if (!ORACLE.allowedModule(_requestId, msg.sender)) revert AccountingExtension_UnauthorizedModule();
    _;
}

allowedModule is true when the address was stored on that request. createRequest is permissionless.

Root cause#

The modifier proves only that the caller wrote themselves onto some request. It does not prove that the caller is the dispute module the pledgers used.

Preconditions#

The accounting contract holds 100000 of pledged tokens. The attacker creates a request id and passes their own address as the module. releasePledge is external and guarded only by onlyAllowedModule.

Attack walkthrough#

  1. The attacker calls createRequest with their own address.
  2. allowedModule returns true for that pair.
  3. releasePledge runs the modifier, passes, and transfers 100000 to the attacker.
  4. The same function with a request that lists a different module reverts.
  5. The control accounting accepts only one hardcoded module. The call reverts and the 100000 remains.

Diagrams#

flowchart TD A["Attacker creates a request"] --> B["Oracle lists the attacker"] B --> C["VULN: onlyAllowedModule passes"] C --> D["releasePledge sends 100000"] D --> E["Unlisted request and fixed module revert"]

Impact#

Pledgers lose the 100000 USDC held for the dispute. The attacker receives it in one call. Requests that do not list the attacker, and a module allowlist of one address, do not pay.

Remediation#

Do not derive module authorization from a request anyone can create. Pin the module addresses at deployment, as the review recommends.

How to reproduce#

BASH
cd 41794-ineective-access-control-can-lead-to-user-funds-being-stolen_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.