Skip to content
Access control Audit finding Intermediate

Explorer “Remove user from all roles” revokes one name resource and leaves root address authority live

The ENS Explorer's 'Remove user from all roles' action only revokes the delegate's roles on a single name resource, leaving any root-level roles intact. An attacker with a surviving root role can change the name's address record and redirect payments.

go4ko Follow

Originally disclosed on Immunefi

Critical View original
  • Disclosed after under an hour

91566 w a critical explorer remove user from all roles revokes one name resource and leaves root address authority live

Submitted on Sep 2nd 2026 at 17:01:06 UTC by @go4ko for Audit Competition | ENS

  • Report ID: #91566
  • 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

Impact summary and selected category

Selected in-scope impact — Critical:

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.

Explorer asks the connected owner to approve a name-scoped revocation while explicitly representing the action as removing the delegate “from all roles.” The successful application-generated transaction therefore contains the wrong authorization resource: it clears the selected name resource but leaves the delegate's root ROLE_SET_ADDR authority live.

The E2E demonstrates the security consequence rather than treating incomplete removal as a display-only defect. After the successful removal and a fresh Explorer reload, the former delegate uses the surviving root role to change the name's canonical ETH address from the owner to an attacker address. A distinct payer resolves the same name and transfers exactly 0.01 ETH to the attacker. That amount is a safe local-fork proof value, not a protocol-defined amount or loss ceiling; in practice, the redirected loss equals whatever value a payer sends through the compromised ENS resolution before the owner repairs the record.

The qualifying connected-wallet impact occurs at the owner's revocation transaction: Explorer asks the wallet to approve one name-scoped resource while representing the action as complete removal across the aggregate root-plus-name role set. The later resolver lookup and payment are downstream proof that the retained authority is security-relevant; this report does not allege that Universal Resolver returned a noncanonical record or treat ordinary resolution by itself as the vulnerability.

The authority is recoverable: after refresh, a vigilant owner can see the remaining (root) / Set Address row and submit a second, root-scoped revocation. This report therefore does not claim permanent name takeover, invisible authority after refresh, or compromise of the owner's wallet. Recovery stops future misuse but cannot reverse a payment already diverted during the failed-revocation window.

Brief/Intro

ENS Explorer represents Permissioned Resolver roles as independent root and name resources in its indexer response, but groupRolesByAccount collapses every resource held by the same account into one table row. The resulting row contains a union of names and decoded permissions.

The edit sidebar then destroys the resource distinction in two ways:

  1. It flattens every decoded permission into one list.
  2. It selects the first non-root name as the single transaction scope whenever the aggregate contains both (root) and any name.

When the owner clicks Remove user, Explorer passes that one name together with the union of roles to revokeResolverRoles. A nonempty name selects ENSJS's name-scoped revocation path. Consequently, a row containing root ROLE_SET_ADDR and name ROLE_SET_TEXT produces:

authorizeNameRoles(name, ROLE_SET_ADDR | ROLE_SET_TEXT, delegate, false)

instead of a root revocation plus a name revocation. The name bitmap becomes zero, but the root bitmap is untouched. Because root roles apply across the resolver, effective ROLE_SET_ADDR for the name remains true.

The application confirmation is unambiguous: “remove this user from all roles.” The owner follows that workflow correctly, approves one application-generated transaction, and receives a successful transaction result. The defect is not a user choosing the wrong control or the resolver contract failing to execute valid calldata. Explorer constructs incomplete calldata for the action it promised.

Security invariant and actors

  • O — legitimate ENS name/resolver owner and connected-wallet signer.
  • D — legitimate delegate before removal, but former, compromised, or adversarial delegate afterward.
  • R — attacker-controlled recipient address selected by D.
  • P — independent payer who resolves the ENS name after the failed revocation.

The required revocation invariant is:

If Explorer presents an aggregate account row covering resources S and confirms
“remove this user from all roles,” success must remove every displayed role from
every represented resource in S.

After success, no displayed address-setting role may remain effective for D.

For the proven root-plus-name case:

before:
  roles(ROOT_RESOURCE, D) = ROLE_SET_ADDR = 1
  roles(nameResource, D)  = ROLE_SET_TEXT = 16
  hasRoles(nameResource, ROLE_SET_ADDR, D) = true

