Skip to content
Race condition Audit finding Intermediate

Editing the recipient during portal transfer preparation sends the ens name to the replaced address

The Portal transfer form lets the user edit the recipient while an asynchronous token-ID lookup is still pending, but the prepared transaction keeps the original recipient. A user who corrects the recipient before approving can still irreversibly transfer the ENS name to the address they replaced.

manvi Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

91822 w a low editing the recipient during portal transfer preparation sends the ens name to the replaced address

Submitted on Sep 4th 2026 at 14:59:46 UTC by @manvi for Audit Competition | ENS

  • Report ID: #91822
  • Report Type: Websites & Apps
  • Report severity: Low
  • Target: https://github.com/immunefi-team/audit-comp-ens/tree/audit-comp-ready/apps/portal
  • 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

I analysed the Portal's ENS V2 transfer flow and found that the recipient shown in the transfer form can diverge from the recipient saved for transaction construction.

The sequence is straightforward:

  1. The user enters recipient A.
  2. The user presses Transfer name.
  3. SendNameForm calls startTransfer() with A.
  4. useTransferName begins an asynchronous getEnsTokenId() read and keeps A in the mutation variables.
  5. Portal changes the button to Preparing…, but leaves the recipient field editable.
  6. The user notices A is wrong and replaces it with intended recipient B.
  7. The form and recipient preview now show B.
  8. The earlier getEnsTokenId() request completes.
  9. useTransferName.onSuccess saves the original mutation result containing A.
  10. The generated transaction callbacks close over A.
  11. Portal opens a generic transaction modal that does not disclose the saved recipient.
  12. The user proceeds.
  13. transferToken() encodes safeTransferFrom(owner, A, tokenId, 1, "0x").
  14. The transaction succeeds and A receives the ENS token.

Portal itself warns:

Transferring ownership of an ENS name is irreversible. Make sure you check the recipient address before proceeding.

The bug defeats that safety check. A user can notice the wrong recipient, correct it before wallet approval, and still transfer the name to the address they replaced.

The final PoC makes the asynchronous interval deterministic by delaying the real getTokenId(uint256) RPC response. The response is not altered or replaced; it is released unchanged after the user-visible recipient has been changed to B.

The run then executes the real Portal transaction flow and checks authoritative ERC-1155 balances on Anvil:

BEFORE:
victim = 1
A      = 0
B      = 0

AFTER:
victim = 0
A      = 1
B      = 0

The test exits successfully:

1 passed (26.2s)

Vulnerability Details

1. SendNameForm snapshots the recipient when the user starts the transfer

apps/portal/src/features/transfer/components/SendNameForm.tsx derives the current recipient from the form:

TS
const resolution = useAddressResolution(recipientInput)
const { address: recipient, isResolving } = resolution

const { startTransfer, transactions, isPreparing, prepError } =
  useTransferName({ name, registryAddress, owner })

The submit path is:

TS
const runTransfer = () => {
  if (!recipient || !canStart) return
  startTransfer({ recipient, options: effectiveOptions })
}

If A is visible when the user presses the button, A becomes the recipient passed into the asynchronous transfer-preparation mutation.

2. isPreparing disables the button but not the recipient field

The form prevents a second submit while preparation is running:

TS
const canStart =
  hasValidRecipient && !isResolving && !isPreparing && detachTargetsSettled

The submit button is disabled through canStart:

TSX
<Button
  variant="default"
  onClick={runTransfer}
  disabled={!canStart}
>
  {isPreparing ? 'Preparing…' : 'Transfer name'}
</Button>

However the recipient field remains:

TSX
<AddressNameInput
  value={recipientInput}
  onChange={setRecipientInput}
  resolution={resolution}
  className="h-9"
/>

No disabled={isPreparing} value is passed.

The reusable AddressNameInput component already supports a disabled prop. The transfer page simply does not use it here.

The browser PoC proves the production behavior directly:

[POC] recipient input remains ENABLED while Preparing = true

3. useTransferName preserves A across the asynchronous token-ID lookup

