Resolver row index reuse carries a removed user s root upgrade permission into another collaborator and enables shared resolver takeover
Portal's resolver role editor tied its checkbox state to a table row's positional index rather than to the account being edited, so after an administrator removed one collaborator the next collaborator shifted into the same index and inherited the removed user's checked permissions. Saving an unrelated change then signed a grant of the upgrade permission to the lower-privileged collaborator, letting them replace the shared resolver implementation and redirect resolution of names owned by other accounts.
- Disclosed after under an hour
90931 w a critical resolver row index reuse carries a removed user s root upgrade permission into another collaborator and enables shared resolver takeover
Submitted on Aug 28th 2026 at 08:04:17 UTC by @sl1de for Audit Competition | ENS
- Report ID: #90931
- 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
Portal's resolver role editor binds its mutable checkbox state to a TanStack table row's default numeric index instead of to the resolver, resource, and account being edited. If the resolver administrator removes one collaborator, the next collaborator shifts into the removed row's index. When that shifted row is opened, Portal can retain the removed collaborator's checked permissions while changing the target account to the shifted collaborator.
I reproduced a concrete Critical consequence with two genuine root-scoped rows:
- A trusted collaborator occupies row
0and has rootSet Text | Upgrade. - A low-privilege collaborator occupies row
1and has only rootSet Text. - The administrator removes the trusted collaborator through Portal's normal connected-wallet workflow.
- Authentic Panoptes omits the zero-bitmap row, so the low-privilege collaborator shifts from row
1to row0. - Portal's mounted sidebar retains
prevRowId = "0"and the removed collaborator's permission state. - When the administrator opens the shifted collaborator, the table correctly says only
Set Text, but the editor also shows staleUpgradeas checked. - The administrator deliberately changes only
Set ABIfrom unchecked to checked and saves. - Portal compares the shifted collaborator's real roles against the stale editor state and signs
grantRootRoles(ROLE_SET_ABI | ROLE_UPGRADE, collaborator).
The stale Upgrade checkbox is visibly checked in the editor. The victim can notice it and stop. However, the final Portal transaction modal only says Update roles for <collaborator> and enumerates neither Set ABI nor Upgrade. A wallet that independently decodes and explains the bitmap can also expose the extra permission.
The proof then exercises the newly granted authority. Before the Portal transaction, the collaborator's resolver upgrade attempt is rejected. After approval, the collaborator successfully replaces the shared PermissionedResolver implementation. Two names owned by different accounts and using that resolver subsequently resolve through ENSjs to the collaborator address.
All state changes were executed on a private disposable Sepolia fork. No public-chain exploitation is claimed.
Vulnerability Details
Actors and setup
There are three relevant accounts:
- The victim is a legitimate root role administrator for a shared PermissionedResolver and uses Portal's role-management interface.
- A trusted collaborator has root
ROLE_SET_TEXT | ROLE_UPGRADEand is intentionally removed by the victim. - The attacker-controlled collaborator has only benign root
ROLE_SET_TEXTand appears immediately after the trusted collaborator in the indexed table order.
The shared resolver serves at least two names owned by different accounts. Before the vulnerable workflow begins, the attacker-controlled collaborator has no root ROLE_SET_ABI, no root ROLE_UPGRADE, and cannot upgrade the resolver.
The expected invariant is:
selected resolver + selected resource + selected account
== editor permission source
== diff baseline
== confirmed role delta
== signed role delta
The vulnerable sequence changes the selected account but keeps the previous row's editor permissions:
Initial indexed rows
row.id "0" -> trusted account -> Set Text | Upgrade
row.id "1" -> attacker -> Set Text
|
v
Victim removes trusted row and approves the wallet transaction
|
v
Panoptes omits trusted zero-bitmap role
row.id "0" -> attacker -> Set Text
|
v
Sidebar still stores
prevRowId = "0"
editedPermissions = Set Text | Upgrade
|
v
Victim opens attacker row and changes only Set ABI
|
v
Portal diffs attacker actual Set Text against
stale Set Text | Set ABI | Upgrade
|
v
Victim wallet signs
grantRootRoles(Set ABI | Upgrade, attacker)
|
v
Attacker upgrades the shared resolver implementation
|
v
Names owned by separate accounts resolve to attacker
Root cause 1: the generic table uses positional row IDs
ResolverRolesTable groups roles into account rows, stores the selected TanStack Row, and passes the resulting data to the generic DataTable:
const [editingRow, setEditingRow] = useState<Row<AccountRoleGroup> | null>(
null,
)
const data = useMemo(
() => groupRolesByAccount(roles, buildResourceToNameMap(nodes)),
[roles, nodes],
)
// ...
buildEditActionColumn<AccountRoleGroup>((row) => {
setEditingRow(row)
setOpen(true)
})
// ...
<DataTable columns={columns} data={data} />
DataTable calls useReactTable without supplying getRowId:
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
onSortingChange: setSorting,
getSortedRowModel: getSortedRowModel(),
state: { sorting },
})
TanStack therefore assigns the current positional index as row.id. In the verified sequence, the trusted account has ID "0" and the attacker-controlled collaborator has ID "1". Once the trusted account disappears, the collaborator receives ID "0".
The role grouping function preserves the first-seen account order from the indexed role list. The proof creates distinct role-event timestamps and waits for authentic Panoptes to return exactly [trusted, attacker], making the shift deterministic rather than assuming a convenient ordering.
Root cause 2: sidebar state is synchronized only by the positional ID
The sidebar derives the currently selected account and its actual decoded roles from row.original:
const selectedAccount = row?.original.account as Address
const decodedRoles = (row?.original.decodedRoles ?? []) as ResolverRoleKey[]
However, its mutable checkbox state is reset only when row.id changes:
const [editedPermissions, setEditedPermissions] = useState<
Map<string, Permission>
>(new Map())
const [prevRowId, setPrevRowId] = useState<string | null>(null)
if (row && row.id !== prevRowId) {
setPrevRowId(row.id)
setEditedPermissions(roleToPermissions(row.original.decodedRoles))
}
Opening the trusted row stores:
prevRowId = "0"
editedPermissions = Set Text | Upgrade
After removal, the sidebar component stays mounted. Its transaction onDone closes the modal and sheet, but does not clear prevRowId, editedPermissions, or editingRow:
onDone: () => {
closeModal()
clearTransaction()
setPendingAction(null)
setOpen(false)
}
When the attacker-controlled collaborator shifts into row "0" and the victim opens that row, row.original.account changes but row.id !== prevRowId is false. The permission reset is skipped.
The resulting editor object combines:
selectedAccount = attacker
decodedRoles = Set Text
editedPermissions = Set Text | Upgrade (retained from trusted account)
Root cause 3: the normal removal workflow creates and retains the vulnerable state
The sidebar's Remove user action snapshots the trusted account and its roles, then submits them through the production resolver-role helper:
setPendingAction({
type: 'remove',
name: roleName,
account: selectedAccount,
roles: decodedRoles,
})
openModal()
After the removal succeeds, Portal polls for indexer synchronization and invalidates all resolver-overview queries:
onSuccess: async () => {
await pollForIndexerSync({
invalidateQueries: () =>
queryClient.invalidateQueries({
queryKey: ['resolver-overview'],
refetchType: 'all',
}),
})
}
Authentic Panoptes no longer returns the trusted account once its complete role bitmap is zero. The table rerenders with the attacker-controlled collaborator as its only row, but the enclosing ResolverRolesSidebar remains the same mounted component and retains the previous editor state.
This is not a forged-indexer or stale-indexer assumption. Panoptes returns the correct initial two-row order and the correct one-row post-removal state. The application mishandles the legitimate change in row position.
Root cause 4: diff computation compares the new account against the old account's edited state
The sidebar recomputes originalPermissions from the currently selected row, but computes the delta against the retained editedPermissions map:
const originalPermissions = useMemo(
() => roleToPermissions(decodedRoles),
[decodedRoles],
)
const { rolesToGrant, rolesToRevoke } = computeRoleChanges(
decodedRoles as string[],
editedPermissions,
)
computeRoleChanges iterates over the union of the current row's actual roles and the editor map. Any permission that is true in the retained editor but false for the shifted collaborator becomes a grant:
const allKeys = new Set([
...originalPermissions.keys(),
...editedPermissions.keys(),
])
// ...
if (edited.manager && !original.manager) {
rolesToGrant.push(key as ResolverRole)
}
In the verified flow:
attacker original permissions = Set Text
retained editor permissions = Set Text | Upgrade
victim's deliberate change = Set ABI false -> true
computed rolesToGrant = Set ABI | Upgrade
computed rolesToRevoke = []
The victim never clicks the Upgrade checkbox in the attacker editor. It is already visibly checked due to the state bleed.
Root cause 5: the pending action and transaction modal bind the stale delta to the new account
When Save is activated, the sidebar snapshots the newly selected account together with the stale-derived role delta:
setPendingAction({
type: 'save',
name: roleName,
account: selectedAccount,
rolesToGrant: rolesToGrant,
rolesToRevoke: rolesToRevoke,
})
openModal()
Because both source and target rows are genuine root rows, roleName is the application's normal empty-string representation of root scope. The grant helper correctly translates that root scope to the root ABI operation. The incorrect field is the role bitmap, not the target account or resource scope.
The prepared intent receives the stale-derived rolesToGrant and passes it to prepareGrantResolverRolesTransaction. That helper uses ENSjs to encode the root grant and supplies it to the production transaction manager:
prepareGrantResolverRolesTransaction({
resolverAddress,
name,
account,
roles: rolesToGrant,
walletClient,
chainId,
})
Portal's visible transaction metadata identifies only the account:
{
title: 'Save resolver role changes',
transactionName: `Update roles for ${pendingAction?.account ?? ''}`,
}
The production transaction state renders that transactionName. It does not enumerate the grant bitmap or permission names. In the captured run, the modal contained neither Upgrade nor Set ABI.
Root cause 6: the stale permission becomes usable root implementation authority
Portal defines:
ROLE_SET_TEXT = 1 << 4
ROLE_SET_ABI = 1 << 16
ROLE_UPGRADE = 1 << 124
and describes ROLE_UPGRADE as permission to upgrade the resolver contract.
The exact browser-signed transaction decoded as:
grantRootRoles(
roleBitmap = 21267647932558653966460912964485578752,
account = 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
)
The signed bitmap is:
21267647932558653966460912964485578752
= (1 << 124) | (1 << 16)
= ROLE_UPGRADE | ROLE_SET_ABI
Exact mined input from the captured private-fork run:
0x072d5d77000000000000000000000000000000001000000000000000000000000001000000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c8
Before this grant, the collaborator's complete root bitmap was exactly 16 (ROLE_SET_TEXT) and a direct upgradeToAndCall simulation was rejected. After the grant, the complete bitmap was exactly ROLE_SET_TEXT | ROLE_SET_ABI | ROLE_UPGRADE, and the collaborator's upgradeToAndCall transaction succeeded.
The implementation slot changed while the resolver proxy bytecode stayed unchanged. A deterministic proof implementation then caused two names owned by different accounts to return the collaborator address through ENSjs resolution.
Full production call and state path
Panoptes resolver.roles
[trusted: ROOT SetText|Upgrade, attacker: ROOT SetText]
|
v
useResolverOverview()
|
v
groupRolesByAccount() preserves indexed first-seen order
|
v
ResolverRolesTable -> DataTable
|
v
useReactTable() without getRowId
trusted.id = "0", attacker.id = "1"
|
v
victim edits trusted row
|
v
ResolverRolesSidebar stores
prevRowId = "0"
editedPermissions = SetText|Upgrade
|
v
victim removes trusted user and approves wallet
|
v
pollForIndexerSync + resolver-overview refetch
|
v
Panoptes omits trusted zero-bitmap role
attacker shifts to id = "0"
|
v
victim opens attacker row
selectedAccount = attacker
row.id = "0" == prevRowId
permission reset skipped
|
v
victim changes only SetABI false -> true
|
v
computeRoleChanges(
attacker actual SetText,
stale edited SetText|Upgrade|SetABI
)
|
v
pendingAction = {
account: attacker,
rolesToGrant: [SetABI, Upgrade]
}
|
v
prepareGrantResolverRolesTransaction()
|
v
Portal modal says only "Update roles for <attacker>"
|
v
connected wallet signs grantRootRoles(SetABI|Upgrade, attacker)
|
v
attacker calls upgradeToAndCall()
|
v
shared resolver implementation changes
|
v
two separately owned names resolve to attacker
Verified Result
I reproduced the complete component-to-browser-to-chain consequence using the frozen competition source, authentic local Panoptes, the production Portal role route and components, the production transaction modal and transaction manager, a connected throwaway wallet, a real fork-deployed PermissionedResolver proxy, and ENSjs resolution after exploitation.
| Item | Verified result |
|---|---|
| Competition commit | cda79acaad59711b943fc68207ebb3f1d0ff8596 |
| Imported upstream commit | 63772fd872af472ced58b009499355f3430c2a86 |
| Environment | Private disposable Sepolia fork at block 11577942 |
| Node / pnpm | v22.23.2 / 10.27.0 |
| Shared resolver | 0xABEfD53a03de274dD1b26dEE9D9a7bfec2cF91c4 |
| Authentic initial account order | [trusted, attacker] |
| Authentic post-removal order | [attacker] |
| Trusted row index | 0 |
| Attacker row index | 1 -> 0 |
| Trusted initial root roles | ROLE_SET_TEXT and ROLE_UPGRADE |
| Attacker initial complete root bitmap | 16 (ROLE_SET_TEXT) |
Attacker initial ROLE_SET_ABI |
false |
Attacker initial ROLE_UPGRADE |
false |
| Attacker upgrade before Portal grant | Rejected |
| Stale Upgrade in attacker editor | Visible and checked |
| Only deliberate permission change | ROLE_SET_ABI false -> true |
| Modal text | Update roles for 0x70997970c51812dc3a010c7d01b50e0d17dc79c8 |
| Modal lists Upgrade | false |
| Modal lists Set ABI | false |
| Browser-signed function | grantRootRoles |
| Browser-signed bitmap | 21267647932558653966460912964485578752 (ROLE_SET_ABI and ROLE_UPGRADE) |
| Browser-signed account | Attacker-controlled collaborator |
| Browser root-grant transaction | 0x14537e2b063ee98d495fba1dd40722b67751fa8d1886ad8659de5432c6e21b98 |
Attacker root ROLE_SET_ABI after |
true |
Attacker root ROLE_UPGRADE after |
true |
| Resolver implementation before | 0x9EAe5C2730a7dD16BDD1DeE6421a1B91e3B0365e |
| Resolver implementation after | 0x28A15edC0DaAf81eb684C2B59EdC2680c1Aed971 |
| Resolver upgrade transaction | 0x2f3a5dab53608a1d8e087b889e077152b5a2cd173e194f012a4ee1891a603b5f |
| Proxy bytecode unchanged | true |
| First affected name owner | Resolver administrator |
| Second affected name owner | A separate victim account |
| Both names resolve through ENSjs to attacker | true |
| Production component proof | 1 passed |
| Production browser proof | 1 passed (53.5s) |
| Joined result | PASS |
| Cleanup | servicesOwnedByRunnerStopped=true |
The transaction hashes and generated names are private-fork evidence and will differ on rerun. The row-index transition, role bitmap, and authority consequence are deterministic under the asserted role order.
Negative controls
- Both original role rows use the genuine non-ambiguous root resource, resource
0. - Authentic Panoptes returns the trusted collaborator first and the attacker-controlled collaborator second before removal.
- Authentic Panoptes returns only the attacker-controlled collaborator after removal.
- The trusted role's timestamp is greater than the attacker role's timestamp, and the proof asserts all three row positions.
- The attacker-controlled collaborator's complete root bitmap is exactly
ROLE_SET_TEXTbefore the vulnerable transaction. - The collaborator has neither
ROLE_SET_ABInorROLE_UPGRADEbefore the vulnerable transaction. - A direct collaborator resolver upgrade is rejected before the vulnerable transaction.
- The role table correctly shows only
Set Texton the collaborator before and after the row shift. - The victim changes only
Set ABIin the attacker editor. - The exact mined browser transaction decodes to root
ROLE_SET_ABI | ROLE_UPGRADEfor the intended collaborator account. - The implementation slot changes only after the unintended root Upgrade grant.
- The proxy address and proxy bytecode remain unchanged.
- The two affected names have different owners.
- No RPC response, Panoptes response, transaction payload, or wallet result is mocked in the browser-to-chain proof.
- No public network receives a write.
Preconditions and Boundaries
The following preconditions are explicit:
- The victim is a legitimate root role administrator for the PermissionedResolver.
- The resolver has at least two collaborator rows.
- The attacker-controlled collaborator follows a row that the victim removes in the current table order. The proof makes this deterministic by separating role-event timestamps and verifying the authentic indexed order before starting the UI sequence.
- The removed row has a dangerous checked permission that the attacker-controlled collaborator lacks.
- The victim completes two deliberate, normal Portal workflows without navigating away or otherwise remounting the table: first removing the trusted collaborator, then editing the shifted collaborator.
- In the second workflow, the victim changes an ordinary permission and approves the connected-wallet transaction.
The following boundaries are also explicit:
- The stale
Upgradecheckbox is visibly checked in the shifted collaborator's editor. The victim can notice the unexpected state and abort. - Portal's final transaction modal names only the collaborator account and does not enumerate
UpgradeorSet ABI. - A wallet that independently decodes the function and bitmap and explains the permissions can expose the extra
Upgradebit; the victim can reject the request. - The attacker cannot force the victim to remove the first collaborator, edit the second collaborator, or approve either transaction.
- The account and root resource are not substituted. Portal grants the stale permission to the account the victim is editing. The substituted value is the role bitmap.
- The verified consequence is resolver implementation control and cross-name resolution control. It does not claim ENS name/NFT ownership transfer.
- The proof does not claim stolen keys, wallet/session compromise, malicious RPC behavior, forged indexer data, backend compromise, public-chain transactions, or completed public-network asset theft.
- The proof implementation is deployed only on the private fork to demonstrate the authority conferred by
ROLE_UPGRADE.
Impact Details
This maps directly to the Critical malicious connected-wallet interaction impact. The victim deliberately adds ordinary Set ABI permission to the selected collaborator. Portal also includes the removed collaborator's root Upgrade permission in the same grant bitmap, presenting it in the editor as if it already belonged to the selected account; the connected wallet then signs that authorization-bearing modification.
The impact is not limited to a stale checkbox or inaccurate preview. The exact browser-signed call succeeds and creates new root authority:
before: attacker root roles = Set Text
signed: grantRootRoles(Set ABI | Upgrade, attacker)
after: attacker root roles = Set Text | Set ABI | Upgrade
ROLE_UPGRADE is implementation authority over the shared PermissionedResolver. The proof shows the attacker-controlled collaborator using it to replace the implementation after an identical upgrade attempt was rejected before the Portal grant. The proxy remains at the same address, so every name still pointing to it is affected.
The completed consequence spans multiple owners. Two names owned by different accounts use the shared resolver. After the implementation replacement, ENSjs resolves both names to the attacker address. Thus, a role edit aimed at one known collaborator can grant that account control over resolution for unrelated users of the shared resolver.
From the attacker's perspective, an existing benign root collaborator row and favorable adjacency to a removed row are sufficient. The attacker begins without resolver upgrade authority. One later victim-approved edit of that row can carry the removed account's dangerous role into the attacker's bitmap.
From the administrator's perspective, the table correctly identifies the second collaborator and shows only its real Set Text role. The sidebar targets that same account, but its checkboxes originate from the removed account. The victim's only deliberate checkbox change is Set ABI; the final Portal modal does not enumerate the resulting role delta.
From other name owners' perspective, no interaction is required after they use the shared resolver. Once the attacker receives root Upgrade and replaces the implementation, their names can resolve according to attacker-controlled code.
Recommended Remediation
{% stepper %} {% step %}
Use immutable row identities
Give every resolver role row an immutable security identity, for example:
{
resolverAddress,
resource,
account,
}
Supply a stable getRowId derived from that identity instead of using the positional index.
{% endstep %}
{% step %}
Reset editor state on identity changes
Reset or remount the editor whenever any part of the selected security identity changes. Do not use a table index to determine whether permission state belongs to the selected account. {% endstep %}
{% step %}
Clear state when a selected row disappears
When a selected row disappears from fresh query data, immediately close the editor and clear editingRow, prevRowId, editedPermissions, and pending transaction state.
{% endstep %}
{% step %}
Store immutable selection identity
Store only the immutable identity in selection state. Resolve the current row from fresh table data rather than retaining a TanStack Row object across refetches.
{% endstep %}
{% step %}
Recompute from fresh authoritative roles
Immediately before preparing calldata, re-read the target account's authoritative role bitmap and recompute the delta from that fresh value. Abort and require a new review if it differs from the baseline the victim edited. {% endstep %}
{% step %}
Bind review and transaction state immutably
Bind the selected account, resource, original bitmap, edited bitmap, role delta, modal text, prepared intent, and submitted intent to one immutable review object. {% endstep %}
{% step %}
Show explicit role deltas in final review
Enumerate every role grant and revoke in the final Portal transaction review. Dangerous permissions such as Upgrade should require explicit role-level confirmation and should never be represented only as an opaque bitmap behind Update roles for <account>.
{% endstep %}
{% step %}
Add regression coverage
Add regression coverage for:
- Removing row
0while row1remains. - Opening the shifted row without remounting the table.
- Changes in sorting and filtering that reuse an index.
- Removal followed by query invalidation and refetch.
- Ensuring no permission from the removed row appears in the shifted row's intent.
- Checking the exact prepared and mined bitmap, not only visible checkbox state. {% endstep %} {% endstepper %}
References
- The resolver role route fetches indexed roles and exposes editing only after its connected-account management check
- The resolver overview query returns role account, resource, bitmap, block, transaction, and timestamp fields
- Role grouping preserves first-seen account insertion order
- ResolverRolesTable retains the selected TanStack Row and passes grouped data to the generic DataTable
- DataTable calls useReactTable without a stable getRowId
- [The sidebar derives the new account but resets ed
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 table assigns positional row IDs and the sidebar resets its edited permission state only when the row ID changes, so a shifted row keeps the previous account's permissions and the diff grants them to the new account.
Impact
A lower-privileged collaborator could gain resolver upgrade authority and make names owned by separate accounts resolve to an attacker address, though the stale checkbox is visible and the victim can abort.
What the attacker needed
Victim is a root role administrator; resolver has at least two collaborator rows; attacker row sits below the removed row; victim removes then edits without remounting
The fix
The editor should key its state to the resolver, resource and account rather than the row index, and clear the pending editor state after a removal completes.
How it was found
- The administrator opens the trusted collaborator's row, which stores the row index and its checked permissions.
- The administrator removes the trusted collaborator and approves the wallet transaction.
- The indexer stops returning the removed account, so the lower-privileged collaborator shifts into the same row index.
- The administrator opens the shifted collaborator's row, which shows the stale upgrade permission still checked.
- The administrator ticks only an ordinary permission and saves, and the wallet signs a grant that includes the upgrade permission.
- The collaborator uses the new upgrade permission to replace the shared resolver implementation.
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 shared name resolver lets several people manage settings for names. The admin screen keeps a list of people and their ticked permissions, but it remembers which entry is open by its position in the list rather than by who it is. When one person is deleted, everyone below moves up a place, so the screen reuses the old ticks for a different person and the admin unknowingly approves extra powers for them.
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.