promised action:
  remove D from all roles

required after-state:
  roles(ROOT_RESOURCE, D) = 0
  roles(nameResource, D)  = 0
  hasRoles(nameResource, ROLE_SET_ADDR, D) = false

actual after-state:
  roles(ROOT_RESOURCE, D) = 1
  roles(nameResource, D)  = 0
  hasRoles(nameResource, ROLE_SET_ADDR, D) = true

Vulnerability Details

1. The resolver overview preserves separate role resources

The in-scope getResolverOverview query asks the indexer for each role's account, resource, and roleBitmap:

GraphQL
roles {
  account
  resource
  roleBitmap
  blockNumber
  transactionHash
  timestamp
  name
}

At this boundary, the root and name roles are still independent entries. The E2E's controlled local-fork response supplies one root entry with bitmap 1 and one name-resource entry with bitmap 16. Every supplied bitmap is regenerated from a live on-chain roles(resource, account) read; the test does not invent authorization state.

2. groupRolesByAccount collapses independent resources

buildResourceToNameMap maps the zero resource to (root) and name resources to human-readable names. However, groupRolesByAccount keys the group only by lowercase account:

TS
const account = role.account.toLowerCase()
const existing = grouped.get(account)

if (existing) {
  existing.roles.push(role)
  existing.decodedRoles.push(...decoded)
  if (resolvedName) existing.resolvedNames.add(resolvedName)
}

The resource is read and resolved for display but is not part of the grouping key. The group therefore contains multiple raw role objects but only one flattened decodedRoles array and one resolvedNames set.

The role values used in the E2E are deliberately nonredundant. resolverRoles defines:

ROLE_SET_ADDR = 1 << 0 = 1
ROLE_SET_TEXT = 1 << 4 = 16

Thus the aggregate union 17 cannot be mistaken for the same permission duplicated across two resources.

3. The table exposes one editor for the aggregate

ResolverRolesTable renders all resolvedNames and permissions from decodedRoles. At lines 102-116, it feeds the grouped result directly into the table and opens one sidebar for that row:

TS
const data = useMemo(
  () => groupRolesByAccount(roles, buildResourceToNameMap(nodes)),
  [roles, nodes],
)

buildEditActionColumn<AccountRoleGroup>((row) => {
  setEditingRow(row)
  setOpen(true)
})

The preserved browser run requires exactly one delegate row containing (root), the test name, Set Address, and Set Text.

4. The sidebar combines the permissions but chooses one non-root scope

ResolverRolesSidebar reads the aggregate values, then selects the first non-root name:

TS
const decodedRoles = (row?.original.decodedRoles ?? []) as ResolverRoleKey[]
const resolvedNames = row?.original.resolvedNames ?? []

const roleName = resolvedNames.find((n) => n !== '(root)') ?? ''

If the row contains root plus any named resource, roleName cannot represent root. The root resource is discarded even though its permission remains in decodedRoles.

The presentation strengthens the owner's reasonable interpretation. When any root entry is present, the sidebar says Global roles (all names).

5. “Remove user” binds aggregate roles to that one name

handleRemoveUser constructs one pending action:

TS
setPendingAction({
  type: 'remove',
  name: roleName,
  account: selectedAccount,
  roles: decodedRoles,
})

prepareResolverRolesIntent forwards the same single name and union of roles to transaction preparation. The execution mutation does the same at ResolverRolesSidebar.tsx lines 251-276.

There is no loop over row.original.roles, no root-specific action, and no postcondition requiring every represented resource to be cleared.

6. A nonempty name deterministically produces the wrong on-chain function

prepareRevokeResolverRolesTransaction selects scope solely from whether the chosen string is empty:

TS
const writeParams = revokeResolverRolesWriteParameters(
  walletClient,
  name === ''
    ? {
        resolverAddress,
        targetAccount: account,
        scope: 'root',
        roles,
      }
    : {
        resolverAddress,
        targetAccount: account,
        scope: 'name',
        name,
        roles,
      },
)

Because roleName is the first non-root name, the root branch is unreachable for the mixed row. The preserved mined transaction decodes exactly as:

function: authorizeNameRoles
name:     DNS-encoded test name
bitmap:   17 (ROLE_SET_ADDR | ROLE_SET_TEXT)
account:  D
grant:    false

No revokeRootRoles call is submitted.

7. The confirmation and transaction metadata do not disclose partial scope

The confirmation at ResolverRolesSidebar.tsx lines 441-448 states:

Are you sure you want to remove this user from all roles?
This action cannot be undone.

The transaction metadata at lines 339-349 says only Remove resolver user / Remove user {account}. It does not identify the selected name resource or warn that root authority will remain.

The owner's wallet signature is genuine, but it authorizes calldata that is inconsistent with the security operation Explorer described.

8. Transaction success is not revocation success

The removal mutation's success handler merely invokes pollForIndexerSync. That helper waits and invalidates the query a fixed number of times; it does not check that every role represented by the removed row is absent.

Accordingly, the valid name-scoped transaction is mined successfully and the flow completes even though the security postcondition is false. The E2E performs a full page reload, requires a second live role-data request, and observes D still present with (root) and Set Address. The removed name and Set Text are absent, proving that the application performed a partial revoke rather than showing wholly stale data. No message warns that removal was partial.

9. The contract correctly enforces the authority Explorer failed to revoke

After the application-generated transaction:

raw root bitmap = 1
raw name bitmap = 0
effective ROLE_SET_ADDR for D on the name = true

D then submits a real setAddr transaction to the Permissioned Resolver. It succeeds, and the Universal Resolver returns R instead of O. This is expected contract behavior: the root role remains valid. The application defect is choosing the wrong revocation scope, not a broken contract access check.

The negative control submits the correct root revocation. The root bitmap becomes zero, effective authority becomes false, and D's next setAddr attempt reverts. This proves that a valid recovery exists and isolates the failure to Explorer's transaction construction.

State transition demonstrated by the E2E

Stage Root bitmap for D Name bitmap for D Effective Set Address Canonical recipient Security result
Legitimate baseline 0 0 No O The name resolves to its intended owner.
Independent grants 1 (Set Address) 16 (Set Text) Yes O D is an authorized delegate.
Explorer aggregate 1 16 Yes O One row shows (root), name, Set Address, and Set Text.
Owner confirms removal from all roles 1 16 Yes O Explorer prepares one name-scoped revoke with union bitmap 17.
Application transaction succeeds 1 0 Yes O Name scope clears; dangerous root authority survives.
Fresh Explorer reload 1 0 Yes O D reappears as (root) / Set Address; no partial-removal warning.
Former delegate acts 1 0 Yes R D changes the canonical ETH address to the attacker.
Independent payer resolves and pays 1 0 Yes R P transfers 0.01 ETH; R gains exactly 0.01 ETH.
Correct root revoke and restore 0 0 No O D's next address write reverts; future resolution is safe.

Attack sequence

{% stepper %} {% step %}

Establish the legitimate owner and recipient

O owns a name using a Permissioned Resolver and initially sets the name's ETH address to O.

Canonical Universal Resolver output equals O, establishing the legitimate payment recipient before any delegate grants. {% endstep %}

{% step %}

Grant independent root and name roles

O legitimately grants D root ROLE_SET_ADDR, allowing D to manage address records across the resolver.

O separately grants D name-scoped ROLE_SET_TEXT for the tested name. {% endstep %}

{% step %}

Open the Explorer role-management flow

At a later time, D is no longer trusted, or D's key is suspected to be compromised.

O opens the production Explorer resolver roles page while connected with the authorized owner wallet.

Explorer groups D's two independent resource entries into one row showing (root), the name, Set Address, and Set Text.

The sidebar labels the aggregate Global roles (all names). {% endstep %}

{% step %}

Remove the user through Explorer

O clicks Remove user; the confirmation promises to remove D “from all roles.”

O confirms and approves exactly one application-generated resolver transaction.

Explorer submits authorizeNameRoles(name, 17, D, false). The receipt succeeds, but no root revoke occurs. {% endstep %}

{% step %}

Observe the surviving root authority

