Skip to content
Business logic Audit finding Advanced

ResolveAddressOrName treats an unresolved V1 Manager as a transfer recipient, sending a V2 name NFT to an unintended address

Explorer's transfer form reused a role-granting helper that falls back to an ENS name's Registry owner when canonical forward resolution returns null, so an unwrapped V1 name with no address record resolved to its delegated Manager. A sender entering that name as recipient had the V2 name NFT transferred to the Manager instead of the intended party, and the token could then be moved to a separate vault and was not recoverable by the V1 registrant's reclaim.

go4ko Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

91345 w a critical resolveaddressorname treats an unresolved v1 manager as a transfer recipient sending a v2 name nft to an unintended address

Submitted on Aug 31st 2026 at 19:18:16 UTC by @go4ko for Audit Competition | ENS

  • Report ID: #91345
  • Report Type: Websites & Apps
  • Report severity: Critical
  • 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

Explorer's transfer form accepts either an address or ENS name as the recipient. Its resolution path reuses resolveAddressOrName, a helper whose source comment explains that it falls back to an ENS owner's address so a role can still be granted when the name has no address record.

That fallback is unsafe in an asset-transfer workflow. When canonical forward resolution returns null, the helper calls getEnsOwner and returns an authority address instead. For an active, unwrapped V1 .eth name, the returned owner is the ENS Registry owner—the delegated Manager—which can differ from the BaseRegistrar registrant. Neither address is an ETH address record, and Registry management authority over the recipient name does not authorize receipt of the sender's unrelated V2 name NFT.

The fallback's provenance is discarded. useAddressResolution classifies the non-null Manager as resolved; AddressNameInput therefore suppresses its unresolved-name warning; SendNameForm considers the Manager a valid recipient; and transferToken encodes it directly into the V2 Registry's ERC-1155 safeTransferFrom calldata.

The final browser E2E demonstrates the complete path without mocking resolution, form validation, transaction construction, wallet approval, mining, calldata decoding, receipts, or token balances. Canonical Universal Resolver lookup of fgeorgescu.eth is null, its V1 Manager and registrant are distinct, the live Explorer DOM displays the Manager and no unresolved warning, and the real default transfer flow mines:

safeTransferFrom(sender, manager, tokenId, 1, 0x)

The sender's balance changes from 1 to 0, the Manager's from 0 to 1, and the registrant's remains 0. A later Manager-to-vault transfer succeeds without further sender participation. A former-sender transfer reverts, and even the V1 registrant's successful reclaim does not recover the unrelated V2 token.

Security invariant and actors

The transfer form promises an ENS name or address recipient. For a name input, the required invariant is:

If canonical forward resolution does not return a non-zero address,
the transfer recipient must remain unresolved and submission must stay disabled.

Registry ownership, BaseRegistrar registration ownership, wrapper ownership,
and role authority must never substitute for a missing address record.

The recorded PoC uses four distinct deterministic local-fork actors:

  • S — sender; owns the source V2 name and authorizes the Explorer transfer;
  • R — BaseRegistrar registrant of the V1 name entered into the recipient field;
  • M — delegated V1 Registry Manager returned by the vulnerable fallback;
  • V — a separate attacker vault to which M moves the wrongly received NFT.

The addresses preserved in the successful run are:

Actor Address
S 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
R 0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc
M 0x976EA74026E726554dB657fA54763abd0C3a0aa9
V 0x14dC79964da2C08b23698B3D3cc7Ca32193d9955

M is not an ENS protocol administrator, project operator, or trusted role over S's token. M only manages the separate V1 name supplied as the recipient input. The defect crosses that authority boundary and turns name-management authority into ownership of S's unrelated NFT.

The vulnerable state transition is:

V1 name is active and unwrapped
    -> BaseRegistrar registrant = R
    -> ENS Registry owner / Manager = M
    -> resolver = 0x0
    -> canonical forward resolution = null
    -> S enters the V1 name in Explorer's V2 transfer form
    -> role-grant helper substitutes M for the missing address record
    -> UI classifies the input as resolved and suppresses its warning
    -> transfer button becomes enabled
    -> S approves Explorer's default transfer sequence
    -> V2 Registry mines safeTransferFrom(S, M, tokenId, 1, 0x)
    -> M transfers the token to V
    -> S can no longer transfer it
    -> R reclaims V1 management, but the V2 token remains at V

Vulnerability Details

1. The fallback was expressly added so roles can still be granted