apps/portal/src/features/transfer/hooks/useTransferName.ts prepares the flow with:

TS
const prepareMutation = useMutation(
  resultMutationOptions({
    mutationFn: ({ recipient, options }: StartTransferParams) =>
      getEnsTokenId({
        label: getLabel(name),
        registryAddress,
      }).map((tokenId) => ({ recipient, tokenId, options })),
    onSuccess: (params) => {
      startedStepsRef.current = new Set()
      setSavedParams(params)
      openModal()
    },
  }),
)

The recipient inside the .map() callback is the mutation variable supplied when startTransfer() was called.

Changing the form from A to B does not mutate that already-started request.

When getEnsTokenId() finishes, the value saved by setSavedParams(params) is still:

recipient = A

There is no comparison against the current recipient in the form before opening the transaction modal.

4. All later transaction callbacks use savedParams

The transaction list is built from the saved snapshot:

TS
if (!savedParams) return []

const { recipient, tokenId, options } = savedParams
const steps = buildTransferPlan(options)

Each runner closes over that saved recipient:

TS
const runners = steps.map((step) => async () => {
  const id = `transfer-${name}-${step}`
  ...
  await runStep(step, id, recipient, tokenId)
})

The final transfer step is:

TS
.with('transfer-token', () =>
  transferToken({
    ...common,
    registryAddress,
    tokenId,
    recipient,
    id,
  }),
)

By this point the live form can show B while the transaction runner is permanently bound to A.

5. transferToken() encodes the saved recipient into safeTransferFrom

apps/portal/src/features/transfer/helpers/transferToken.ts performs the actual ENS V2 ownership transfer:

TS
const data = encodeFunctionData({
  abi: erc1155Abi,
  functionName: 'safeTransferFrom',
  args: [
    walletWithAccount.account.address,
    recipient,
    tokenId,
    1n,
    '0x',
  ],
})

The transaction manager then submits that calldata to registryAddress.

Therefore the stale value controls the real ERC-1155 transfer destination.

6. The Portal transaction modal does not reveal which recipient was saved

The transaction descriptor uses:

TS
title: STEP_LABELS[step],
transactionName: `${STEP_LABELS[step]} - ${name}`,

For the final step the user gets generic Portal text such as:

Transfer name

The successful PoC observed:

Transaction overview Transfer name Not Started Est. Cost Not yet Start Close

and asserted:

modal discloses stale A = false
modal discloses intended B = false

So Portal provides no final application-level indication that A is still the prepared destination.

7. The same stale snapshot also includes transfer options

startTransfer() receives both:

TS
{
  recipient,
  options: effectiveOptions,
}

The same class of stale state can therefore apply to the cleanup switches while preparation is running.

This report does not rely on that secondary effect. The hardened PoC disables the visible detach-resolver option before preparation and demonstrates the Critical impact with only the final transfer-token step.


Why this is not merely a UI/UX issue

The UI mismatch is only the entry point. The final effect is a real ownership transfer.

The browser-to-chain PoC executes the actual Portal transaction and proves:

Portal field immediately before wallet flow:
B

Transaction:
SUCCESS

ERC-1155 post-state:
victim = 0
A      = 1
B      = 0

That is an application transaction-integrity failure, not presentation-only stale state.


Why this is not intended design

Portal explicitly tells the user to check the recipient because the transfer is irreversible.

An interface intentionally allowing edits during preparation would need one of two behaviors:

edit during preparation
        |
        +--> cancel / invalidate old preparation
        |
        +--> rebuild using the new values

Alternatively, the form can be locked once preparation begins.

The current behavior instead allows:

form shows B
prepared transaction uses A

There is no reasonable transfer-flow interpretation under which a corrected recipient should be ignored while remaining visibly accepted by the application.


Why this does not require a trusted or privileged actor

The vulnerability does not require:

  • Portal administrator access;
  • ENS governance access;
  • backend credentials;
  • a privileged protocol account;
  • victim private-key compromise;
  • malicious contract deployment;
  • malicious resolver behavior;
  • a failed transaction;
  • a retry;
  • transaction-ID reuse.

