Manager writes L2 address records to mainnet-derived coin types while the Explorer reads Sepolia-derived ones, so all five L2 rows render the owner's coin-60 address and a sender's
The Manager writes L2 address records under mainnet-derived ENSIP-11 coin types while the Explorer reads Sepolia-derived ones, so every L2 row falls back to the owner's coin-60 address. A sender paying that displayed address on the L2 can strand funds permanently when the coin-60 record is a smart account with no code or key on that chain.
- Disclosed after under an hour
93029 w a high manager writes l2 address records to mainnet derived coin types while the explorer reads sepolia derived ones so all five l2 rows render the owner s coin 60 address and a sender s
Submitted on Sep 14th 2026 at 01:10:35 UTC by @kwaro for Audit Competition | ENS
- Report ID: #93029
- Report Type: Websites & Apps
- Report severity: High
- Target: https://github.com/immunefi-team/audit-comp-ens/tree/audit-comp-ready/apps/manager
- Impacts:
- Causing the application to display or pre-fill an incorrect address, name, or transaction detail, so that a user sends funds or submits a transaction to an unintended recipient, such as: - resolving or rendering an ENS name to an attacker-controlled address - showing the wrong recipient or amount on a transaction the user then approves
Description
Brief/Intro
The Explorer's address page shows five L2 rows (Optimism, Arbitrum, Base, Linea and Scroll) and keys each one on a Sepolia chain id. That is correct for this deployment, and the source comment says so. The Manager offers the owner a slot for each of those five networks and keys each one on the mainnet chain id instead. An L2 address set in the Manager therefore goes into a coin type the Explorer never reads. Each L2 row falls back to the ENSIP-19 default and shows the owner's coin-60 address. Someone reading that page pays it on the L2. When the owner's coin-60 record is a smart account, which is a contract address, there is no code at that address on the L2 and no private key for it, so the payment cannot be recovered.
Vulnerability Details
All paths are at pin 1c9b47f18fcddd2e864dfe385c4171061c9811ae.
1. The Explorer keys its five L2 rows on Sepolia chain ids, on purpose
apps/portal/src/features/forward-resolution/components/AddressResolution/networks.ts:12-17
/**
* ENSIP-11 / SLIP-44 coin type the address record is keyed on. The explorer
* runs against Sepolia, so L2 coin types derive from the TESTNET chain ids
* (e.g. Base → `0x80000000 | 84532`) — that's what the deployed Sepolia
* UniversalResolver / L2 reverse registrars verify against.
*/
The row set is L2_CHAIN_IDS = [10, 42161, 8453, 59144, 534352] (networks.ts:29). Each row is built with getCoinTypeForReverseRegistrarChainId(chainId, 'sepolia') (:44-46). For a Sepolia deployment this is the right choice.
2. The Manager offers a slot for each of those five, keyed on mainnet
Three of them come from the curated L2 button list at apps/manager/src/features/profile/components/dialogs/edit-profile/tabs/addresses/addressPickerRecords.ts:21-28:
export const evmChainOptions: readonly AddressOption[] = [
{ coinType: 2147483658, label: 'Optimism' },
{ coinType: 2147492101, label: 'Base' },
{ coinType: 2147525809, label: 'Arbitrum' },
{ coinType: 2147483972, label: 'ZKsync' },
{ coinType: 2147483785, label: 'Polygon' },
{ coinType: BSC_COIN_TYPE, label: 'BNB' },
]
The other two, Linea and Scroll, are reached through the "Add More" dialog on the same tab. ChainPickerDialog.tsx:58-59 calls getPickerRecordGroups (addressPickerRecords.ts:54-106) and renders both groups it returns (:112-133). The records it searches are addressRecords, built from the ENS address encoder's coinTypeToNameMap (data/records/address.tsx:5-12), which uses mainnet chain ids. Both networks also sit in the tab's own EVM_PICKER_POPULAR_COIN_TYPES (:37-43) as 2147542792 (Linea) and 2148018000 (Scroll).
ENSIP-11 encodes coinType = 0x80000000 | chainId. The PoC decodes both sides back to the chain each one is keyed on:
| row | Explorer coin type | Explorer chain | Manager coin type | Manager chain | offered via |
|---|---|---|---|---|---|
| Optimism | 2158639068 | 11155420 (OP Sepolia) | 2147483658 | 10 (OP mainnet) | evmChainOptions |
| Arbitrum | 2147905262 | 421614 (Arb Sepolia) | 2147525809 | 42161 (Arb mainnet) | evmChainOptions |
| Base | 2147568180 | 84532 (Base Sepolia) | 2147492101 | 8453 (Base mainnet) | evmChainOptions |
| Linea | 2147542789 | 59141 (Linea Sepolia) | 2147542792 | 59144 (Linea mainnet) | picker search |
| Scroll | 2148017999 | 534351 (Scroll Sepolia) | 2148018000 | 534352 (Scroll mainnet) | picker search |
Every pair differs, so no L2 record the Manager writes lands in a slot this deployment reads.
3. The Explorer falls back to the coin-60 / default record
apps/portal/src/routes/$name/address.tsx:58-67
function forwardAddress(
network: ForwardResolutionNetwork,
addressByCoinType: Map<number, string>,
): string | null {
const own = addressByCoinType.get(network.coinType) ?? null
if (own) return own
return network.l2ChainId != null
? (addressByCoinType.get(DEFAULT_EVM_COIN_TYPE) ?? null)
: null
}
The L2 slot the Explorer reads is empty, so each L2 row falls through to the ENSIP-19 default, which is the owner's ordinary EVM address. The page shows it as that network's address and gives no sign that it is a fallback.
The deployed resolver behaves the same way one level down, and the end-to-end rig below shows this on chain. A PermissionedResolver returns the default EVM record for any EVM coin type that has no specific record, while a non-EVM coin type returns empty. So the Explorer's miss already resolves to the owner's coin-60 address at the resolver, before forwardAddress runs. The displayed result is the same either way, and it comes from the deployed contract as well as from the UI.
4. Why this loses money instead of just redirecting it
A plain EOA is controllable on every EVM chain, so a payment to it on the L2 still reaches the owner. A contract address is different. The Manager is built around a smart account (packages/smart-account, useSmartAccountContext), and an owner only sets a chain-specific record when their addresses on the two chains actually differ.
A contract address comes from CREATE(deployer, nonce). Nobody has a private key for it. If the contract was never deployed at that address on the destination chain, three things hold at once: there is no code there, so nothing can be called; there is no key, because it is not a keypair address; and once the deployer's nonce on that chain has moved past the one that would produce it, the address can never be occupied, since nonces only increase. Funds sent there stay there. The PoC below shows each of the three.
Impact Details
Selected impact: "Causing the application to display or pre-fill an incorrect address, name, or transaction detail, so that a user sends funds or submits a transaction to an unintended recipient." The Explorer shows, for each L2 row, an address that is not the one the owner set for that network, and a sender pays it.
Measured on the rendered page, with an address record written for every L2 row: 5 of 5 rows show the coin-60 address and 0 of 5 show the address the owner set. In the control arm the same five records are written to the slots the Explorer reads, and the counts are 0 of 5 and 5 of 5. The fallback comes from the slot, not from rows nobody filled in.
The loss was executed: a sender paid 2 ETH on the L2 to the address the page showed, and the owner could not recover it. Each of the three locks was measured separately:
| lock | measured |
|---|---|
| nothing to call | the address has no code on the L2 (owner_coin60_code_on_l2) |
| no key | it is a CREATE address, not a keypair |
| can never be occupied | the deployer's nonce there has passed it, and a rescue deploy provably lands at a different address |
Two preconditions apply, and the rigs measure both.
First, the owner's L2 address has to differ from their coin-60 address, otherwise the fallback shows the right address and nothing is lost. The Manager's own Addresses tab cannot create that difference from a clean profile. The network chip calls onSetChainToEthAddress (EvmAddressSection.tsx:75-79), which sets the L2 row equal to coin 60, and applyEthAddressChange (AddressesTab.helpers.ts:89-106) keeps every EVM row in sync when the ETH address changes. A chain-specific L2 record therefore has to exist already, from a migrated name or from another client, and the tab then shows it as an editable row the owner can change. The end-to-end rig runs both journeys. The clean-profile journey is its control.
Second, the coin-60 record has to be a contract that is not deployed at the same address on the destination chain. A plain EOA owner still receives the payment, so for them the wrong address is displayed but no money is lost. The affected population is smart-account owners, which is the account model the Manager is built on, plus anyone whose L2 address differs from their L1 one, which is the only reason to set a chain-specific record in the first place.
One further consequence is recorded here without being claimed: the Manager also offers ZKsync, Polygon and BNB, and the Explorer has no row for any of them, so a record set for those is never shown at all.
No attacker is involved. This is a mismatch between two of ENS's own applications, and the funds end up stranded with nobody receiving them. That is why the report claims impact 6285 only and not "Direct theft of user funds".
References
Pin 1c9b47f18fcddd2e864dfe385c4171061c9811ae.
apps/manager/src/features/profile/components/dialogs/edit-profile/tabs/addresses/addressPickerRecords.ts:21-28(curated L2 list),:37-43(popular coin types),:54-106(getPickerRecordGroups)apps/manager/src/features/profile/components/dialogs/edit-profile/tabs/addresses/ChainPickerDialog.tsx:58-59, 112-133(the "Add More" dialog renders the search groups)apps/manager/src/features/profile/data/records/address.tsx:5-12(addressRecordsfromcoinTypeToNameMap)apps/portal/src/features/forward-resolution/components/AddressResolution/networks.ts:12-17(the comment),:29(L2_CHAIN_IDS),:44-46(row construction)apps/portal/src/routes/$name/address.tsx:58-67(forwardAddress),:69-88(buildRow)apps/portal/src/lib/coinType.ts(DEFAULT_EVM_COIN_TYPE,MAINNET_COIN_TYPE)apps/manager/src/features/profile/service/profileRecordTransactions.ts:372(buildRecordsUpdateCalls, the real save encoder)apps/manager/.../tabs/addresses/EvmAddressSection.tsx:75-79(the chip sets the L2 row equal to coin 60)apps/manager/.../tabs/addresses/AddressesTab.helpers.ts:89-106(applyEthAddressChangekeeps EVM rows in sync)- ENSIP-11 EVM coin types: https://docs.ens.domains/ensip/11
- ENSIP-19 reverse resolution / default EVM address: https://docs.ens.domains/ensip/19
Proof of Concept
Proof of Concept
There are two rigs. The first shows the rendering defect across all five rows. The second executes the whole path from the Manager's UI to a payment on the L2, with nothing seeded. Each is gated separately with verify_poc.py --strict and each passes 13 of 13 checks. Neither uses vi.mock, a stub, or anvil_setCode.
Rig 1: what the Explorer renders (verification/pocs/H-C7-62/)
Four steps. The coin types come from the Manager's own picker code, and the displayed addresses are read out of the DOM of the real route.
apps/manager. For each of the five networks the Explorer renders, resolve the slot the user gets when they pick that network: the curatedevmChainOptionsentry matching the label they click, or else the record the tab's owngetPickerRecordGroupssearch returns for that name. If the Manager offers the network by neither path, the test fails, since an unofferable slot would make the mismatch unreachable for that row. Each resolved coin type is decoded back to its chain id, and all five come out mainnet (manager_slot_chainids).- Two chains. Build the owner's coin-60 record as a real smart account: deploy it on L1, and on the L2 burn the deployer's nonce so that
CREATEaddress can never be produced there again. apps/portal. Mount the real/$name/addressroute, write an address record for every L2 row, and read the rendered table out of the DOM, soforwardAddressandbuildRowexecute. An earlier version of this rig re-implemented the ENSIP-19 fallback ternary inside the test, which only showed that the test agreed with itself. This version does not.- Two chains. A sender pays whatever the page rendered, on the L2, and the rig then tries to recover it.
The arms differ in one thing only: which coin-type slots those five records were written to, the ones the Manager writes or the ones the Explorer reads.
Prerequisites
Two local chains. The Explorer and Manager steps need no network.
pnpm install # from the repo root, once
anvil --fork-url <a Sepolia RPC> --port 8946 # stands in for L1
# the L2 chain is started by the rig if absent:
anvil --port 8947 --chain-id 8453 # stands in for the destination L2
Steps to reproduce
bash verification/pocs/H-C7-62/run.sh exploit
bash verification/pocs/H-C7-62/run.sh control
Measured result
Exploit, with the owner's five L2 addresses in the slots the Manager writes:
arm: exploit
manager_base_cointype: 2147492101
manager_base_chainid: 8453
manager_slots_for_portal_l2_rows: {"Optimism":2147483658,"Arbitrum":2147525809,"Base":2147492101,"Linea":2147542792,"Scroll":2148018000}
manager_slot_offered_via: {"Optimism":"evmChainOptions","Arbitrum":"evmChainOptions","Base":"evmChainOptions","Linea":"pickerSearch","Scroll":"pickerSearch"}
manager_slot_chainids: {"Optimism":10,"Arbitrum":42161,"Base":8453,"Linea":59144,"Scroll":534352}
portal_base_cointype: 2147568180
portal_base_chainid: 84532
write_slot: 2147492101
l2_rows_total: 5
l2_rows_rendering_eth_address: 5
l2_rows_rendering_intended_l2_address: 0
impact_row: 6285
SENDER_PAYS_ETH_NOT_L2: 1
owner_coin60_record: 0xB09297A56A54E37261cb68853d57CE99332707c1
owner_coin60_code_on_l1: 4743
owner_coin60_code_on_l2: 3
owner_intended_l2_address: 0xf672fbdf38D9d1f83E73a3530f2456B916F5462B
address_the_page_rendered: 0xb09297a56a54e37261cb68853d57ce99332707c1
sender_paid_on_l2_wei: 2000000000000000000
owner_recovered_the_funds: 0
deployer_nonce_on_l2: 1
rescue_deploy_would_land_at: 0x476f7303C0cEC50B794fF61e2262aEdA452Af3Ac
FUNDS_PERMANENTLY_UNRECOVERABLE: 1
Control, with the same five addresses in the slots the Explorer reads:
arm: control
manager_slots_for_portal_l2_rows: {"Optimism":2147483658,"Arbitrum":2147525809,"Base":2147492101,"Linea":2147542792,"Scroll":2148018000}
manager_slot_chainids: {"Optimism":10,"Arbitrum":42161,"Base":8453,"Linea":59144,"Scroll":534352}
portal_base_cointype: 2147568180
portal_base_chainid: 84532
write_slot: 2147568180
l2_rows_total: 5
l2_rows_rendering_eth_address: 0
l2_rows_rendering_intended_l2_address: 5
impact_row: 6285
SENDER_PAYS_ETH_NOT_L2: 0
owner_coin60_record: 0xA29a1b7D8Be80A179B372EFC4DE98e223e42246E
owner_coin60_code_on_l1: 4743
owner_coin60_code_on_l2: 3
owner_intended_l2_address: 0xd36C06a14b7c5d2585d9df3726ebEf137AC40537
address_the_page_rendered: 0xd36c06a14b7c5d2585d9df3726ebef137ac40537
sender_paid_on_l2_wei: 3000000000000000000
owner_recovered_the_funds: 1
deployer_nonce_on_l2: 1
rescue_deploy_would_land_at: 0x5b9f8f13b6446d545674B5FFEc141569C9113F11
FUNDS_PERMANENTLY_UNRECOVERABLE: 0
Read across the arms:
| measurement | exploit | control |
|---|---|---|
| slots the five L2 records were written to | the Manager's (mainnet) | the Explorer's (Sepolia) |
| L2 rows rendering the coin-60 address | 5 of 5 | 0 of 5 |
| L2 rows rendering the address the owner set | 0 of 5 | 5 of 5 |
| owner recovered the sender's funds | no | yes |
| funds permanently unrecoverable | 1 | 0 |
sender_paid_on_l2_wei is 3 ETH in the control and 2 in the exploit because the balance is read before recovery. The control's rendered address is the owner's own L2 EOA, which step 2 had already seeded with 1 ETH. The payment is 2 ETH in both arms.
The control arm matters as much as the exploit arm. Same code path, same sender, same amount, and because the page rendered an address the owner holds a key for, the rig moves the money out again. The loss in the exploit arm comes from which slot was written, not from anything in the harness.
FUNDS_PERMANENTLY_UNRECOVERABLE is set only when all three of these hold: the recovery attempt failed, funds are sitting at the address, and the address has no code on the L2.
Rig 2: the write path, executed end to end (verification/pocs/H-C7-62-E2E/)
Rig 1 seeds the address record into the Explorer's query cache, so on its own the "Manager writes it there" step is inferred. Rig 2 executes it.
- A real
PermissionedResolveris deployed through the SepoliaVerifiableFactory, using the samedeployProxy(impl, salt, initialize(...))call the Manager uses. - The real
AddressesTabis mounted behind the realeditProfileDialogMachine, opened the wayEditProfileDialog.tsxopens it, and driven with DOM events. The coin type is whatever the tab puts in the form. The pre-existing Base row is keyed onevmChainOptions.find(o => o.label === 'Base').coinType, so it is never hardcoded. - Those records go to the real
buildRecordsUpdateCalls(profileRecordTransactions.ts:372), the functionsaveRecordscalls on the real save path, which encodes through ensjssetRecordsWriteParameters. The rig prints the calldata and does not rewrite it. - That calldata is broadcast verbatim, and the rig then reads
addr(node, coinType)back off the resolver. The test never decodes the calldata; the chain reports which slot was written. - The real address route renders over records read off that resolver, and a sender pays whatever it displayed, on the L2.
Steps to reproduce:
bash verification/pocs/H-C7-62-E2E/run.sh exploit
bash verification/pocs/H-C7-62-E2E/run.sh control
Exploit, where the name already carries a chain-specific Base record and the owner types a different Base address (portal_coins_read_from_chain omitted for width; it is the twelve addr(node, coinType) reads listed in run.sh):
arm: exploit
journey: custom
resolver: 0xcF84DA5B1b0440ED2c1eA6709a6059049E29c1D8
name: alice.eth
node: 0x787192fc5378cc32aa956ddfdedbf26b24e8d78e40109add0eea2c1a012c3dec
ui_base_cointype: 2147492101
ui_base_value: 0x14f1e4f4Bbfc8403cA4568c2CBF06f55d81a6cbB
ui_eth_value: 0x9640B928367fe6365e19D695Aa4619A4eA590680
ui_base_differs_from_eth: 1
ui_emitted_sepolia_base_slot: 0
write_calldata: 0x8b95dd71787192fc5378cc32aa956ddfdedbf26b24e8d78e40109add0eea2c1a012c3dec00000000000000000000000000000000000000000000000000000000800021050000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001414f1e4f4bbfc8403ca4568c2cbf06f55d81a6cbb000000000000000000000000
write_tx_status: true
onchain_at_manager_slot_2147492101: 0x14f1e4f4bbfc8403ca4568c2cbf06f55d81a6cbb
onchain_at_portal_slot_2147568180: 0x
resolver_probe_default_2147483648: 0x9640b928367fe6365e19d695aa4619a4ea590680
resolver_probe_unset_evm_2147999999: 0x9640b928367fe6365e19d695aa4619a4ea590680
resolver_probe_non_evm_999999999: 0x
resolver_probe_portal_slot_after_default_2147568180: 0x9640b928367fe6365e19d695aa4619a4ea590680
l2_chain_id: 8453
owner_coin60_record: 0x9640B928367fe6365e19D695Aa4619A4eA590680
owner_coin60_code_on_l1: 4743
owner_coin60_code_on_l2: 3
owner_intended_l2_address: 0x14f1e4f4Bbfc8403cA4568c2CBF06f55d81a6cbB
address_the_page_rendered: 0x9640b928367fe6365e19d695aa4619a4ea590680
owner_set_on_base: 0x14f1e4f4Bbfc8403cA4568c2CBF06f55d81a6cbB
rendered_equals_coin60: 1
RENDERED_IS_COIN60_NOT_BASE: 1
sender_paid_on_l2_wei: 2000000000000000000
owner_recovered_the_funds: 0
FUNDS_PERMANENTLY_UNRECOVERABLE: 1
Control, a clean profile where the Base chip can only set Base equal to coin 60 (write_calldata and portal_coins_read_from_chain omitted for width):
arm: control
journey: chip
resolver: 0xB23Ca8D1A1B6aD38aD26e5537906CC199251B216
name: alice.eth
node: 0x787192fc5378cc32aa956ddfdedbf26b24e8d78e40109add0eea2c1a012c3dec
ui_base_cointype: 2147492101
ui_base_value: 0xe3Aa8320f073A64dc7036a253EDD1F07def81270
ui_eth_value: 0xe3Aa8320f073A64dc7036a253EDD1F07def81270
ui_base_differs_from_eth: 0
ui_emitted_sepolia_base_slot: 0
write_tx_status: true
onchain_at_manager_slot_2147492101: 0xe3aa8320f073a64dc7036a253edd1f07def81270
onchain_at_portal_slot_2147568180: 0x
resolver_probe_default_2147483648: 0xe3aa8320f073a64dc7036a253edd1f07def81270
resolver_probe_unset_evm_2147999999: 0xe3aa8320f073a64dc7036a253edd1f07def81270
resolver_probe_non_evm_999999999: 0x
resolver_probe_portal_slot_after_default_2147568180: 0xe3aa8320f073a64dc7036a253edd1f07def81270
l2_chain_id: 8453
owner_coin60_record: 0xe3Aa8320f073A64dc7036a253EDD1F07def81270
owner_coin60_code_on_l1: 4743
owner_coin60_code_on_l2: 3
owner_intended_l2_address: 0x7bcA34dC37A39f7C016b3571376b61E2F0d0116d
address_the_page_rendered: 0xe3aa8320f073a64dc7036a253edd1f07def81270
owner_set_on_base: 0xe3Aa8320f073A64dc7036a253EDD1F07def81270
rendered_equals_coin60: 1
RENDERED_IS_COIN60_NOT_BASE: 0
sender_paid_on_l2_wei: 2000000000000000000
owner_recovered_the_funds: 0
FUNDS_PERMANENTLY_UNRECOVERABLE: 0
The write lands at 2147492101. The slot the Explorer reads, 2147568180, is empty at that point. The resolver's own fallback is probed in the same run: resolver_probe_unset_evm_2147999999, a coin type belonging to no chain either app knows, returns the default EVM record, and resolver_probe_non_evm_999999999 returns empty. The page then displays the owner's coin-60 smart account in place of the Base address the owner set, the payment goes through, and recovery fails. RENDERED_IS_COIN60_NOT_BASE and FUNDS_PERMANENTLY_UNRECOVERABLE are both 1 in the exploit arm and both 0 in the control.
The two arms are the two journeys described under Impact Details. Exploit: the name already carries a chain-specific Base record, the tab shows it as an editable row, and the owner types a different Base address. Control: a clean profile, where the Base chip can only set Base equal to coin 60, so the page shows exactly what the owner chose and nothing is lost. The comparison is between the rendered address and what the owner actually set, which is what makes the clean-profile arm a control.
The declared fix
The patch applied by the differential check is the smallest one that flips the measured keys: the Base entry in evmChainOptions, 2147492101 to 2147568180. Both keys are read off the Base row, so with that patch the record lands in the slot the Explorer reads, the Base row shows the owner's intended address, and the sender's funds become recoverable.
That one-row patch is not a sufficient fix, and the rig showed why. An earlier revision of step 1 resolved Base's slot by searching for the mainnet coin type instead of matching the label the user clicks. Under that resolution the patched build still produced 2147492101 and both keys stayed at 1, because the mainnet Base record is also reachable through the tab's search over addressRecords, which comes from the address encoder's coinTypeToNameMap. Patching the button does not remove the mainnet slot from the picker.
A complete fix has to cover both paths, and the per-row table above shows the size of the job: Linea and Scroll are only offered through that encoder-derived search, so no constant swap corrects them. The Manager needs the same deployment-aware derivation the Explorer already uses, getCoinTypeForReverseRegistrarChainId(chainId, <network>), applied to every EVM network it offers by either path, so that both apps agree on the coin type for whichever deployment they point at.
Full PoC source, rig 1 (H-C7-62)
verification/pocs/H-C7-62/run.sh
#!/usr/bin/env bash
# H-C7-62 — the Manager writes L2 address records to MAINNET-derived coin types
# while the Explorer reads SEPOLIA-derived ones, so every L2 row on the address
# page renders the owner's coin-60 address instead. When that coin-60 record is a
# CONTRACT address, funds a sender pays on the L2 are permanently unrecoverable.
#
# Four steps. Step 1 needs no chain; steps 2 and 4 are the loss arm.
#
# step 1 apps/manager — resolve, through the app's OWN picker code, the coin
# type the Manager writes for each of the five L2 networks the Explorer
# renders a row for, and decode each back to its chain id.
# step 2 two chains — deploy the owner's smart account on "Ethereum", and on
# the L2 burn the deployer's nonce 0 so that CREATE address can never be
# produced there again.
# step 3 apps/portal — MOUNT THE REAL `/$name/address` ROUTE with those two
# addresses and read the rendered table out of the DOM, so
# `forwardAddress` (:58-67) and `buildRow` (:69-88) execute. EVERY L2
# row gets a record written for it, so a row that falls back does so
# because of the SLOT and not because nobody set it.
# step 4 two chains — a sender pays WHATEVER THE PAGE RENDERED, on the L2,
# and the rig then tries to recover it.
#
# exploit : the owner's L2 addresses sit in the slots the MANAGER writes
# (mainnet-derived). Every row renders the coin-60 CONTRACT address.
# control : they sit in the slots the EXPLORER reads (Sepolia-derived). Every
# row renders the L2 address, an EOA whose key the owner holds.
#
# Prerequisites: an anvil Sepolia fork on 127.0.0.1:8946 (or $POC_RPC_URL) standing
# in for L1, and a plain anvil on 127.0.0.1:8947 standing in for the L2 — started
# here if absent.
#
# Usage: run.sh [exploit|control]
set -euo pipefail
export PATH="$HOME/.foundry/bin:$PATH"
ARM="${1:-exploit}"
case "$ARM" in exploit|control) ;; *) echo "FATAL: arm must be exploit|control, got '$ARM'" >&2; exit 1;; esac
HERE="$(cd -P "$(dirname "$0")" && pwd)"
ROOT="$HERE/../../../repos/audit-comp-ens"
MANAGER="$ROOT/apps/manager"; PORTAL="$ROOT/apps/portal"
ETH="${POC_RPC_URL:-http://127.0.0.1:8946}"
L2=http://127.0.0.1:8947
MC_COPY="$MANAGER/src/hc762-manager.test.ts"
PR_COPY="$PORTAL/src/hc762-portal.test.tsx"
SHIM_COPY="$PORTAL/src/shim.ts"
[ -d "$MANAGER/src" ] || { echo "FATAL: manager app not found at $MANAGER" >&2; exit 1; }
[ -d "$PORTAL/src" ] || { echo "FATAL: portal app not found at $PORTAL" >&2; exit 1; }
chainid () { curl -s -m 3 -X POST -H 'content-type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' "$1" 2>/dev/null; }
chainid "$ETH" | grep -q 0xaa36a7 || { echo "FATAL: no Sepolia anvil fork at $ETH" >&2; exit 1; }
if ! chainid "$L2" | grep -q 0x; then
nohup anvil --port 8947 --chain-id 8453 --silent >/tmp/hc762-l2-anvil.log 2>&1 &
for _ in $(seq 1 30); do chainid "$L2" | grep -q 0x && break; sleep 1; done
fi
chainid "$L2" | grep -q 0x || { echo "FATAL: could not start the L2 chain on $L2" >&2; exit 1; }
cleanup() { rm -f "$MC_COPY" "$PR_COPY" "$SHIM_COPY"; }
trap cleanup EXIT
trap 'cleanup; exit 143' INT TERM HUP
cp "$HERE/manager-coin.test.ts" "$MC_COPY"
cp "$HERE/portal-render.test.tsx" "$PR_COPY"
cp "$HERE/shim.ts" "$SHIM_COPY"
pick () { printf '%s\n' "$2" | sed -n "s/^$1: *//p" | head -1 | tr -d '"\r'; }
# ---- step 1: the Manager's own coin types -----------------------------------
MC=$(cd "$MANAGER" && pnpm exec vitest run src/hc762-manager.test.ts \
--disableConsoleIntercept --silent=false 2>&1) || true
echo "$MC" | grep -q 'Test Files 1 passed' || { echo "FATAL: manager step failed" >&2; echo "$MC" >&2; exit 1; }
MANAGER_BASE=$(pick manager_base_cointype "$MC")
MANAGER_CHAIN=$(pick manager_base_chainid "$MC")
MANAGER_TABLE=$(printf '%s\n' "$MC" | sed -n 's/^manager_curated_l2_table: *//p' | head -1)
MANAGER_SLOTS=$(printf '%s\n' "$MC" | sed -n 's/^manager_slots_for_portal_l2_rows: *//p' | head -1)
MANAGER_VIA=$(printf '%s\n' "$MC" | sed -n 's/^manager_slot_offered_via: *//p' | head -1)
MANAGER_CHAINIDS=$(printf '%s\n' "$MC" | sed -n 's/^manager_slot_chainids: *//p' | head -1)
[ -n "$MANAGER_BASE" ] || { echo "FATAL: step 1 published no Manager coin type" >&2; exit 1; }
[ -n "$MANAGER_SLOTS" ] || { echo "FATAL: step 1 published no Manager slot map" >&2; exit 1; }
# ---- step 2: build the owner's two addresses on two chains ------------------
FUND=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
DK=0x$(python3 -c "import secrets;print(secrets.token_hex(32))")
D=$(cast wallet address --private-key "$DK")
L2K=0x$(python3 -c "import secrets;print(secrets.token_hex(32))")
OWNER_L2=$(cast wallet address --private-key "$L2K")
for R in "$ETH" "$L2"; do
cast send "$D" --value 5ether --private-key "$FUND" --rpc-url "$R" >/dev/null
cast send "$OWNER_L2" --value 1ether --private-key "$FUND" --rpc-url "$R" >/dev/null
done
# The owner's coin-60 record is a SMART ACCOUNT: a CREATE address, so no key exists.
OWNER_ETH=$(cast com
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Manager derives L2 coin types from mainnet chain ids while the Explorer derives them from Sepolia chain ids, so the two applications never agree on which slot holds an L2 address.
Impact
The Explorer shows an address the owner did not set for that network, and a sender's payment to it on the L2 could be permanently unrecoverable when the coin-60 record is a smart account not deployed there; a plain externally owned account owner still receives the funds.
What the attacker needed
Owner's L2 address differs from coin-60; coin-60 record is a smart account; that contract is not deployed on the L2; sender pays the displayed address
The fix
The Manager should derive its L2 coin types from the same Sepolia chain ids the Explorer reads, though the report notes a one-row patch is not sufficient.
How it was found
- Resolve the coin type the Manager offers for each of the five L2 networks, via the curated list or the picker search.
- Build the owner's coin-60 record as a smart account deployed on L1, and burn the deployer nonce on the L2 so that address can never exist there.
- Mount the real Explorer address route, write an address record for every L2 row, and read the rendered table from the DOM.
- Have a sender pay the rendered address on the L2 and attempt recovery.
- Repeat with the same records written to the slots the Explorer reads, as a control.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
ENS names can store a different address for each blockchain, filed under a numbered slot called a coin type. The Manager app saved the L2 addresses in one set of slots, but the Explorer app looked in a different set, found nothing, and showed the name's ordinary Ethereum address instead. If that ordinary address is a smart contract that was never deployed on the L2, money sent there is stuck, because no key exists to move it.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.