apps/portal/src/features/roles/helpers/addUser.handlers.ts:11-40 first performs canonical forward resolution. If it returns no address, the helper replaces the missing result with ENS ownership data:

TS
export async function resolveAddressOrName({
  client,
  nameOrAddress,
}: ResolveAddressOrNameParams): Promise<Address | null> {
  if (isAddress(nameOrAddress, { strict: false })) {
    return nameOrAddress as Address
  }

  try {
    const resolved = await getEnsAddress(client, {
      name: nameOrAddress,
      universalResolverAddress,
    })

    let resolvedAddress = resolved

    // Fallback for names that do not set an address record:
    // use current ENS owner address so the role can still be granted.
    if (!resolvedAddress) {
      const ownerResult = await getEnsOwner({ name: nameOrAddress })
      if (ownerResult.isOk()) {
        resolvedAddress = ownerResult.value?.owner ?? null
      }
    }

    return resolvedAddress
  } catch {
    return null
  }
}

The comment identifies the intended semantic: allowing a role to be granted to the name's owner when no address record exists. That policy cannot safely be generalized to a token destination. An ownership/controller address is an authority over the input name; it is not the address to which the user asked to transfer another asset.

2. For an unwrapped V1 name, the retained owner is the Manager—not necessarily the registrant

apps/portal/src/utils/ens/resolveEnsOwner.ts:72-104 prefers V2 ownership for .eth names, then falls back to ENSjs V1 ownership:

TS
const v1Owner = await getOwnerV1(client, { name })
if (v1Owner?.owner && v1Owner.owner !== zeroAddress) {
  return {
    owner: v1Owner.owner,
    registryAddress: v1EthRegistry,
    protocolVersion: 'ENSv1',
  }
}

For an active unwrapped V1 .eth 2LD, ENSjs exposes distinct Registry owner and BaseRegistrar registrant authorities. This function retains .owner and discards .registrant. Delegating management while retaining registration is a supported ENS state, so those addresses can legitimately differ.

The repository models that distinction correctly elsewhere. useMigrationStatus.ts:29-40 explicitly documents that the BaseRegistrar registrant is the unwrapped token holder while the Registry owner is a controller that may be different. The transfer-resolution path loses that distinction.

3. The role-specific fallback is exported as the shared address resolver

apps/portal/src/features/address/queries/getResolvedAddress.ts:13-45 imports the role helper and exposes it as the generic query for a name-or-address field:

TS
/**
 * Resolve a name/address input (an ENS name or a 0x address) to an address.
 * Addresses pass through; names go through the universal resolver, falling
 * back to the ENS owner when the name has no address record.
 */
export const getResolvedAddress = ResultFn(async function* (
  params: GetResolvedAddressParams,
) {
  const client = yield* safeGetClient()
  const address = await resolveAddressOrName({
    client,
    nameOrAddress: params.nameOrAddress,
  })
  return ok<Address | null>(address)
})

The type is only Address | null; it carries no provenance such as raw-address, address-record, or owner-fallback. Downstream transfer code therefore cannot distinguish a user-supplied or canonically resolved destination from an authority address substituted for a failed lookup.

4. A fallback address becomes the resolved UI state

apps/portal/src/features/address/hooks/useAddressResolution.ts:47-89 classifies every non-null query result as resolved:

TS
.with({ resolved: P.nonNullable }, () => 'resolved' as const)
...
return {
  address: status === 'resolved' ? resolved : null,
  ...
}

AddressNameInput.tsx:54-87 renders its warning only for unresolved:

TSX
.with('unresolved', () => (
  <p className="text-sm mt-1.5 text-danger">
    Could not resolve an address for “{value.trim()}”
  </p>
))

Because the fallback changed null into M before status derivation, Explorer suppresses the exact warning that should stop the user. The successful PoC records unresolvedWarningCount == 0 even though an independent canonical Universal Resolver call returns null.

5. The transfer form treats the substituted Manager as a valid recipient

apps/portal/src/features/transfer/components/SendNameForm.tsx:81-108 accepts any non-null address that is not the sender and not zero:

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

const isSelf = !!recipient && isAddressEqual(recipient, owner)
const isZeroAddress = !!recipient && isAddressEqual(recipient, zeroAddress)
const hasValidRecipient = !!recipient && !isSelf && !isZeroAddress

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

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