The victim is the legitimate owner and uses the normal Portal transfer flow.

The only timing condition is that the recipient is edited while the asynchronous token-ID preparation is still pending.


Why the deterministic RPC delay does not fabricate the bug

The PoC intercepts the real browser request for:

Solidity
getTokenId(uint256 labelHash)

It does not change:

  • the RPC method;
  • the contract address;
  • the calldata;
  • the token ID;
  • the RPC response.

The request is paused, the user-visible recipient is changed, and then that exact request is continued unchanged:

[POC] 🚧 intercepted production getTokenId(uint256) RPC
...
[POC] ▶ releasing unchanged getTokenId RPC

The delay only makes the naturally asynchronous interval reproducible on demand.

Any real RPC latency long enough for the recipient to be edited creates the same state relationship:

submitted mutation variables = old recipient
live form state             = new recipient

Wallet signing prompt caveat

The browser-to-chain PoC uses the repository's own @ensdomains/headless-web3-provider fixture.

That fixture authorizes the wallet request without rendering a MetaMask, Rainbow, hardware-wallet, or other human-facing decoded signing prompt.

For that reason, this report does not claim that every real wallet will hide recipient A.

A wallet that fully decodes ERC-1155 safeTransferFrom may show A clearly enough for an attentive user to notice the mismatch and reject the transaction.

That is an independent downstream mitigation, not a fix for the Portal behavior demonstrated here.

Portal itself has already done all of the following before control reaches the wallet:

accepted corrected recipient B
displayed corrected recipient B
opened a Portal transaction modal
failed to disclose A
failed to disclose B
submitted a transaction still bound to A

Wallet decoding quality also varies. A wallet may show decoded arguments, generic contract-interaction information, truncated values, or raw calldata.

The narrow claim made here is fully demonstrated regardless of wallet presentation:

Portal accepts and displays B while constructing and successfully submitting the ENS ownership transfer using A.


Why this is not one of the disclosed known issues

R3-07 has a different root cause and consequence

R3-07 concerns a transaction ID reused after a failed attempt.

Its effect is that a later successful retry skips archive/history/telemetry handling and can remain displayed as pending.

This finding occurs before the transaction actor is started.

It does not require:

failed transaction
retry
fixed transaction ID
history
telemetry
archive state

The old recipient is already captured during the initial preparation.

WEB-1257 / QA-01 are separate transfer problems

WEB-1257 concerns registry detachment after a parent transfer.

QA-01 concerns role combinations that lead to errors in later profile / primary-name operations.

Neither issue changes the recipient encoded into the ERC-1155 safeTransferFrom.

A fix for those issues would leave this stale-recipient race intact.


Audited Revision Verification

The frozen competition import verified for this finding is:

cda79acaad59711b943fc68207ebb3f1d0ff8596

That commit records:

fork ensdomains/apps-monorepo at 63772fd872af472ced58b009499355f3430c2a86

The relevant frozen blobs include:

apps/portal/src/features/transfer/components/SendNameForm.tsx
blob SHA: 0d48b575648a728f7f8d4415e4024b7f6c517258

apps/portal/src/features/transfer/hooks/useTransferName.ts
blob SHA: d3f124ff0b64fb1e450b3b46259f7b84880cf5f4

apps/portal/src/features/transfer/helpers/transferToken.ts
blob SHA: c76d53ad49f85b76e7d0cffc9acf5dd68e8c0dec

apps/portal/src/features/transfer/utils/buildTransferPlan.ts
blob SHA: 2874722beb2dece5bbef12cc58c52a2be9617f84

apps/portal/src/features/address/components/AddressNameInput.tsx
blob SHA: f3f45bbb9fb17970a6a101fbaec3671eb9afb1c4

apps/portal/src/features/transaction-manager/components/TransactionsOverviewContent.tsx
blob SHA: 837ef9cd17ec94d3c6ae01d8fefc53b36ae1940e

The PoC exercises the frozen behavior with:

