Skip to content
Monpediaby Unity Nodes
OpenIssue

monad-rpc: eth_createAccessList on private domain routes allows state_overrides bypass and leaks touched storage keys

by aa755Created Nov 18, 2026category-labs/monad-bft

ReferencesMIP-8

Problem

On private domain RPC routes (/domain/{chain_id}), an unauthorized user must not be able to read other users' confidential contract storage (such as ERC-20 token balances) or inspect which private contracts and storage slots are touched inside another contract's execution.

On kai/domains-latest (monad-rpc/src/handlers/mod.rs and access.rs), eth_createAccessList is classified DomainPolicy::OwnDataOnly — and access.rs's module doc table explicitly states that eth_createAccessList rejects state_overrides — yet the handler exposes two privacy leaks:

  1. Full 256-bit private storage extraction via state_overrides: Unlike eth_call and eth_estimateGas (which call caller.restrict_call and reject state_overrides), eth_createAccessList calls caller.run_as_signer and forwards caller-supplied state_overrides straight into EVM simulation. Any authenticated user can override DomainSpoke's code to disable canCall and read any 256-bit secret out of any contract's storage via the returned storageKeys.
  2. Internal call-graph and storage-slot leakage without overrides: Even when state_overrides are rejected, eth_createAccessList runs AccessListTracer and returns every (address, storageKeys) pair touched across all downstream contracts during an allowed call (including reverted subframes), exposing internal contract dependencies and secret-dependent storage keys.

Concrete Attack Example

Suppose Bob holds 7,450,000 (0x71ad90) tokens in a private BridgedERC20 / TestERC20 contract whose DomainAccessRules policy restricts balanceOf(Bob) (SubjectMatch on word 0) so only Bob can read his balance.

Mallory (an ordinary user with 0 tokens and no reader permissions) sends one off-chain eth_createAccessList request to an unused address 0xdEaD, attaching state_overrides:

  1. state_overrides[spoke].code: minimal stateless policy returning true for every canCall(...) (disabling contract access control during the simulation).
  2. state_overrides[0xdEaD].code: minimal probe contract that calls token.balanceOf(Bob) to obtain bal = 7,450,000 and executes assembly { touched := sload(bal) } on 0xdEaD's own storage.

eth_createAccessList succeeds at zero cost (leaving no on-chain trace) and returns:

{
  "address": "0x000000000000000000000000000000000000dead",
  "storageKeys": [
    "0x000000000000000000000000000000000000000000000000000000000071ad90"
  ]
}

handing Mallory Bob's exact 256-bit balance (0x71ad90 = 7,450,000).

Even if state_overrides are blocked, if Mallory invokes any router/contract method she is allowed to call via eth_createAccessList, the response still lists every downstream private contract address and storageKey touched internally along the call path.


Mechanism & What Is Wrong

On kai/domains-latest (930ea79af436):

  • monad-rpc/src/handlers/access.rs:28 documents:

    | `eth_call`, `eth_estimateGas`, `eth_createAccessList`, `eth_fillTransaction` | `from` is replaced by the signer; state overrides are rejected |

  • eth_call (monad-rpc/src/handlers/mod.rs:495–499) and eth_estimateGas (mod.rs:582–584) call caller.restrict_call(&mut params.transaction, &params.state_overrides)? (access.rs:172–183), which rejects non-empty state_overrides with -32007 Forbidden ("state overrides are not allowed on domain routes").
  • eth_createAccessList (monad-rpc/src/handlers/mod.rs:638–647) mistakenly calls caller.run_as_signer(&mut params.transaction) instead, overlooking MonadCreateAccessListParams.state_overrides (monad-rpc/src/handlers/eth/call.rs:539–546) and forwarding caller-supplied code/storage overrides straight into prepare_eth_call (call.rs:908–935).
  • AccessListTracer::encode (category/execution/ethereum/trace/state_tracer.cpp:196–305 in category-labs/monad) retains transaction.to (0xdEaD) whenever storage_keys is non-empty (and touching a single slot on a stateless probe account also bypasses MIP-8 page deduplication), and emits all touched (address, storageKeys) across accepted and rejected frames without checking whether the caller is authorized to inspect those contracts' storage.

Suggested Fix

  1. Immediate bug fix: Replace caller.run_as_signer(&mut params.transaction) with caller.restrict_call(&mut params.transaction, &params.state_overrides)? in eth_createAccessList (monad-rpc/src/handlers/mod.rs:645).
  2. Design hardening: Because AccessListTracer inherently exposes internal cross-contract addresses and storage keys (and private domain transactions are gasless on the domain anyway), consider moving EnabledMethod::eth_createAccessList from DomainPolicy::OwnDataOnly to DomainPolicy::OperatorOnly (mod.rs:1240), matching debug_traceCall.

Created by Gemini Carbon on behalf of @aa755.