The returned Manager passes all three checks. RecipientPreview at SendNameForm.tsx:253-281 then renders that address as the recipient and may decorate it with the address's own primary name and avatar. Nothing tells the sender that the displayed value came from Registry authority rather than the entered name's ETH address record.

6. The substituted Manager is encoded into a real ERC-1155 transfer

apps/portal/src/features/transfer/helpers/transferToken.ts:46-90 constructs the V2 name transfer:

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

There is no later resolution or recipient-validation boundary. The address accepted by the UI becomes the on-chain to argument. The V2 Registry correctly enforces the calldata it receives; the defect is Explorer constructing that calldata from the wrong semantic source.

State transition demonstrated by the E2E

Stage Canonical resolution of recipient name V1 registrant V1 Manager V2 token holder Security result
Fixture established null R M S No address record designates M or R as transfer recipient.
Explorer resolves input null R M S UI displays M, suppresses unresolved warning, and enables transfer.
S approves default flow null R M S until mining Explorer constructs safeTransferFrom(S, M, ...).
Portal transfer mines null R M M S loses the V2 name; R receives nothing.
M exfiltrates null R M V M disposes of the token without further S interaction.
R reclaims V1 management null R R V Repairing the input name's management does not recover S's V2 token.

Attack sequence

{% stepper %} {% step %}

S owns a transferable V2 name

S opens its real Explorer ownership page. {% endstep %}

{% step %}

The recipient name has split V1 authority

The intended recipient is represented by an active, unwrapped V1 .eth name whose BaseRegistrar registrant is R.

That V1 name has delegated Registry Manager M and no resolver/address record. Canonical forward resolution therefore returns null. {% endstep %}

{% step %}

S enters the V1 name into the transfer form

S clicks Transfer and enters the V1 name in the ENS name or address field. {% endstep %}

{% step %}

Explorer substitutes the Manager

Explorer's shared resolver calls the canonical Universal Resolver, receives null, and substitutes M through the role-grant owner fallback. {% endstep %}

{% step %}

The UI treats the input as resolved

useAddressResolution reports the input as resolved.

Explorer displays M's full address, omits Could not resolve an address for …, and enables Transfer name. {% endstep %}

{% step %}

S starts the default transfer flow

S leaves all transfer settings at their UI defaults and starts the transfer.

The default flow requests two wallet approvals: source-name resolver detachment and token transfer. {% endstep %}

{% step %}

Explorer transfers the V2 token to M

The second mined transaction targets the V2 Registry and decodes exactly to safeTransferFrom(S, M, tokenId, 1, 0x).

S's token balance becomes 0, M's becomes 1, and R's remains 0. {% endstep %}

{% step %}

The token is moved and cannot be recovered through V1 reclaim

A direct transfer attempt from former owner S reverts.

M transfers the token to separate vault V; the transaction succeeds and V's balance becomes 1.

R successfully executes the canonical V1 BaseRegistrar.reclaim operation, restoring R as V1 Registry owner.

The unrelated V2 token remains at V. No further S action or signature is required after the Portal transfer. {% endstep %} {% endstepper %}

Preconditions and practical likelihood

Internal preconditions

  1. The victim controls a transferable V2 name.
  2. The victim uses Explorer's supported ENS name or address recipient input.
  3. The entered name has no canonical ETH address result.
  4. ENS ownership lookup nevertheless returns a non-zero address different from the sender.
  5. The victim trusts Explorer's resolution result and approves the displayed default transaction sequence.

V1 split-authority condition demonstrated by the PoC

The strongest concrete case is an active, unwrapped V1 .eth 2LD where:

BaseRegistrar.ownerOf(labelhash) = R
ENSRegistry.owner(namehash)      = M
ENSRegistry.resolver(namehash)   = 0x0
UniversalResolver address        = null
R != M

This is supported ENS state. The registrant can delegate Registry management without transferring the registration token. The PoC verifies the registration is unexpired and reads every value independently from the local Sepolia fork before the browser action.

The exploit does not require a malicious ENS administrator, protocol multisig, registrar controller, application operator, connected-wallet provider, RPC provider, or transaction relayer. M is simply an address controlling the separate recipient name. Its authority over that name is not authority over S or S's V2 token.

The report does not hide the required user interaction: Explorer shows M's full address and warns generally that transfers are irreversible. S must still approve the transactions. That is the interaction explicitly contemplated by impact 6285: the application displays or pre-fills an incorrect address or transaction detail and the user submits a transaction to an unintended recipient. The security defect is that Explorer labels M as the successful interpretation of the ENS name and suppresses the specific unresolved-name warning.