real Portal rendering
real transfer form
real getTokenId(uint256) RPC
real transaction descriptors
real transaction manager
real headless wallet authorization
real ERC-1155 transfer
real Anvil transaction receipt
direct post-transaction ERC-1155 balance reads

The final successful run completed with:

1 passed (26.2s)

The successfully executed PoC file has SHA-256:

a540fd562cb90e48f1a14af7232f92b4d8f42cc44c9a71fb08ce63155295045b

Impact Details

The demonstrated impact is an irreversible ENS V2 ownership transfer to an address that the user has already replaced in the Portal UI.

Concrete demonstration:

Initial Portal recipient:
A = 0x70997970C51812dc3A010C7d01b50e0d17dc79C8

User corrects Portal recipient:
B = 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC

Portal immediately before wallet flow:
B

Portal transaction modal:
A not disclosed
B not disclosed

Real transaction:
SUCCESS

Authoritative ERC-1155 post-state:
victim = 0
A      = 1
B      = 0

If A is attacker-controlled, the attacker receives the ENS NFT.

Even when A is merely an unintended third party, the transfer cannot be undone by Portal after it succeeds. Recovery depends on A voluntarily transferring the name back.

I claim only the transfer-recipient mismatch reproduced end-to-end here. I do not claim that every wallet hides A at its signing prompt.


Preconditions

  1. The user owns a transferable ENS V2 .eth name.
  2. Recipient A is present when the user presses Transfer name.
  3. The getEnsTokenId() preparation has not completed yet.
  4. The user changes the recipient from A to B during that pending interval.
  5. The original preparation completes after the edit.
  6. The user proceeds with the transaction.
  7. The downstream wallet does not provide a sufficiently clear warning that causes the user to reject the stale-A transaction.

For deterministic reproduction, the PoC pauses the real getTokenId(uint256) RPC until after B is visible.

No privileged actor, malicious backend, malicious RPC response, transaction retry, or contract modification is required.


Recommended Remediation

The transfer's displayed parameters and prepared parameters must never diverge.

Option 1 — freeze prepared fields while isPreparing

At minimum:

TSX
<AddressNameInput
  value={recipientInput}
  onChange={setRecipientInput}
  resolution={resolution}
  disabled={isPreparing}
/>

The switches contributing to effectiveOptions should also be disabled for the same period.

Option 2 — invalidate stale preparation results when form values change

If editing during preparation is intended, associate each preparation attempt with a monotonically increasing identifier.

Conceptually:

TS
const runId = ++currentRun.current

const result = await prepare(...)

if (runId !== currentRun.current) return

setSavedParams(result)

Changing the recipient or any transfer option should invalidate the previous run.

An old async response must not be allowed to open the transaction modal.

Option 3 — re-check the recipient before building transactions

Before committing savedParams or before exposing the transaction modal, verify that:

prepared recipient
==
current resolved recipient

If not, discard the prepared result and require a new preparation.

Option 4 — show the actual destination in Portal's transaction modal

Portal should show the exact saved recipient used by the final transaction:

Transfer name
To: 0x...

This should be derived from the same immutable parameters used to generate calldata.

Recommended invariant

The recipient displayed by Portal at approval time must be the same recipient encoded in the ENS ownership-transfer transaction. If any prepared field changes, the old preparation must be blocked, cancelled, or discarded.


References

In-scope Explorer / Portal

  • apps/portal/src/features/transfer/components/SendNameForm.tsx
    • live recipientInput
    • startTransfer({ recipient, options })
    • isPreparing
    • recipient input remains enabled
    • generic irreversible-transfer warning
  • apps/portal/src/features/transfer/hooks/useTransferName.ts
    • asynchronous getEnsTokenId()
    • original mutation variables preserved
    • setSavedParams(params)
    • transaction callbacks close over saved recipient
    • transferToken(... recipient ...)
  • apps/portal/src/features/transfer/helpers/transferToken.ts
    • ERC-1155 safeTransferFrom
    • saved recipient used as second argument
    • real transaction-manager submission
  • apps/portal/src/features/transfer/utils/buildTransferPlan.ts
    • transfer step is always appended
    • cleanup steps execute before transfer
  • apps/portal/src/features/address/components/AddressNameInput.tsx
    • supports disabled
    • transfer form does not set it during preparation
  • apps/portal/src/features/transaction-manager/components/TransactionsOverviewContent.tsx
    • generic transaction overview
    • no recipient disclosure

