Improper resolver role grouping causes incomplete revocation and attacker controlled ens resolution
The ENS Portal grouped resolver-role assignments for one account into a single row even when they belonged to different resources, and its removal action revoked only the first non-root name. A delegate whose surviving assignment included the address-setting role could then change the unaffected name's ETH address to one they controlled.
- Disclosed after under an hour
93080 w a critical improper resolver role grouping causes incomplete revocation and attacker controlled ens resolution
#93080 [W&A-Critical] Improper resolver-role grouping causes incomplete revocation and attacker-controlled ENS resolution
Submitted on Sep 14th 2026 at 07:26:16 UTC by @zealynx for Audit Competition | ENS
- Report ID: #93080
- Report Type: Websites & Apps
- Report severity: Critical
- Target: https://github.com/immunefi-team/audit-comp-ens/tree/audit-comp-ready/apps/portal
- Impacts:
- Causing the application to display or pre-fill an incorrect address, name, or transaction detail, so that a user sends funds or submits a transaction to an unintended recipient, such as: - resolving or rendering an ENS name to an attacker-controlled address - showing the wrong recipient or amount on a transaction the user then approves
Description
Brief/Intro
The ENS Portal groups all resolver-role assignments for one account into a single actionable row even when they belong to different Enhanced Access Control (EAC) resources. When the resolver owner selects Remove user, Portal submits one revocation against only the first non-root name while presenting the action as removal from all roles. Assignments on every unselected resource remain effective, so a malicious or compromised delegate whose surviving assignment includes ROLE_SET_ADDR can change the unaffected name's ETH address to an attacker-controlled address after the removal transaction succeeds.
Vulnerability Details
The resolver overview query retains each assignment's account, resource, and roleBitmap. However, groupRolesByAccount keys its map only by the lower-cased account:
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)
Assignments from root and different names are appended to the same group, and their decoded role names are combined. ResolverRolesTable renders that account group as one row with one set of actions.
ResolverRolesSidebar then reduces the group's resources to one write target:
const roleName = resolvedNames.find((n) => n !== '(root)') ?? ''
The remove handler passes this one roleName together with the group's combined decodedRoles. revokeResolverRoles encodes exactly one call: revokeRootRoles(bitmap, account) when the name is empty, or authorizeNameRoles(name, bitmap, account, false) otherwise. Input ordering determines which non-root resource is selected; no call is prepared for the other resources.
The table lists the row's known scopes, but a root-containing row is summarized in the sidebar as Global roles (all names). The confirmation asks Alice whether she wants to “remove this user from all roles,” without explaining that the encoded transaction covers only one resource. The mined call is correctly treated as successful because the submitted call succeeds. Resolver state is subsequently polled and refetched, so a surviving assignment can reappear after indexer synchronization, but the flow does not require every requested (account, resource, role) bit to be zero before treating the transaction as complete.
The resolver contracts correctly enforce the scope Portal supplies. At the pinned supporting revision, authorizeNameRoles updates only the resource computed for its supplied name. _effectiveRoles combines root and resource-local roles, and setAddr permits an address write while ROLE_SET_ADDR remains effective. The resource identity is lost in Portal before the typed contract call is selected.
The demonstrated exploit proceeds as follows:
- Alice grants Mallory
ROLE_SET_TEXTonalpha.ethandROLE_SET_ADDRonbeta.eththrough the same permissioned resolver. Mallory has no root role. - Portal displays one row for Mallory containing both names and both permissions.
- Alice selects Remove user and confirms removal from all roles.
- Assuming
alpha.ethis the first indexed name, Portal submitsauthorizeNameRoles(alpha.eth, ROLE_SET_TEXT | ROLE_SET_ADDR, mallory, false). - The call clears the selected
alpha.ethresource only. Mallory'sROLE_SET_ADDRonbeta.ethremains effective. - Before Alice observes the surviving assignment and sends the missing revocation, Mallory changes
beta.eth's ETH address to an address she controls. - A user who resolves
beta.ethreceives Mallory's address and can send funds there.
The same defect has a broader variant: if Mallory holds root ROLE_SET_ADDR plus any name-scoped role, Portal selects the name and leaves the root assignment intact, preserving address-changing authority over every name served by that resolver.
Recommended remediation
Portal must preserve the exact EAC resource and its scope type from the resolver overview response through display and transaction construction. Each displayed assignment should map to one explicit typed target such as root, name, or record part; transaction builders must not infer the target from the first entry in resolvedNames.
The clearest fix is to key actionable rows by (account, resource). If the account-level row is retained, Remove user must expand into one correctly typed revocation per underlying resource and execute the operations atomically where supported. An unmapped resource must block the mutation with an explicit error instead of falling back to another scope. After synchronization, Portal should read back every requested (account, resource, role) and present the removal as complete only when all targeted bits are zero.
Regression tests should cover two names in both indexer orderings, root plus name, root-only and name-only controls, duplicate role bits, unmapped and part-scoped resources, partial batch failure, and both Remove and Save operations.
Impact Details
This reaches the competition's listed Critical impact: “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,” specifically the example of resolving an ENS name to an attacker-controlled address.
The Foundry PoC demonstrates the complete downstream effect: Mallory's ROLE_SET_ADDR survives the Portal-style revocation, Mallory changes beta.eth's resolver record to her address, resolver.addr(betaNode) returns that address, and ETH sent to the resolved address is received by Mallory.
This is a broken deauthorization, not a new privilege grant. Mallory must already hold ROLE_SET_ADDR on one of at least two resources associated with the same resolver, and Alice must use Portal's account-level removal action. The incomplete removal is deterministic, but harmful exploitation requires Mallory to act before Alice notices the surviving assignment and submits a correctly scoped revocation. The surviving row can become visible after indexer synchronization and Alice can recover by revoking the remaining resource, so the issue does not permanently remove her control. It does not require compromise of Alice's wallet, the indexer, or the resolver contracts.
References
- Portal target at the frozen competition revision
- Resolver overview query retains
resource - Account-only grouping
- Single-name selection and mutation path
- Scope summary and removal confirmation
- Pinned supporting resolver revision
- ENS Audit Competition information and impacts
Link to Proof of Concept
https://gist.github.com/vendrell46/c741eb3bac36fe4235596b65804e8393
Proof of Concept
Proof of Concept
The secret Gist contains these three files:
README.md— setup and execution instructions;resolverRoleRemovalScope.poc.test.ts— Portal grouping and calldata test;RoleRemovalScope.t.sol— resolver authorization, address-change, fund-flow, and correct-revocation controls.
Secret Gist: https://gist.github.com/vendrell46/c741eb3bac36fe4235596b65804e8393
The following steps reproduce the issue without interacting with a live ENS deployment.
I ran the two parts independently: the Portal test invokes the production grouping and calldata-building functions, while the Foundry test executes the equivalent transaction against the pinned resolver contracts. Together they establish the Portal-generated calldata and its contract-level consequence; they do not claim a live browser, indexer, and deployed-resolver end-to-end run.
-
Clone the frozen Portal target and install its locked dependencies:
Bash git clone https://github.com/immunefi-team/audit-comp-ens.git app git -C app checkout 1c9b47f18fcddd2e864dfe385c4171061c9811ae pnpm --dir app install --frozen-lockfile -
Clone the secret Gist and place the Portal test in the target tree:
Bash git clone https://gist.github.com/vendrell46/c741eb3bac36fe4235596b65804e8393 ens-role-resource-poc cp ens-role-resource-poc/resolverRoleRemovalScope.poc.test.ts \ app/apps/portal/src/lib/roles/resolverRoleRemovalScope.poc.test.ts -
Run the Portal PoC:
Bash pnpm --dir app --filter portal exec vitest run \ src/lib/roles/resolverRoleRemovalScope.poc.test.tsThe observed result is
1passing test file containing5passing tests. The multi-resource cases produce one account group and one name-scopedauthorizeNameRolescall, while the root-only and name-only controls select their correct typed operations. -
Clone the resolver contracts at the revision used to validate the consequence, then copy the Foundry test:
Bash git clone --recurse-submodules https://github.com/ensdomains/contracts-v2.git contracts-v2 git -C contracts-v2 checkout 8d1c89350729f87b3968cf41ef3d683951444a44 git -C contracts-v2 submodule update --init --recursive cp ens-role-resource-poc/RoleRemovalScope.t.sol \ contracts-v2/contracts/test/RoleRemovalScope.t.sol -
Run the contract PoC from the contracts workspace:
Bash cd contracts-v2/contracts forge clean forge test --match-path test/RoleRemovalScope.t.sol -vvThe observed result is
2 passed; 0 failed; 0 skipped. The two-name test shows that the unselectedROLE_SET_ADDRassignment survives, Mallory changes the resolved address, and funds sent to that resolution reach Mallory. The root-plus-name test shows that the same Portal-style name revocation leaves root address-changing authority effective. The correct-revocation control then clears the actual surviving scope and confirms Mallory's next address write reverts.
The tests operate only on local in-memory state and disposable local contracts. They require no network credentials, private keys, or cleanup beyond deleting the two cloned directories.
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 grouped role assignments by account only, discarding the resource each assignment belonged to, so the removal transaction targeted a single inferred name instead of every resource.
Impact
A delegate could keep address-changing authority over a name after an apparent full removal and redirect funds sent to that name, though the owner can recover by revoking the surviving assignment.
What the attacker needed
Mallory already holds a role on two resources; Alice uses the account-level removal action; Mallory acts before the owner revokes again
The fix
The portal should key actionable rows by account and resource, expand removal into one correctly typed revocation per resource, and confirm completion only when every targeted role bit is zero.
How it was found
- Alice grants Mallory a text-setting role on one name and an address-setting role on another name through the same resolver.
- The portal shows a single row for Mallory containing both names and both permissions.
- Alice selects Remove user and confirms removal from all roles.
- The portal submits a revocation for only the first indexed name, clearing that name's permissions.
- Mallory's address-setting role on the other name survives, and she changes that name's ETH address to one she controls.
- A user who resolves the unaffected name receives Mallory's address and can send funds there.
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 part of ENS that stores a name's address. The portal let an owner remove a delegate's permissions, but it bundled permissions from several names into one row and only actually removed one name's permissions. The delegate kept the right to change another name's address, so people resolving that name could be sent to the attacker's wallet.
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.