Why existing controls do not stop the issue

Existing control What it establishes Why the unintended transfer remains possible
ENS name syntax validation Input is syntactically a name It does not prove the name has an ETH address record.
Universal Resolver lookup Produces the canonical address or null Its null result is overwritten by the owner fallback.
useAddressResolution status A non-null query result exists It cannot distinguish an address record from ownership data.
Unresolved warning Alerts users when status is unresolved The fallback changes the status to resolved, suppressing it.
Self/zero-address checks Recipient is neither S nor zero M is a non-zero third-party address, so it passes.
Recipient preview Shows the address Explorer will use It presents the fallback as a resolved recipient and does not disclose its provenance.
General irreversible-transfer warning Tells S to check the recipient The application itself supplied M as the result of S's ENS-name input.
Default resolver-detach step Detaches the source V2 name's resolver It does not validate the recipient name and does not change the token destination.
Wallet approval S authorizes generated calldata The approved calldata contains the incorrect recipient produced by Explorer.
ERC-1155 receiver/ownership checks Enforce the submitted transfer They correctly transfer the token to M; they do not know the user's ENS-name intent.
V1 registrant reclaim Restores management of the recipient V1 name It cannot reverse the separate V2 NFT transfer.

Known-issue distinction

This finding does not share a root cause with the disclosed competition issues most closely related to Explorer inputs or transfers:

Disclosed issue Distinction
EXP-INPUT-005 Concerns ENS-normalization-invalid or transformed inputs, including homoglyphs, bidi/control characters, and leading/trailing dots. ENS-004 uses the ordinary normalized name fgeorgescu.eth; the defect is substituting Registry ownership for missing forward resolution.
WEB-1305 Concerns transferring V2 roles to a V1 name remaining pending instead of being blocked. ENS-004 completes an ERC-1155 V2 token ownership transfer to the wrong address.
QA-01 Concerns certain transfer role combinations or names with subnames later breaking record updates or primary-name setting. ENS-004 changes the immediate token recipient and demonstrates completed loss plus exfiltration.
WEB-1257 Concerns registry/primary-name state retained after a parent transfer. ENS-004 has no parent transfer or subname dependency; its encoded recipient is wrong.
QA-06 Concerns a deleted or non-resolving subname remaining displayed as a primary name and later profile errors. ENS-004 concerns recipient resolution in the transfer form and a successfully mined V2 NFT transfer.
EXP-4337-003 Concerns request.from not being compared with the connected EOA. Here the sender and connected wallet are correct; the incorrect value is the to argument nested inside Portal-generated safeTransferFrom calldata.

The ENS contracts behave correctly in the PoC. The V2 Registry transfers the token exactly as Explorer requests. The root cause is the in-scope Explorer application reusing a role-oriented owner fallback in a transfer-recipient resolution boundary.

Impact Details

The appropriate competition impact is:

Critical (6285) — 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 or showing the wrong recipient or amount on a transaction the user then approves.

The E2E proves every element of that impact:

  • Incorrect displayed address: canonical forward resolution is null, but Explorer visibly presents M as the resolution of fgeorgescu.eth.
  • Incorrect pre-filled transaction detail: the production transfer helper inserts M into the ERC-1155 to argument.
  • User interaction: S uses the normal transfer form and authorizes the two transactions requested by the default flow.
  • Submission to the unintended recipient: the mined transfer receipt succeeds and calldata decodes exactly to safeTransferFrom(S, M, tokenId, 1, 0x).
  • Concrete loss: S's balance falls from 1 to 0; R never receives the token; M receives it and transfers it onward.
  • No automatic recovery: former owner S cannot transfer the token, and R reclaiming the V1 name's management does not recover it.

The affected asset is a V2 ENS name NFT. The report does not claim that the local-fork token has production market value, that every unresolved name is adversarial, or that protocol-level recovery is impossible. It demonstrates the scoped application failure and resulting ownership transfer deterministically on a pinned local fork without modifying live state.

Risk Breakdown