E2E infrastructure used by the PoC

  • e2e/fixtures/playwright.portal.fixture.ts
    • Portal browser fixture
    • headless wallet
    • default Anvil accounts
    • real local Sepolia fork
  • e2e/fixtures/makeName.ts
    • real V2 .eth registration on Anvil
  • e2e/helpers/portal-auth.ts
    • transaction authorization helper

Proof of Concept

PoC Classification

This is a repo-native browser-to-chain E2E PoC against the frozen competition code.

It uses the real:

  • Portal transfer page;
  • SendNameForm;
  • useTransferName;
  • buildTransferPlan;
  • transferToken;
  • getTokenId(uint256) RPC request;
  • transaction modal;
  • transaction manager;
  • headless wallet authorization path;
  • V2 ETH Registry;
  • ERC-1155 ownership transfer;
  • Anvil Sepolia fork;
  • post-transaction balanceOf reads.

The only deterministic intervention is that the exact real getTokenId(uint256) browser RPC is paused and later continued unchanged.

No fake token ID, fake RPC response, mocked transfer helper, or mocked ownership result is used for the demonstrated impact.

The PoC deliberately disables the visible detach-resolver option before preparation so that the demonstrated transaction plan contains only the final irreversible transfer-token step.

PoC File

e2e/projects/portal/tests/stale-recipient-transfer.poc.spec.ts

SHA-256 of the successfully executed file:

a540fd562cb90e48f1a14af7232f92b4d8f42cc44c9a71fb08ce63155295045b

Complete Hardened E2E PoC

The complete successfully executed PoC source is included inline below.

TS
import { ensL1Contracts, supportedL1Chains } from '@ensdomains/ensjs/chain'
import type { Web3ProviderBackend } from '@ensdomains/headless-web3-provider'
import type { Page } from '@playwright/test'
import {
  erc1155Abi,
  labelhash,
  parseAbi,
  toFunctionSelector,
  type Address,
} from 'viem'

import {
  connectWithHeadlessWallet,
  expect,
  test,
} from '../../../fixtures/playwright.portal.fixture.js'
import {
  publicClient,
} from '../../../helpers/anvil-client.js'
import {
  authorizeTransaction,
} from '../../../helpers/portal-auth.js'

const PORTAL_APP_URL =
  process.env.PORTAL_APP_URL ??
  'http://127.0.0.1:3001'

const ensjsSepolia =
  ensL1Contracts[
    supportedL1Chains.sepolia
  ]

const ETH_REGISTRY =
  ensjsSepolia.ensRegistry.address

/*
 * ENSJS getTokenId() calls:
 *
 *   registry.getTokenId(labelhash(label))
 *
 * Detect exactly this read at the browser RPC boundary.
 */
const GET_TOKEN_ID_SELECTOR =
  toFunctionSelector(
    'getTokenId(uint256)',
  ).toLowerCase()

const GET_TOKEN_ID_ABI =
  parseAbi([
    'function getTokenId(uint256 labelHash) view returns (uint256)',
  ])

type RpcCall = {
  method?: string
  params?: unknown[]
}

function containsTargetGetTokenIdCall(
  payload: unknown,
): boolean {
  const calls =
    Array.isArray(payload)
      ? payload
      : [payload]

  return calls.some(
    (entry) => {
      const call =
        entry as RpcCall

      if (
        call.method !==
        'eth_call'
      ) {
        return false
      }

      const tx =
        (
          call.params?.[0] ??
          {}
        ) as {
          to?: string
          data?: string
        }

      if (
        typeof tx.to !==
          'string' ||
        typeof tx.data !==
          'string'
      ) {
        return false
      }

      return (
        tx.to.toLowerCase() ===
          ETH_REGISTRY.toLowerCase() &&
        tx.data
          .toLowerCase()
          .startsWith(
            GET_TOKEN_ID_SELECTOR,
          )
      )
    },
  )
}