The name bitmap becomes zero while the root bitmap remains 1; effective ROLE_SET_ADDR for the name remains true.

A fresh page reload and second role-data request show D still holding (root) / Set Address, without a partial-removal warning. {% endstep %}

{% step %}

Redirect resolution and divert a payment

Before O notices and completes a second root-scoped removal, D calls setAddr and changes the ETH address from O to R.

Universal Resolver returns R for the same name.

Independent payer P resolves the name and transfers 0.01 ETH to R; R's balance increases by exactly that amount. {% endstep %}

{% step %}

Recover with correct root revocation

O can recover by submitting the correct root revocation and restoring the legitimate record.

After the correct revocation, D's next setAddr attempt reverts. {% endstep %} {% endstepper %}

Preconditions and practical likelihood

Required state

  1. The same delegate holds at least one root role and at least one role on a named resource of the Permissioned Resolver.
  2. The root role that survives has a security consequence; the proven case uses ROLE_SET_ADDR.
  3. The resolver owner uses Explorer's aggregate Remove user action after the delegate should no longer be trusted.

This mixed-resource state is legitimate and supported by the underlying permission model. The PoC uses different roles at each scope to prove that the resources are independently meaningful, not duplicate indexer rows.

Exploitation window

The retained root role persists until it is separately revoked; it does not expire when the first removal reports success. Exploitation nevertheless depends on D acting before O notices the refreshed root-only row and submits a correct second revocation. Financial loss further depends on a payer resolving and paying the name while the malicious address is active.

No race is required against the first removal transaction: the PoC waits for the successful receipt and refreshes Explorer before D acts. A vigilant owner can recover, so likelihood and duration are lower than a hidden or permanent authorization. However, successful recovery only prevents future misuse; it cannot reverse a transfer already sent to R.

D does not need to observe Explorer, detect the inconsistent row, or front-run the first removal. The exploitable interval begins when Explorer's name-scoped revocation is mined and ends only when O notices the surviving root role and a separate root-scoped revocation is mined. D can discover that authority remains through public on-chain events or state, periodic role checks, or simply by continuing to use the permission. Private submission of O's first transaction does not close the path because its resulting role state is public after inclusion. The PoC intentionally makes the surviving role visible through a full refresh before D acts, then proves D can still change the record during that interval.

Without the defect, the advertised complete removal would revoke every displayed root and name resource when the first workflow finishes, leaving D unable to write afterward. With the defect, that first successful workflow leaves the root role active until O discovers the incomplete revocation and mines a separate corrective transaction.

Trust model

D is legitimately authorized before the removal. This is not treated as a vulnerability. The security boundary is the later owner-authorized revocation: after O uses the product's explicit all-role removal control, D should no longer retain the displayed root authority.

The attack model is a former delegate, an offboarded service, or a compromised delegate key. Revocation controls exist precisely for the point at which a previously trusted credential must stop being trusted. No ENS administrator, protocol operator, resolver owner other than O, wallet provider, or indexer operator must behave maliciously.

Why existing controls do not stop the issue

Existing control What it establishes Why it is insufficient
Separate indexed role entries Root and name state can be represented accurately Explorer collapses them by account before constructing the action.
Aggregate row displays both scopes The owner can see (root) and the name before removal One editor cannot preserve which permission belongs to which resource.
Global roles (all names) label Root authority is acknowledged in the sidebar roleName still selects the first non-root name for the transaction.
“Remove from all roles” confirmation O explicitly authorizes complete removal The pending action contains only one resource and aggregate roles.
Wallet approval O authorizes the application-generated calldata Metadata does not disclose the name-only scope or retained root role.
Successful receipt The name-scoped revoke executed correctly Receipt success says nothing about root state or the promised aggregate postcondition.
Indexer polling Explorer requests updated role data It never asserts that all resources represented by the removed row are empty.
Refreshed root-only row A vigilant owner can discover the incomplete removal Discovery requires attention and another transaction; authority remains usable in the meantime.
Correct contract root revoke Recovery is technically possible Explorer did not submit that call during the promised all-role action.

Why this is not user error