Gate Verdict Evidence
Is the root cause in an in-scope asset? YES The fallback, shared resolution query/hook, recipient form, and transfer helper are all under apps/portal.
Does canonical resolution actually fail? YES The PoC asserts resolver 0x0 and Universal Resolver result null.
Does Explorer nevertheless present a recipient? YES Live DOM evidence records M visible, zero unresolved warnings, and an enabled transfer button.
Does the victim use the real UI and wallet flow? YES Playwright drives Explorer and the repository's headless wallet provider through both default approvals.
Is the wrong address present in mined calldata? YES The exact successful Registry transaction decodes to safeTransferFrom(S, M, tokenId, 1, 0x).
Does ownership actually change? YES Post-transfer balances are S = 0, M = 1, R = 0.
Can the unintended recipient dispose of the NFT? YES M-to-V safeTransferFrom succeeds; balances become M = 0 and V = 1.
Can S still transfer it? NO The explicit post-transfer attempt from S reverts.
Does V1 reclaim recover it? NO R successfully reclaims V1 management while the V2 token remains at V.
Does exploitation require a malicious protocol role? NO M has authority only over the separate recipient name; no protocol administrator or trusted application operator participates.

Severity is Critical under the competition's explicitly scoped impact 6285. Likelihood depends on a user transferring to a name that lacks an address record but has a non-zero owner/Manager fallback, and then trusting Explorer's resolution presentation. That conditional likelihood does not change the demonstrated impact.

Recommended Remediation

Required fix

Separate role-grant subject resolution from transfer-recipient resolution.

For a transfer recipient, accept only:

  1. a syntactically valid raw address supplied by the user; or
  2. a non-zero address returned by canonical forward resolution of the entered ENS name.

If canonical forward resolution returns null or zero, return null, keep the unresolved warning visible, disable the transfer button, and do not build transaction calldata.

In particular, never substitute any of the following for a missing transfer address record:

  • ENS Registry owner/Manager;
  • BaseRegistrar registrant;
  • NameWrapper owner;
  • V2 token owner;
  • role holder; or
  • smart-account owner.

Defense in depth

  • Give resolveAddressOrName a purpose-specific API or split it into resolveRoleSubject and resolveTransferRecipient so unsafe reuse is difficult.
  • Preserve resolution provenance in the return type, for example { address, source: 'raw' | 'address-record' | 'owner-fallback' }, and require transfer code to accept only raw or address-record.
  • Add a final transfer-boundary assertion before startTransfer and again before encoding calldata.
  • In the review and wallet-confirmation UI, show the original input, final recipient, and resolution source.
  • Add a regression test for an unwrapped V1 .eth name with registrant != manager, resolver 0x0, and canonical address null; the form must show the unresolved warning, keep submission disabled, and encode neither authority address.
  • Add equivalent tests for wrapped V1 names, V2 names, subnames, expired names, and resolver contracts that return zero or revert.
  • Keep the ordinary positive controls: a raw address must pass through unchanged, and a name with a real address record must resolve to exactly that record.

Changing only the warning copy is insufficient. The security boundary must prevent owner-derived addresses from entering asset-transfer calldata.

References

The original report as published on Immunefi, by go4ko. 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

Likely a role-oriented owner fallback in the shared name-or-address resolver was reused for transfer recipients, and the result carried no provenance, so a Registry Manager address was treated as a valid resolved destination.

Impact

A user could send a V2 name NFT to an unintended address that only manages the entered V1 name, losing the token, and the V1 registrant's reclaim does not recover it; the sender must still approve the displayed transactions.

What the attacker needed

Victim owns a transferable V2 name; recipient name has no address record; recipient name has a distinct Manager; victim enters that name as recipient

The fix

The transfer path should only accept a canonically resolved address record or a raw address, keeping the owner fallback for role granting and surfacing unresolved names as unresolved.

How it was found

  1. The sender owns a transferable V2 name and opens the Explorer ownership page.
  2. The recipient name is an active, unwrapped V1 name with a delegated Manager and no resolver or address record, so canonical resolution returns null.
  3. The sender clicks Transfer and enters that V1 name in the recipient field.
  4. Explorer's resolver substitutes the Manager address through the owner fallback and the UI marks the input as resolved, hiding the unresolved warning.
  5. The sender starts the default transfer flow and approves the wallet prompts.
  6. The V2 Registry mines a transfer of the token to the Manager, who then moves it to a separate vault; the V1 registrant's reclaim does not recover it.

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 type a name into a send form, the app is supposed to look up the wallet address that name points to. Here the name pointed to no address at all, so the app quietly used the address of whoever controls that name instead, and showed it as if it were the correct destination. The sender approved what looked like a normal transfer, and the valuable name token went to that controller rather than to the person they meant.

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.

More by go4ko

View all

17 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.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.