async function readTokenBalance(
  account: Address,
  tokenId: bigint,
): Promise<bigint> {
  return publicClient.readContract({
    address:
      ETH_REGISTRY,
    abi:
      erc1155Abi,
    functionName:
      'balanceOf',
    args: [
      account,
      tokenId,
    ],
  })
}

async function driveTransactionsToSuccess(
  page: Page,
  wallet: Web3ProviderBackend,
  successTxIds: string[],
  timeoutMs = 180_000,
): Promise<void> {
  const succeeded =
    new Set<string>()

  const onConsole =
    (msg: {
      text(): string
    }) => {
      const text =
        msg.text()

      if (
        text.includes(
          '[TRANSACTION MANAGER]',
        )
      ) {
        console.log(
          '[BROWSER]',
          text,
        )
      }

      for (
        const id of
        successTxIds
      ) {
        if (
          text.includes(
            `Transaction ${id} state: success`,
          )
        ) {
          succeeded.add(
            id,
          )
        }
      }
    }

  page.on(
    'console',
    onConsole,
  )

  try {
    const deadline =
      Date.now() +
      timeoutMs

    while (
      Date.now() <
      deadline
    ) {
      const dialog =
        page.locator(
          '[data-slot="dialog-content"][data-state="open"]',
        )

      const retry =
        dialog.getByRole(
          'button',
          {
            name:
              /^(Retry|Try again)$/i,
          },
        )

      if (
        await retry
          .isVisible()
          .catch(
            () => false,
          )
      ) {
        const text =
          (
            await dialog
              .innerText()
              .catch(
                () => '',
              )
          )
            .replace(
              /\s+/g,
              ' ',
            )
            .trim()

        throw new Error(
          `Portal transaction entered error state: ${text}`,
        )
      }

      const openWallet =
        dialog.getByRole(
          'button',
          {
            name:
              /open wallet/i,
          },
        )

      if (
        await openWallet
          .isVisible()
          .catch(
            () => false,
          )
      ) {
        console.log(
          '[POC] clicking Open wallet',
        )

        await openWallet.click()

        await authorizeTransaction(
          wallet,
          60_000,
        )

        await page.waitForTimeout(
          500,
        )

        continue
      }

      const waitingButton =
        dialog.getByRole(
          'button',
          {
            name:
              /^Waiting\.\.\.$/i,
          },
        )

      if (
        await waitingButton
          .isVisible()
          .catch(
            () => false,
          )
      ) {
        const iconWalletButton =
          waitingButton.locator(
            'xpath=preceding-sibling::button[1]',
          )

        if (
          await iconWalletButton
            .isVisible()
            .catch(
              () => false,
            )
        ) {
          await iconWalletButton.click()

          await authorizeTransaction(
            wallet,
            60_000,
          )

          await page.waitForTimeout(
            500,
          )

          continue
        }
      }

      const primary =
        dialog.getByRole(
          'button',
          {
            name:
              /^(Start|Next|Done)$/i,
          },
        )

      if (
        await primary
          .isVisible()
          .catch(
            () => false,
          ) &&
        await primary
          .isEnabled()
          .catch(
            () => false,
          )
      ) {
        const label =
          await primary
            .innerText()

        console.log(
          '[POC] clicking modal primary =',
          label,
        )

        await primary.click()

        await page.waitForTimeout(
          500,
        )

        continue
      }

      if (
        succeeded.size ===
        successTxIds.length
      ) {
        break
      }

      await page.waitForTimeout(
        500,
      )
    }
  } finally {
    page.off(
      'console',
      onConsole,
    )
  }

  expect(
    succeeded.size,
  ).toBe(
    successTxIds.length,
  )
}