O selects the only row representing D, clicks the explicit Remove user control, confirms removal “from all roles,” approves the application transaction, and receives a successful result. O does not select an incorrect name, manually edit calldata, ignore a failed receipt, or ask Explorer to retain root permissions.

The row's continued presence after refresh makes recovery possible, but it does not retroactively make the first transaction correct. A security-sensitive removal function must either perform its advertised complete operation, accurately disclose that it is removing only one resource, or fail and require explicit resource-by-resource decisions.

Known-issue distinction

This finding was not matched to the root cause of any disclosed competition issue reviewed for this report:

Disclosed or related issue Distinction
QA-01 — some transfer role combinations or names with subnames later break profile/primary-name operations QA-01 concerns post-transfer functional failures. ENS-005 performs no ownership transfer and demonstrates a newly unintended authority consequence from Explorer's removal transaction. The competition disclosure expressly leaves a demonstrated unintended-authority consequence open as a possible new finding.
ensdomains/contracts-v2 issue #418 — delegated roles survive ERC-1155 ownership transfer Issue #418 is a contract lifecycle issue: pre-existing roles survive a V2 ownership transfer. ENS-005 performs no transfer. The resolver can revoke correctly; Explorer chooses a name revoke while promising aggregate removal, leaving root state untouched.
WEB-1305 — transferring V2 name roles to a V1 name remains pending WEB-1305 concerns an unsupported transfer stuck in pending UI. ENS-005 concerns successful mined calldata with the wrong resource and usable post-success authority.
R2-06 — smart-account session revocation clears browser storage while a time-boxed on-chain co-owner persists R2-06 concerns the disclosed session-key/co-owner design and its stated seven-day authority bound. ENS-005 does not use sessions, browser-stored keys, or smart-account co-owners; it sends a resolver-role revocation with the wrong root/name resource despite promising complete removal.

The Permissioned Resolver behaves according to the remaining root role. The in-scope Explorer application is responsible for collapsing scopes and submitting incomplete revocation calldata.

Impact Details

The exact Critical impact selected for this submission is:

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.

The demonstrated mapping is exact:

  • O uses Explorer's connected-wallet role-management flow.
  • The UI represents the action as complete removal across all displayed roles.
  • Explorer substitutes a single name resource for the aggregate root-plus-name set.
  • O approves one successful authorizeNameRoles(name, 17, D, false) transaction.
  • A correct complete removal required root revocation as well.
  • The wrong resource leaves effective address-setting authority true.
  • D uses that authority to redirect canonical resolution from O to R.
  • Distinct payer P sends 0.01 ETH to R, which gains exactly 0.01 ETH.

The classification follows the contest's enumerated connected-wallet wrong-parameter impact. Recoverability reduces practical persistence and likelihood but does not change what the vulnerable transaction does. There is no claim that the name NFT or owner wallet is take

The original report as published on Immunefi, by go4ko. 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 Explorer groups roles from different resources (root and name) into one row but then selects only the first non-root name as the revocation scope, so root roles are never revoked.

Impact

A former delegate with a surviving root role could change the name's address record and redirect payments until the owner notices and performs a separate root revocation.

What the attacker needed

Delegate holds both root and name roles; owner uses Explorer's remove action; attacker acts before root role revoked

The fix

The Explorer should revoke roles per resource, submitting separate root and name revocations, or ensure the revocation covers all resources represented in the aggregated row.

How it was found

  1. Owner grants delegate root ROLE_SET_ADDR and name-scoped ROLE_SET_TEXT.
  2. Owner opens Explorer resolver roles page; delegate's roles are grouped into one row showing (root) and the name.
  3. Owner clicks 'Remove user' and confirms; Explorer submits a name-scoped revocation with combined roles.
  4. Transaction succeeds but root role remains; after reload, delegate still has (root) Set Address.
  5. Delegate calls setAddr to change the name's ETH address to an attacker address.
  6. A payer resolves the name and sends funds to the attacker address.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you remove someone's permissions in an app, you expect all their access to be gone. Here, the app only removed some permissions (those tied to one name) but left a more powerful permission (one that applies to all names) still active. The attacker could then change where the name points, so payments went to them instead of the real owner.

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.

More by go4ko

View all

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

Broken access control

The lesson behind this report.

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.