Portal treats a factory-verified UserRegistry as a PermissionedResolver, so “Set Pubkey” grants registry-wide UNREGISTER
The ENS Explorer portal accepted any syntactically valid address as a resolver and applied PermissionedResolver role meanings to it, so a genuine UserRegistry could be reached through the resolver roles route. A parent administrator selecting the visible 'Set Pubkey' checkbox therefore sent a grantRootRoles call whose bit 12 means UNREGISTER on the registry, letting a bounded child holder unregister a live sibling name and burn its NFT.
Originally disclosed on Immunefi
- Disclosed after under an hour
92771 w a critical portal treats a factory verified userregistry as a permissionedresolver so set pubkey grants registry wide unregister
Submitted on Sep 12th 2026 at 05:29:27 UTC by @IronsideSec for Audit Competition | ENS
- Report ID: #92771
- 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
Brief/Intro
After the disclosed Explorer and wallet confirmations, one checkbox labeled Set Pubkey — Can set public key records at the visible Root (all nodes) scope makes Explorer submit grantRootRoles(4096, holder) from the already-connected parent administrator's wallet to a genuine UserRegistry, where 4096 grants registry-wide UNREGISTER, not pubkey authority. Explorer therefore authors an unsafe target/bitmap pair: a legitimate child holder can point only its own leaf at the honest parent registry, yet the official View → Add user path gives that previously bounded holder persistent authority to unregister a live sibling and burn its versioned ERC-1155 NFT. The root cause is that the resolver-role route accepts any syntactically valid address and applies PermissionedResolver parameters without proving the target contract class.
Vulnerability Details
Security boundary and decisive result
A resolver-role write must be bound to an allowlisted PermissionedResolver implementation and its exact role namespace. A route label, leaf-resolver pointer, shared EAC selectors, or generic factory verification cannot authorize applying resolver bit meanings to a UserRegistry. The account and numeric bytes match the visible form selection; the defect is not a hidden post-confirmation mutation. Explorer itself authors a resolver-derived bitmap for a target it never proved was a resolver, so the displayed Set Pubkey permission and the target-executed UNREGISTER permission diverge at transaction construction.
The decisive path starts from bounded, ordinary authority. The holder of axel.bajigur.eth initially has only child-resource SET_RESOLVER, a zero parent-root bitmap, and no ability to alter or unregister sibling agent.bajigur.eth. The holder uses Explorer's supported custom-resolver flow to make that one leaf point to its honest parent registry. Explorer follows the pointer, labels the target as resolver roles, and gives the genuine parent administrator an official View link. The administrator follows Explorer's ordinary in-product path, deliberately keeps or selects the visible Root (all nodes) scope, adds the holder, selects only Set Pubkey — Can set public key records, and explicitly confirms and approves the transaction. Explorer then builds this request to the registry:
grantRootRoles(4096, 0xe5d87b1ff21eea9a774407a4c5e485ad57fee950)
On a genuine PermissionedResolver, 4096 is ROLE_SET_PUBKEY. On the deployed target, the same bit is ROLE_UNREGISTER. The pinned fork executes Explorer's exact 68 bytes against deployed code, changes the holder's root bitmap from zero to exactly 4096, unregisters agent.bajigur.eth, and changes the old sibling-token balance from 1 to 0. Revocation blocks later writes, but manual re-registration creates token version …00000001; it does not resurrect the burned token …00000000.
The minimum broken composition is visible in four production operations:
routes/resolver/$address.tsxchecks only whether the route parameter is an address.NameResolverRolesOverviewTable.tsxtakes the on-chain leaf pointer, queries it as a resolver, labels it<name> resolver roles, and creates the official/resolver/$address/rolesView link.routes/resolver/$address/roles/index.tsxperforms a sharedhasRootRolescheck and passes the same untyped address toResolverAddUserSheet.grantResolverRoles.tsencodes resolver roles and makes that address the transaction target.
The decisive statements are small:
// routes/resolver/$address.tsx
if (!isAddress(ctx.params.address, { strict: false })) throw redirect({ to: '/' })
// NameResolverRolesOverviewTable.tsx
<Link params={{ address: resolverAddress }} to="/resolver/$address/roles">View</Link>
// grantResolverRoles.ts
return toEoaCustomIntent({
from: walletClient.account.address,
to: resolverAddress,
data,
chainId,
})
resolverRoles.ts assigns ROLE_SET_PUBKEY = 1n << 12n and displays Set Pubkey / Can set public key records. No statement between the route and the write proves that the target uses that namespace.
The primary affected files are:
apps/portal/src/routes/resolver/$address.tsxapps/portal/src/routes/resolver/$address/roles/index.tsxapps/portal/src/features/resolver/components/NameResolverRolesOverviewTable.tsxapps/portal/src/features/resolver/components/ResolverAddUserSheet.tsxapps/portal/src/features/resolver/helpers/grantResolverRoles.tsapps/portal/src/lib/roles/resolverRoles.tsapps/portal/src/features/registry/hooks/useHasRoles.ts
The mounted name route and final handoff additionally exercise apps/portal/src/routes/$name/roles/index.tsx, apps/portal/src/features/records/hooks/useNameResolverAddress.ts, apps/portal/src/features/resolver/components/ChangeResolverForm.tsx, apps/portal/src/features/resolver/helpers/changeResolver.ts, and packages/transaction-manager/src/actors/eoa-transport.actor.ts. The frozen public Git links are listed under References, and the direct tree-equality commands under Proof of Concept bind the complete scoped Portal tree.
The indexer's registry-as-resolver projection amplifies reachability, but it is not the security boundary or the requested asset. Explorer also follows an ordinary owner-set raw leaf pointer and accepts a direct dynamic address. A complete client fix must therefore fail closed even if a projection is stale, wrong, or compromised.
Actors, preconditions, and ordinary reachability
The proof uses live capability fixtures from Ethereum Sepolia at block 11,679,987 (0xb238f3), block hash 0x10ddad104deb36c1652602bb52cca52f660ed60f044c79eb20f4c95541bfbeab:
| Item | Address or state | Attacker control or required authority |
|---|---|---|
| Bounded holder | 0xe5d87b1ff21eea9a774407a4c5e485ad57fee950 |
Owns live axel.bajigur.eth; has bit 24 only on resource 0xaef2307d656cb6145c9d0bcea7eeeab39a4b4163f04abf9261bfed2c00000000; has no root bit 12 or 24 and a zero root bitmap |
| Connected victim | 0xe610b819dd190fc8154d0190bb3f3e9758d42baa |
Genuine root administrator of the parent registry; the live projection and on-chain checks show the needed bit-12 admin authority. This is a namespace user's ordinary admin role, not protocol governance or a leaked key |
| Sibling used to measure harm | agent.bajigur.eth |
Live, unexpired child owned by the victim; old token ID 0x314c1dfbbccab41a44cf9fefc21e632eb8e01bc0346d4414114d4c3d00000000, balance 1 |
| Parent target | 0x9673702a3c850fa1c41d94c908083fc85f59461c |
Genuine factory-verified UserRegistry for bajigur.eth; neither attacker-deployed nor malicious |
| Genuine resolver control | 0x9224a7cc7d35899753456e53f78139a26884ed89 |
Factory-verified PermissionedResolver, used as the matched semantic control |
| UniversalResolver | 0xeeeeeeee14d718c2b47d9923deab1335e144eeee |
Deployed lookup used by the application path |
The addresses are live capability fixtures. This report does not allege that their real-world controllers are malicious. vm.prank impersonates them only in a local fork.
Scope behavior in the captured zero-node mounted state
A legitimate subname holder asking its namespace administrator for permission to manage a pubkey record provides a plausible reason to open Explorer's Add user feature. The captured production-shaped registry response embedded in the mounted test contains nodeCount: 0 and nodes: []. ResolverAddUserSheet initializes selectedNode to the empty-string root resource and derives every non-root choice only from nodes; the scope combobox renders Root (all nodes) plus those derived choices. Root is therefore the default and sole rendered scope in that captured/mounted state.
This is a bounded reachability fact, not a claimed permanent post-seed production state. The live pinned pre-state still had the child's old resolver; the post-seed leaf pointer is persisted only on the local fork, then composed in the mounted test with the separately captured zero-node response. If later indexing adds the child to resolver.nodes, a child scope may appear, but root remains visible and initially selected. The exploit does not rely on indexer lag or the absence of another option: the administrator must deliberately leave or select the visible root scope, complete Explorer's confirmation, and approve the wallet transaction.
There is no race. Exploitation requires the following deliberate sequence:
- The child holder changes only
axel.bajigur.eth's resolver to its parent registry. - The already-connected parent administrator opens
/axel.bajigur.eth/rolesand clicks the production View link. - The administrator clicks Add user, enters or selects the child holder, deliberately keeps or selects the visible Root (all nodes) scope, checks Set Pubkey, and clicks Save.
- The administrator starts the transaction, opens the wallet, and approves it.
- The holder later sends an
unregistertransaction.
This is not zero-click. The victim intentionally grants what the official app describes as a resolver record permission to an account that already legitimately controls the displayed child. The defect is that the app binds this consent to a different honest contract class and permission vocabulary.
The attack does not require a hand-built raw-address URL, search misclassification, an attacker-deployed contract, malicious fallback code, EAC bypass, signature bypass, stale or reordered rows, removal of a user, unresolved-resource fallback, name normalization, a chain mismatch, leaked keys, or control of the indexer.
The seed action is the supported custom-resolver mode at /axel.bajigur.eth/change-resolver. The production builder targets the parent registry and calls setResolver for only the holder's child resource. The fork proves that the holder's existing child-level bit 24 is sufficient and does not affect a sibling. The ordinary route then is:
/axel.bajigur.eth/roles
→ NameResolverRolesOverviewTable
→ “axel.bajigur.eth resolver roles”
→ production “View” link
→ /resolver/0x9673702a3c850fa1c41d94c908083fc85f59461c/roles
→ Add user
→ root (explicit/default; also the only scope in the captured zero-node projection)
→ “Set Pubkey — Can set public key records”
Both public URLs returned HTTP 200 in the fresh capture. The production-shaped GraphQL query returned a non-null resolver for the registry with nodeCount: 0, aliasCount: 0, roleHolderCount: 3, and five live EAC rows. Even if later indexing adds the leaf as a node, root remains a selectable/default scope; the proof does not edit a projected row.
End-to-end application and deployed-state execution
The complete path retains the vulnerable production route, components, builders, and final EOA transport:
- The holder uses
/$name/change-resolverandprepareChangeResolverTransactionwith its own child, resource bit 24, and the parent registry as the custom address. Explorer builds the exactsetResolver(anyId, registry)request. - The local fork executes those 68 bytes. Only the
axelleaf pointer changes to0x9673…461c; pre-grant attempts to unregister the sibling or change its resolver still revert. useNameResolverAddresscalls ENSjsgetResolverwith DNS bytes0x046178656c0762616a696775720365746800. The deployed UniversalResolver returns0x9673…461c, a nonzero node, and offset0. The mounted hook fixture is bound to that deployed result.- On
/$name/roles, the realNameResolverRolesOverviewTabledisplaysaxel.bajigur.eth resolver roles; the five registry EAC rows receive resolver labels. - The victim clicks the real production
<Link to="/resolver/$address/roles">and reaches the raw-address page without typing an address. - The resolver route calls
getHasRolesQueryOptionswith resolverROLE_SET_ADDRbit 0. The sharedhasRootRoles(1, victim)selector returns true because registry bit 0 isREGISTRAR, so Add user is enabled. - In the real
ResolverAddUserSheet, the victim selects the holder, node''for root, andROLE_SET_PUBKEY. The modal says resolver roles andGrant resolver roles for (root); it never saysUserRegistryorUNREGISTER. prepareGrantResolverRolesTransactionreceives the untyped target and resolver bit 12, then creates the exactgrantRootRoles(4096, holder)request to the registry.- The real transaction-manager EOA actor receives a matching Sepolia wallet account and passes
to,data,value, account, and wallet chain unchanged to viem. The final RPC send is mocked to prevent a live write. - The fork executes the same bytes against the deployed registry. The holder's root bitmap becomes exactly
0x1000, which the registry interprets asUNREGISTER. - The holder calls
UserRegistry.unregister(agentLabelId). The sibling's old-token balance becomes zero and its owner becomes the zero address. - The administrator revokes the root role and re-registers the saved owner, resolver, subregistry, roles, and expiry. A later holder
unregisterreverts, while the restored label has a new token version.
The evidence isolates contract class as the cause. Factory verification identifies the target as the honest deployed UserRegistryImpl, while the matched control identifies a genuine PermissionedResolverImpl. The mounted suite uses the real name route, View link, Add User form, labels, modal, builder, and transport handoff. The genuine-resolver control gives bit 12 only pubkey-writing authority. The positive type gate rejects the registry and accepts the genuine resolver. Before the grant, after revocation, and under the type gate, the sibling action fails.
Exact operations and byte binding
Holder's leaf-pointer request
from: 0xe5d87b1ff21eea9a774407a4c5e485ad57fee950
to: 0x9673702a3c850fa1c41d94c908083fc85f59461c
chainId: 11155111
value: 0
selector: 0xbc7b6d62 = setResolver(uint256,address)
anyId: 0xaef2307d656cb6145c9d0bcea7eeeab39a4b4163f04abf9261bfed2c00000000
resolver: 0x9673702a3c850fa1c41d94c908083fc85f59461c
0xbc7b6d62aef2307d656cb6145c9d0bcea7eeeab39a4b4163f04abf9261bfed2c000000000000000000000000000000009673702a3c850fa1c41d94c908083fc85f59461c
Its keccak256(bytes) is 0x167e048f3722d09f6f7f4d85177039b9fa67cdba9b45b725ccdce4c7e0d943b1. Its SHA-256 is f787cc16578267bf2f21695bb481ba8d6f55e16fbebbb1500bc557572bcd582b.
Victim's one-checkbox request
from: 0xe610b819dd190fc8154d0190bb3f3e9758d42baa
to: 0x9673702a3c850fa1c41d94c908083fc85f59461c
chainId: 11155111
value: 0
selector: 0x072d5d77 = grantRootRoles(uint256,address)
bitmap: 4096 = 0x1000 = bit 12
account: 0xe5d87b1ff21eea9a774407a4c5e485ad57fee950
Exact calldata:
0x072d5d770000000000000000000000000000000000000000000000000000000000001000000000000000000000000000e5d87b1ff21eea9a774407a4c5e485ad57fee950
length: 68 bytes
SHA-256(bytes): 8864b191415ca9ea58cbe958cfe82a8adce0f5a831c7b659b0ab8d59a83a2dda
keccak256(bytes): 0x639671e7cca7c3fb76540bfa5b790a8e930e2ff70cfd018170d3baa05586fc82
The bridge is byte-exact, not an inferred equivalence. The mounted test invokes the production builder and compares request.data with this literal. The EOA test proves that the real transport gives viem the same literal, target, account, value, and wallet chain. The fork defines the same 68-byte constant, proves that its keccak equals abi.encodeWithSelector(0x072d5d77, 1 << 12, holder), and executes that constant with REGISTRY.call. Running the embedded primary fork test with -vvvv prints both equal keccak operands as 0x639671…6fc82 before the call.
Both contract families expose the same EAC grantRootRoles(uint256,address) signature and selector 0x072d5d77. The embedded tests prove that the literal request equals the ABI encoding for that signature and that the registry executes it under its own role namespace. This is role-namespace type confusion, not reliance on a different-signature collision or fallback trick.
| Bit | Bitmap | Explorer / PermissionedResolver meaning |
UserRegistry meaning |
Measured consequence |
|---|---|---|---|---|
| 0 | 0x1 |
Set Address / ROLE_SET_ADDR |
ROLE_REGISTRAR |
Supporting three-bit test registers or reissues labels without the intended registrar/payment policy |
| 12 | 0x1000 |
Set Pubkey / ROLE_SET_PUBKEY |
ROLE_UNREGISTER |
Primary one-checkbox test burns a live sibling NFT |
| 24 | 0x1000000 |
Set Name / ROLE_SET_NAME |
ROLE_SET_RESOLVER |
Supporting test redirects another live child |
| combined | 0x1001001 |
Three resolver permissions | REGISTRAR + UNREGISTER + SET_RESOLVER |
Supporting breadth test reissues, registers a fresh label, and redirects a sibling |
Admin bits use the same managerBit + 128 layout, so the real registry administrator can grant the selected manager bit. Explorer's admin checkboxes are disabled; this report does not claim an attacker admin-bit lockout.
Deployed implementation binding and causation controls
At the pinned block, both targets are genuine factory deployments but they belong to opposite contract families:
| Check | Genuine target registry | Genuine resolver control |
|---|---|---|
| Proxy or control address | 0x9673702a3c850fa1c41d94c908083fc85f59461c |
0x9224a7cc7d35899753456e53f78139a26884ed89 |
VerifiableFactory.verifyContract |
0x624a25d67b59d587752ebec8dded8827dae52050 (UserRegistryImpl) |
0x9eae5c2730a7dd16bdd1dee6421a1b91e3b0365e (PermissionedResolverImpl) |
IEnhancedAccessControl 0x8f452d62 |
true | true |
IExtendedResolver 0x9061b923 |
false | true |
The embedded fork verifies both implementation identities directly through VerifiableFactory.verifyContract and checks the distinguishing interface matrix shown above. Generic factory verification is insufficient because both honest families pass it; the gate must require the expected implementation family.
The primary fork test measures the complete but-for state transition and recovery:
| Fact | Before | Correct implementation | Vulnerable execution | After corrective recovery |
|---|---|---|---|---|
| Holder parent-root bit 12 | false; root bitmap 0 |
Registry target rejected before render, estimate, or send; remains false |
true; root bitmap exactly 4096 |
false after revokeRootRoles(4096, holder) |
Holder can unregister agent |
Reverts | Reverts | Succeeds | Reverts again |
Holder can change agent resolver |
Reverts | Reverts | Not needed for the one-bit arm; succeeds in the three-bit breadth arm | Reverts after revocation |
agent old token balance at victim |
1 |
1 |
0 after unregister |
Still 0: the old token remains burned |
agent label owner |
Victim administrator | Victim administrator | Zero address after unregister | Victim administrator after manual re-registration |
| Recovered token ID and balance | No replacement | No replacement needed | No replacement in one-bit attack | 0x314c…00000001, balance 1; distinct from old 0x314c…00000000 |
Holder's legitimate axel resource bit 24 |
true | true | true | true; only the illicit root role is removed |
Initial unregister(agent) and setResolver(agent, …) calls from the holder revert. The exact leaf-pointer request then succeeds only for axel. The exact mounted grant gives root bit 12, after which unregister(agent) succeeds, reduces the old ERC-1155 balance from one to zero, and clears ownership. Because the one-checkbox arm does not grant REGISTRAR, the holder still cannot reissue the label. The administrator revokes bit 12 and re-registers the saved tuple; a later holder unregister attempt reverts.
The primary trace records the exact deployed-code events:
EACRolesChanged(resource: 0, account: holder, oldRoleBitmap: 0, newRoleBitmap: 4096)
LabelUnregistered(tokenId: 0x314c…00000000, sender: holder)
TransferSingle(operator: holder, from: victim, to: 0x0000000000000000000000000000000000000000,
id: 0x314c…00000000, value: 1)
The matched resolver control grants bit 12 on the genuine resolver, successfully writes a pubkey record, and fails when the registry unregister selector is called. The positive type-gate control rejects the UserRegistry implementation and accepts the genuine PermissionedResolver. These controls isolate contract class as the cause.
The three-checkbox test is supporting breadth, not a prerequisite for the primary result. It measures REGISTRAR | UNREGISTER | SET_RESOLVER, same-label attacker reissue, a fresh free label, and another child's resolver redirection, followed by full administrator cleanup.
Proof boundaries, recovery, and falsification controls
The mounted application test replaces network and signing boundaries so it cannot contact live users or mutate Sepolia. Each load-bearing value is independently bound to the inline public HTTP/GraphQL reproduction or the pinned fork:
| Boundary in the application test | Why it is replaced | Independent binding |
|---|---|---|
| ENSv2 owner, leaf resolver result, resolver overview, and role-gate query | Keeps the mounted UI deterministic and prevents live network access during Vitest | The inline public GraphQL reproduction and pinned-fork assertions, including the deployed UniversalResolver call, reproduce each value |
| Connected wagmi wallet and address-input resolution | No live account is contacted | Pinned on-chain administrator/holder roles bind both addresses; the EOA test enforces the matching account and exact recipient |
Final viem sendTransaction result |
Prevents a production write | The real EOA actor runs up to its viem boundary; Foundry then executes identical bytes against deployed registry semantics |
| Sheet portal, gas display, headers, and unrelated name-page sections | Presentation-only dependencies | The vulnerable production routes, name-to-resolver table, View link, Add User form, labels, modal intent, builders, and transport actor remain real |
vm.prank identities |
A local fork has no private keys | Initial roles, ownership, implementations, interfaces, and code all come from pinned deployed state; no storage is injected |
Mechanically, the mounted suite preserves the real @tanstack/react-query module but overrides useQuery and dispatches captured fixtures by options.queryKey?.[0]: get-ens-owner, get-name-resolver-address, resolver-overview, and hasRoles. It also disables the $name parent beforeLoad/loader and the resolver-role prefetch loader while retaining the production parent component and resolver route guard. Those component-path query functions and prefetches do not execute during the mounted render. A separate assertion executes the real getHasRolesQueryOptions(...).queryFn against the isolated chain client and verifies the exact `hasRootRoles(1, victim)
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 portal's resolver-role route validated only that the address was syntactically valid and never proved the target contract was an allowlisted PermissionedResolver implementation, so resolver bit meanings were applied to a UserRegistry.
Impact
A bounded child holder could unregister a live sibling name and burn its versioned ERC-1155 token, though the administrator must deliberately confirm the grant and revocation blocks later writes without restoring the burned token.
What the attacker needed
Holder owns a child name; victim is parent registry admin; victim clicks View and confirms grant; victim approves wallet transaction
The fix
The portal should fail closed by requiring the target to match an allowlisted PermissionedResolver implementation family before rendering, estimating or sending resolver-role grants.
How it was found
- The child holder changes only its own leaf's resolver to point at the honest parent registry.
- The parent administrator opens the child's roles page and clicks the production View link.
- The administrator clicks Add user, selects the holder, keeps the visible root scope and checks Set Pubkey.
- The administrator starts and approves the wallet transaction.
- The holder later sends an unregister transaction against the sibling name.
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 name registry and a resolver are two different contracts that happen to share a function with the same name and number codes. The portal assumed any address reached through its resolver page was a resolver, so the number it labelled 'can set public key records' was actually the registry's 'can unregister names' code. An administrator who thought they were granting a harmless record permission instead gave away the power to delete a name.
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.