One ticked permission on a record-scoped row makes the Explorer's Roles page sign grantRootRoles — authority over every name the resolver serves — with no scope shown on any sc
The ENS Explorer's Roles page could not compute role resources scoped to a single text key or address coin type, so it displayed an empty name and then treated that empty string as root scope. An operator ticking one permission on such a row would sign a grantRootRoles transaction giving the grantee authority over every name the resolver serves, with no scope shown on screen.
- Disclosed after under an hour
92239 w a critical one ticked permission on a record scoped row makes the explorer s roles page sign grantrootroles authority over every name the resolver serves with no scope shown on any sc
Submitted on Sep 8th 2026 at 12:13:04 UTC by @drMurlly for Audit Competition | ENS
- Report ID: #92239
- 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
- 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
- Taking state-modifying authenticated actions (with or without blockchain state interaction) on behalf of other users without any interaction by that user, such as: Changing registration information Notification/settings changes
Description
Brief/Intro
On a local fork of Sepolia, an account whose only on-chain role is write one text record on one name it does not own was handed the ability to write address records on names belonging to other people, and — via the same one checkbox — to replace the resolver's code and hijack every name it serves — by signing the transaction the Explorer builds for a one-checkbox permission edit.
Four checks, each under a minute, that settle this report.
| # | check | expected |
|---|---|---|
| 1 | apps/portal/src/lib/roles/resolverRoles.ts:138-141 — the second word of the resource |
the literal ZERO_BYTES32, JSDoc at :134-137 "(with part = 0)" |
| 2 | apps/portal/src/features/resolver/helpers/grantResolverRoles.ts:47-60 — the scope ternary, and :20, the JSDoc on the parameter it reads |
name === '' ? scope:'root' : scope:'name', and "empty string for ROOT_RESOURCE (all names)" |
| 3 | EnhancedAccessControl.sol:452-455 in the deployed resolver — what a root grant reaches |
_getRoles(ROOT_RESOURCE, account) | _getRoles(resource, account) — every name, no fork needed |
| 4 | cp poc/E8-15_render_screen.test.tsx apps/portal/src/ && pnpm vitest run — no wallet, no RPC, no chain |
10 passing: Name cell "", no scope sentence, grantRootRoles 68 bytes from one ticked checkbox |
The cause is one line. A PermissionedResolver scopes a role to a resource, keccak256(node ‖ part), with four kinds of part: root, a whole name, one text key, one address coin type. The Explorer models one — resolverRoles.ts:138-141 hardcodes the second word to zero:
export const computeNameResource = (name) =>
keccak256(encodePacked(['bytes32','bytes32'], [namehash(name), ZERO_BYTES32]))
So a role scoped to one text key produces a resource the Explorer can never compute. buildResourceToNameMap misses it, groupRolesByAccount records no name, ResolverRolesSidebar.tsx:169 falls to roleName = '', and both grantResolverRoles.ts:47-60 and revokeResolverRoles.ts:47-60 read that empty display string as scope: 'root', emitting grantRootRoles — authority over every name the resolver serves — for one ticked checkbox.
Nothing on screen warns, and that is a screenshot, not a reading (poc/E8-15_render_screen.log, poc/screens/). The Name cell renders empty, the scope sentence is suppressed, and the confirmation screen reads only "Save resolver role changes / Update roles for 0x49d037a6…" — the identical string whether the grant reaches one name or all of them.
Executed, on two resolvers, each with an A/B control from one snapshot (Proof of Concept field, runs 1–4b). On the single-owner 0x34b1699b… the escalation is isolated: after the grant the grantee gains ROLE_SET_ADDR and writes sideloadtest26.eth's address record, which the correctly scoped control refuses. On 0x980ea45e…, title read on chain at the pinned block from the namegate.eth registry (poc/E8-15_crossowner_title.log, §1) shows four live names under three owners who are neither the signer nor the grantee; the grantee wrote investorb.namegate.eth's coin-60 record (owner 0x31faa2f6…), while the control leaves it refused. (The app's own indexer field lists eight names under six owners; it is expiry-blind — two labels had expired — so this report uses the on-chain figure of four/three throughout.)
And the ceiling: the same checkbox, ticking Upgrade, replaces the resolver's code — executed, every name then resolving to the attacker permanently (poc/E8-15_upgrade_ceiling.log).
16 role groups on 10 resolvers were in this state on 2026-09-05 (poc/E8-15_roleconn_sweep.log; a live-testnet floor). The indexer already publishes the fix: ResolverDetail.namedResources returns {resource, name, recordKind, recordKey, coinType} and carried an entry for 33 of the 33 flagged non-root rows — yet namedResources appears once in tracked sources (git grep), in generated types, never queried.
Vulnerability Details
The protocol has four role scopes; the Explorer computes one
A PermissionedResolver role is scoped to a resource = keccak256(node ‖ part), returning 0 when both words are zero — that zero is ROOT_RESOURCE (PermissionedResolverLib.sol:71-80). The part selects granularity, and each scope's reach was granted on a fork and measured, not read off source (poc/E8-15_scope_model.log):
| scope | part |
measured reach |
|---|---|---|
| root | — (grantRootRoles) |
every name the resolver serves |
| name | bytes32(0) |
one name, all its records |
| text key | keccak256(key) |
one name, one text record |
| addr coin type | keccak256(bytes32(coinType)) |
one name, one address record |
The four scopes are documented in the code the Explorer ships against, so the model needs no deployed-contract source. The app's own JSDoc already fixes part = 0 as one whole name (resolverRoles.ts:135, "the EAC resource ID for a name (with part = 0)"). The ensjs package the Explorer imports and pins ships the rest: @ensdomains/ensjs/src/utils/v2/roles/resolverResource.ts:15,28,40 (computeResolverResource/textPart/addrPart, each "Mirrors PermissionedResolverLib"), whose :12 documents the part word 0x00…00 as "any record type"; and the writer's docstring (@ensdomains/ensjs/src/actions/wallet/v2/grantResolverRoles.ts:176) defines the scope the Explorer emits: "'root': Grant roles globally (any name, any record type)." When a row is narrower than a whole name, the flow does not fall back to the whole name — it falls forward to every name.
Why root reaches every name, from the contract not the fork: EnhancedAccessControl ORs an account's ROOT roles into every check — _effectiveRoles = _getRoles(ROOT_RESOURCE, account) | _getRoles(resource, account) (:452-455; header at :19-21: "roles granted in ROOT_RESOURCE (0x0) automatically apply to all resources"). So grantRootRoles(role, account) confers that role on every resource the resolver will ever check.
The Explorer expresses exactly one scope, and says so — resolverRoles.ts:134-141, computeNameResource, with JSDoc "Compute the EAC resource ID for a name (with part = 0)":
export const computeNameResource = (name) => // :138
keccak256(encodePacked(['bytes32','bytes32'], [namehash(name), ZERO_BYTES32])) // :140
The second word is a constant, so every text-scoped and every addr-scoped role is unresolvable by construction — two of the four scopes, always. (There is even a fifth shape the app cannot compute, resource(0, part) — one record key across any name — which onlyPartRoles also honours, PermissionedResolver.sol:178-187; the report's claims rest on the two measured on the fork.) These .sol line numbers are the Etherscan-verified deployed source — the audited repo ships no .sol, and nothing above rests on them: the model is measured on the fork and confirmed by the contract's own revert, whose first word on a denied setAddr equals keccak256(namehash(name) ‖ bytes32(0)) recomputed locally (poc/E8-15_fork_consequence.log).
From an unresolvable resource to a root-scoped transaction, hop by hop
buildResourceToNameMap(:147-160) seedsROOT → '(root)'and then, for each node, the part-0 resource only. A text-scoped resource is not in the map.groupRolesByAccount(:179-221) looks each role's on-chainresourceup in that map and adds nothing toresolvedNameson a miss.ResolverRolesSidebar.tsx:169—const roleName = resolvedNames.find((n) => n !== '(root)') ?? ''.- That string is carried, unchanged, straight to the builder — every hop inside the declared asset:
ResolverRolesSidebar.tsx:299puts it on the pending action (name: roleName, and:318for the remove path);:490and:497passpendingAction.nameinto the mutations;:197,215and:253,268hand it tograntResolverRoles/revokeResolverRoles;grantResolverRoles.ts:100-102passes it toprepareGrantResolverRolesTransaction. No hop inspects it, defaults it, or validates it. grantResolverRoles.ts:47-60andrevokeResolverRoles.ts:47-60, identically, read that empty string asscope: 'root'.
An empty display string is read as a scope. Nothing between step 1 and step 5 carries the role's actual resource, which was in hand the whole time.
And the empty string is not an accident the helper might have rejected — it is documented input meaning "every name", in the audited file itself. grantResolverRoles.ts:20, the JSDoc on the very parameter the sidebar fills:
/** Dotted name (e.g. "myname.eth") or empty string for ROOT_RESOURCE (all names). */
readonly name: string
The dependency says the same on its own side (@ensdomains/ensjs/src/actions/wallet/v2/grantResolverRoles.ts:179-180: "Use name: \"\" for any name (equivalent to root scope)"). So both ends of the interface treat '' as a valid value denoting the widest scope. ResolverRolesSidebar.tsx:169 produces that value by ?? '' — a display fallback for "we could not resolve a name" — and hands it to a parameter whose contract is "empty means every name". The sink is not at fault: grantResolverRolesWriteParameters does exactly what its documented contract says. The defect is in the caller — apps/portal supplies the sentinel meaning every name as its fallback for we could not resolve a name.
Note step 3 skips '(root)' explicitly, so a ROOT row does not rescue a group either: the group on 0xeb22a41c… held by 0xf6a97d82… carries a ROOT row plus four text-scoped rows, resolvedNames is ['(root)'], and roleName is still ''.
The root cause is not confined to the Roles page. computeNameResource has exactly two callers in the repository (git grep computeNameResource -- apps packages), and the second is not administrative: features/records/hooks/useCanEditRecords.ts:68-71 computes the part-0 resource of a name and asks the resolver hasRoles(resource, ROLE_SET_ADDR | ROLE_SET_TEXT | …) for the connected account (:75-88), then gates record editing on the answer (:108-117). An account delegated at text-key scope — genuinely authorised on chain to write that one record — is checked against the wrong resource and comes back false, so the Explorer withholds the editor from a delegate the contract permits. It is the same hardcoded part, failing in the opposite direction, on an ordinary user-facing screen.
That second consumer is named for completeness and is not claimed as a finding: it under-permits rather than over-permits, so nobody gains authority from it. It is set out because it establishes what the root cause is — a single expression that cannot represent two of the protocol's four scopes — rather than a quirk of one administrative screen, and because the one-line fix closes both.
Executed, through the application's own code
poc/E8-15_app_pipeline.ts imports the app's buildResourceToNameMap, groupRolesByAccount, roleToPermissions, computeRoleChanges and prepareGrantResolverRolesTransaction unmodified, runs them over live indexer data, and evaluates ResolverRolesSidebar.tsx:169 inline. It writes no scope anywhere — the only value it supplies for name is that expression's output. Result (poc/E8-15_app_pipeline.log):
account=0x49d037a6… resolvedNames=[] decodedRoles=["ROLE_SET_TEXT"] roleName=""
-> function grantRootRoles
args ["1","0x49D037a6…"] <- ROLE_SET_ADDR, EVERY name
selector 0x072d5d77 68 bytes
CONTROL, same functions, resource map corrected:
roleName="acmestudio.sideloadtest26.eth"
-> function authorizeNameRoles
args ["0x0a61636d6573747564696f…","1","0x49D037a6…",true]
What the correct call would be, stated precisely
The row's real scope is one text key, and the app's most precise reachable call, authorizeNameRoles, is already wider than that — a whole name instead of one record. The call emitted is wider again: every name on the resolver. So the widening is two steps, not one.
It does not follow that authorizeTextRoles is the right call for this edit. The demonstrated edit ticks ROLE_SET_ADDR, and ensjs's text arm cannot express it — its parameter type (grantResolverRoles.ts:64-71 in the dependency) carries {scope:'text', name, key} and no roles field, so that arm always grants ROLE_SET_TEXT for the named key. The honest statement is that the Explorer's per-account row model makes this edit inexpressible at the row's real scope, and the correct behaviour is therefore to refuse it or to scope it to the resource — not to widen it to root. The dependency ships the helper the app would need to do that and the app does not import it: @ensdomains/ensjs/src/utils/v2/roles/resolverResource.ts exports computeResolverResource(node, part), textPart and addrPart.
Two of the four scopes are not merely unresolved but unreachable: git grep -E 'authorizeTextRoles|authorizeAddrRoles' -- apps packages returns 0 hits at the pin. (git grep rather than grep, so the count is over the repository's own tracked sources and cannot be moved by a PoC file dropped into the tree.)
Nothing on screen says so — rendered, not read
The three suppressions below are observed in a rendered screen: in the repository's own test runner (poc/E8-15_render_screen.log, in the secret gist) and again in a real browser (the four PNGs are in this report's Attachments field, since a gist holds text only; their sha256 sums and a description of each are in poc/E8-15_screen_shots.log, in the gist). Every claim below is asserted as text in the first of those, so none of it rests on the images. Each is paired with the control: the same components, the same account, the same role, the same two names, with only the role row's resource changed to the part-0 value the app can compute.
| where | text-key-scoped row (the defect) | part-0 row (control) |
|---|---|---|
| Name cell | innerHTML is "" |
acmestudio.sideloadtest26.eth |
| sidebar scope sentence | the <p> is not in the tree |
"Roles scoped to acmestudio.sideloadtest26.eth" |
| confirmation screen | "Save resolver role changes / Update roles for 0x49d037a6…" | the identical string |
| calldata handed to the wallet | 0x072d5d77 grantRootRoles, 68 bytes |
0xbbd9abb5 authorizeNameRoles, 196 bytes |
The lines responsible:
ResolverRolesTable.tsx:68-70—if (names.length === 0) return null. The Name cell is empty, not "unknown", not "(root)". (poc/screens/1-roles-table-name-column.png.)ResolverRolesSidebar.tsx:391— the line that would read "Global roles (all names)" or "Roles scoped to …" is gated onresolvedNames.length > 0. On a group whose every resource is fine-grained that array is empty, so the sentence is suppressed on exactly the rows where the scope is about to change. (poc/screens/2-sidebar-no-scope-line.pngagainst3-sidebar-control-scope-line.png. A group that also holds a ROOT row has['(root)'], passes the gate, and does print "Global roles (all names)" — 2 of the 16, and the 2 where nothing new is conferred.)ResolverRolesSidebar.tsx:339-349— the transaction the modal is given carriestitle: 'Save resolver role changes'andtransactionName: 'Update roles for <account>'. Neither mentions a scope, and neither changes between the two branches: the last screen before the wallet prompt is byte-for-byte the same whether the grant reaches one name or every name on the resolver (poc/screens/4-confirmation-before-signing.png).grantResolverRoles.ts:111— on such a row the only string the flow produces containing(root)is the transaction description (Grant resolver roles for ${name || '(root)'}), and it is built after the user has confirmed. It is never rendered anywhere in the application, not merely absent from the sidebar:descriptionis a stored field on the transaction record (packages/transaction-manager/src/types/transaction.types.ts:199,244) andgit grep description -- apps/portal/src/features/transaction-managerreturns no line at all — no component in the modal, the overview, the info screen or the state screen reads it. The sidebar's own(root)strings (:393,395) sit inside theresolvedNames.length > 0block above and are therefore suppressed on exactly these rows.
An operator ticking one box on a row that says nothing about its scope has no way to learn, before signing, that the grant is about to become resolver-wide.
The revoke direction fails the other way
"Remove user from all roles" on the same row takes the identical ternary and emits revokeRootRoles (selector 0xce156e82), which clears the ROOT resource. The grant being displayed sits on a text-scoped resource, so it is not cleared: the interface reports the removal and the role remains. Built through the app's own prepareRevokeResolverRolesTransaction (poc/E8-15_app_pipeline.log §H) and measured on the fork (poc/E8-15_fork_consequence.log §4):
BEFORE grantee setText(acmestudio…, 'agent_session') : ALLOWED
sent revokeRootRoles(16, grantee) status 0x1
AFTER grantee setText(acmestudio…, 'agent_session') : ALLOWED
All 16 affected groups decode to at least one role, so ResolverRolesSidebar.tsx:307-312 — which returns early only on decodedRoles.length === 0 — lets the remove path proceed on every one of them (poc/E8-15_roleconn_sweep.log prints PROCEEDS 16 times, RETURNS EARLY 0 times). On two of the sixteen the remove path then throws instead, by the mechanism described in the sibling-defect table below; the revoke claim therefore holds over 14 of 16, and those 14 are the impact-bearing ones.
The fix is one query field the application already has
And the mapping is not the indexer's invention — the resolver emits it. When a fine-grained role is first granted, PermissionedResolver itself publishes the resource→name→key association: authorizeNameRoles emits NamedResource(resource, toName) (PermissionedResolver.sol:287) and authorizeTextRoles emits NamedTextResource(partResource, toName, keccak256(bytes(key)), key) (:320). The indexer's namedResources field is the projection of those events. So what the application needs in order to name a fine-grained resource is data the protocol emits at the moment the role is created, already indexed, already typed in the app's generated schema — and never asked for.
ResolverDetail.namedResources returns {resource, name, recordKind, recordKey, coinType} — the indexer's own resource→name oracle for the fine-grained scopes. Measured rather than assumed: across the affected population it returned an entry for 33 of the 33 flagged non-root role rows, each labelled text or addr with its record key or coin type, and 0 lacked one. It carries no entry for a ROOT-scoped row, and none is needed there: buildResourceToNameMap already seeds ROOT_RESOURCE → '(root)' and already computes the part-0 resource of every node it is handed. The two scopes the map gets right are exactly the two namedResources does not have to supply, and the two it gets wrong are exactly the two it was observed to cover.
git grep namedResources over the whole repository at the pin returns exactly one line: packages/indexer/graphql.gen.ts:927, a generated type. (Again git grep, so the count is over tracked sources only.) The field is never selected, never read, never used; the app's own resolver query (useResolverOverview.ts:66-108) does not ask for it.
Two changes, and the second is the one that matters. They are stated so the shape of the fix is not in dispute, not to prescribe an implementation:
- Resolve the name. Add
namedResources { resource name recordKind recordKey coinType }to the query atuseResolverOverview.ts:66-108and seedbuildResourceToNameMapfrom it as well as fromcomputeNameResource. The Name cell and the scope sentence then fill in. - Stop reading a display string as a scope.
grantResolverRoles.ts:47-60andrevokeResolverRoles.ts:47-60must not treatname === ''asscope: 'root'. Even with (1) shipped this is required, because a resource the map still cannot name would fall back to root again. The safe default is to refuse — the row's real scope is aresource, and the app should carry it rather than reconstruct it from a label.@ensdomains/ensjsalready exports what a resource-scoped path needs:computeResolverResource(node, part),textPart(key)andaddrPart(coinType)inutils/v2/roles/resolverResource, none of which the app imports.
(2) alone closes this report. (1) alone does not: it narrows the population without removing the fallback.
And (1) is genuinely not sufficient, for a reason worth measuring rather than asserting. groupRolesByAccount (:179-221) keys on the account and unions every resource that account holds on the resolver into one row; the sidebar then emits one call built from one roleName. Counting distinct non-ROOT resources per affected group in poc/E8-15_roleconn_sweep.log:
groups holding 1 non-ROOT resource 7
2 3
3 4
4 2
--
affected groups 16 -> 9 of the 16 span two to four resources
For those nine there is no single call that expresses the row's authority at its real scope, because the row is not at one scope. So the honest statement of the remedy is in two parts, and this report claims only the second:
- The consent half is one query field.
namedResourcesnamed the scope for 33 of the 33 measured rows, so the Name cell and the sidebar's scope sentence can be correct today. - The write half needs a per-resource editor, using the writers
@ensdomains/ensjsalready ships (authorizeTextRoles,authorizeAddrRoles), because one row can carry several resources.
Neither is done today — and until one of them is, the flow does not refuse, it defaults to root. That default is the defect. A reader who concludes "fine-grained scopes are simply not implemented yet" has described the cause correctly and stopped one step short of the consequence: an unimplemented scope here does not disable the button, it widens the grant, and it does so without saying anything on screen.
The nearer-looking shortcut does not work, and is dealt with here rather than left to be raised. That same query already selects a name field on each role row (useResolverOverview.ts:97). On 0x34b1699b… that field is null on all four rows — reproduced live in poc/E8-15_app_pipeline.log §A, which prints name=null 4 of 4. namedResources is the field that carries the answer.
One file, three defects — why these are separate reports
apps/portal/src/lib/roles/resolverRoles.ts is 221 lines and three findings in this engagement touch it. A triager who sees one file may reasonably ask whether they are one report. They are not, and the test is not the file — it is whether one change closes them.
| the defect | the line that is wrong | the fix | the direction of harm | |
|---|---|---|---|---|
| This report | a role group that resolves to no name is edited at ROOT scope | ResolverRolesSidebar.tsx:169 + the name === '' ternary in grant/revokeResolverRoles.ts:47-60 |
derive the scope from the role's resource, not from a display string | over-grants — authority is widened |
| A second defect, same file | "Remove user from all roles" throws before it builds a transaction whenever the row's bitmap decodes an _ADMIN name — the encoder it feeds is ensjs's, not the app's, and its ResolverRole union has no _ADMIN member. That is 2 of the 16 measured groups; on the other 14 the button builds revokeRootRoles and under-revokes instead (see *The revoke direction fails |
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 Explorer hardcodes the second word of the resource hash to zero, so it cannot represent text-key or coin-type scoped roles, and its display fallback of an empty string is then interpreted by the transaction builder as root scope.
Impact
A grantee could gain address-record write access on names owned by other people, and the same flow could replace the resolver's code so every name it serves resolves to an attacker-controlled address; the report notes the revoke path also fails to clear the real grant in 14 of 16 affected groups.
What the attacker needed
Operator access to the Roles page; a role scoped to one text key or coin type; victim signs the built transaction
The fix
The query should request the indexer's namedResources field to name fine-grained resources, and the grant and revoke builders should stop treating an empty name as root scope, refusing or carrying the actual resource instead.
How it was found
- Open the Roles page for a resolver where an account holds a role scoped to one text key.
- Observe the Name cell is empty and no scope sentence is shown.
- Tick one permission on that row and confirm the change.
- The confirmation screen shows only a generic title with no scope.
- Sign the transaction, which is grantRootRoles rather than a name-scoped grant.
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 the contract that decides which records a name has. Permissions on it can be limited to one name, or even to one single record, but the Explorer only knew how to work out the whole-name kind. When it met a narrower permission it showed a blank name, and the code that builds the transaction reads a blank name as 'every name'. So a small permission edit silently became a permission over everything.
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.