test.describe(
  'CRITICAL stale transfer recipient',
  () => {
    test(
      'Portal displays corrected B but transfers ENS ERC1155 to stale A',
      async ({
        portalPage: page,
        wallet,
        accounts,
        makeName,
      }) => {
        test.setTimeout(
          240_000,
        )

        console.log('')
        console.log(
          '============================================================',
        )
        console.log(
          'CRITICAL STALE RECIPIENT — REAL BROWSER / REAL CHAIN',
        )
        console.log(
          '============================================================',
        )

        await connectWithHeadlessWallet(
          page,
          wallet,
        )

        /*
         * user  = victim / current ENS owner
         * user2 = stale recipient A
         * user3 = corrected intended recipient B
         */
        const victim =
          accounts.getAddress(
            'user',
          )

        const staleRecipient =
          accounts.getAddress(
            'user2',
          )

        const intendedRecipient =
          accounts.getAddress(
            'user3',
          )

        expect(
          staleRecipient
            .toLowerCase(),
        ).not.toBe(
          intendedRecipient
            .toLowerCase(),
        )

        const name =
          await makeName({
            label:
              'critical-stale-recipient',
            owner:
              'user',
          })

        const label =
          name.replace(
            /\.eth$/,
            '',
          )

        const tokenId =
          await publicClient
            .readContract({
              address:
                ETH_REGISTRY,

              abi:
                GET_TOKEN_ID_ABI,

              functionName:
                'getTokenId',

              args: [
                BigInt(
                  labelhash(
                    label,
                  ),
                ),
              ],
            })

        console.log(
          '[POC] name =',
          name,
        )

        console.log(
          '[POC] victim =',
          victim,
        )

        console.log(
          '[POC] stale recipient A =',
          staleRecipient,
        )

        console.log(
          '[POC] intended recipient B =',
          intendedRecipient,
        )

        console.log(
          '[POC] tokenId =',
          tokenId.toString(),
        )

        const victimBefore =
          await readTokenBalance(
            victim,
            tokenId,
          )

        const staleBefore =
          await readTokenBalance(
            staleRecipient,
            tokenId,
          )

        const intendedBefore =
          await readTokenBalance(
            intendedRecipient,
            tokenId,
          )

        console.log('')
        console.log(
          '=== ON-CHAIN PRE-STATE ===',
        )

        console.log(
          '[POC] victim balance BEFORE =',
          victimBefore.toString(),
        )

        console.log(
          '[POC] A balance BEFORE =',
          staleBefore.toString(),
        )

        console.log(
          '[POC] B balance BEFORE =',
          intendedBefore.toString(),
        )

        expect(
          victimBefore,
        ).toBe(
          1n,
        )

        expect(
          staleBefore,
        ).toBe(
          0n,
        )

        expect(
          intendedBefore,
        ).toBe(
          0n,
        )

        /*
         * Open the real transfer page and let all normal owner,
         * transfer-role and detach-target reads settle BEFORE
         * installing the RPC interception.
         */
        await page.goto(
          `${PORTAL_APP_URL}/${nam

The original report as published on Immunefi, by manvi. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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

The recipient is captured as a mutation variable when preparation starts and is never re-checked against the live form before the transaction is built, while the input stays editable during preparation.

Impact

The ENS name is irreversibly transferred to the replaced address A rather than the intended B; the report notes a wallet that fully decodes the transfer may still show A and let an attentive user reject it.

What the attacker needed

User owns a transferable ENS V2 name; recipient edited during preparation; wallet does not clearly warn of stale recipient

The fix

The recipient and option fields should be disabled while preparation runs, or stale preparation results should be invalidated and the saved recipient re-checked before building the transaction.

How it was found

  1. Enter recipient A and press Transfer name.
  2. While the button shows Preparing, replace the recipient with B.
  3. The form and preview now show B.
  4. The pending token-ID lookup completes and saves the original recipient A.
  5. Proceed with the transaction, which encodes the saved recipient A.

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.

When you transfer an ENS name, the site first looks up some information in the background. During that wait the recipient box stays editable, so you can change it. The problem is that the site keeps the old address for the actual transfer, so the name can go to the address you just replaced even though the screen shows the new one.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

More by manvi

View all

26 more disclosed reports, best first.

More from ENS

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.