You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[security] Lock down DEFAULT_ADMIN_ROLE after deploy — grantRole is a capture bypass #2028
The TimelockController holds DEFAULT_ADMIN_ROLE on every contract, so governance can grantRole/revokeRole (inherited AccessControl) to hand GOVERNANCE_ROLE or PAUSER_ROLE to any address. This is a meta-lever that bypasses every other hardening fix — freezing individual setters is moot if governance can simply grant itself (or an attacker) a fresh role on any contract.
Impact
A captured governance can mint new role-holders, sidestepping frozen setters, one-way knobs, and scoped roles alike.
After deploy wiring completes, renounce DEFAULT_ADMIN_ROLE so the role assignments become immutable — no path to add or rotate role-holders on any contract. Any role that genuinely must remain rotatable (e.g. buyback keeper) keeps its own scoped admin, explicitly and minimally, rather than the blanket DEFAULT_ADMIN_ROLE.
Audit every grantRole/revokeRole reachability and every role's admin (getRoleAdmin) across all contracts; confirm nothing but the intended minimal set survives renunciation.
Acceptance criteria
Post-deploy, no live holder of DEFAULT_ADMIN_ROLE (or it's provably scoped to nothing dangerous).
Deploy script asserts the final role table and renounces admin; test proves no new GOVERNANCE_ROLE/PAUSER_ROLE grant is possible afterward.
Deferred pending a team decision on the renunciation strategy. Renouncing the blanket DEFAULT_ADMIN_ROLE at deploy end freezes all role grants forever, which forces a fork: which roles, if any, stay rotatable?
A — Max immutability: renounce DEFAULT_ADMIN entirely; every role frozen, including PAUSER and GOVERNANCE. Simplest. Downside: a compromised emergency pauser can't be rotated out, and governance can't migrate to a successor Governor — both require a full redeploy.
B — (leaning): renounce DEFAULT_ADMIN, but make PAUSER_ROLE governance-administered (_setRoleAdmin(PAUSER_ROLE, GOVERNANCE_ROLE) in each pausable contract's constructor) so governance can rotate the emergency pauser via a timelocked proposal — important since a compromised pauser could grief by pausing intake. Leave GOVERNANCE_ROLE frozen (migration = redeploy, consistent with the no-proxy philosophy).
C — B plus make GOVERNANCE_ROLE self-administered, so governance can hand GOVERNANCE_ROLE to a successor Governor without redeploying (a migration path). Adds no capture risk (a captured governance already controls the contract) but is a genuine extra power.
The other 7 hardening issues in this milestone are implemented in #2038. This one is blocked on A/B/C.
Decision: go with B, extended beyond PAUSER_ROLE. Reject A and C.
The milestone premise is: a captured or malicious governance must never reach a state the electorate can't vote its way back out of. Framed that way, DEFAULT_ADMIN_ROLE is the last open entrenchment hole, and the three options land very differently against it.
The precise danger — not "governance can change things," but capture becoming permanent and unilateral
DEFAULT_ADMIN is a master key over the role table. The sharp escalation is grantRole(GOVERNANCE_ROLE, attackerEOA):
Every governance setter is onlyRole(GOVERNANCE_ROLE), and the Timelock is just an address holding that role.
Grant GOVERNANCE_ROLE to a plain EOA and that EOA passes the same check — so it calls setShares, setWindowEpochs, etc. directly: no vote, no served-bytes weight, no 48h Timelock delay.
So DEFAULT_ADMIN converts a transient, vote-gated, delayed capture (win each proposal, wait out the timelock) into permanent, unilateral, instant control (own a standing key that answers to nobody). Capture stops being something the electorate can reverse. That is the whole reason this issue is critical/prod-blocking, and it's a strictly worse failure than any individual frozen setter.
Worth stating for scope: DEFAULT_ADMINcannot resurrect the levers #2038 made immutable — no grantRole un-deletes setFeeRouter or rewrites an immutable. Its residual power is narrow but potent: mint/rotate holders of roles that still gate live functions, above all GOVERNANCE_ROLE itself.
Correction to option C's premise
The issue says C "adds no capture risk (a captured governance already controls the contract)." That's not quite right. Making GOVERNANCE_ROLE self-administered reopens exactly the grantRole(GOVERNANCE_ROLE, attackerEOA) escalation above. C's marginal risk isn't "more control" — it's immediacy and permanence: it lets a one-time captor drop the vote-and-wait envelope and hand themselves a standing key. C trades the entire Timelock+vote safety net for a migration convenience. Not free; reject.
Why B, and why it must cover more than PAUSER
B renounces the blanket DEFAULT_ADMIN but scopes the narrow, key-holder roles to GOVERNANCE_ROLE via _setRoleAdmin. Result:
GOVERNANCE_ROLE → frozen (admin is the now-unheld DEFAULT_ADMIN) → the entrenchment escalation is closed. Governance migration = redeploy, consistent with the no-proxy philosophy.
Key-holder roles → governance-administered → a compromised off-chain key can still be rotated out via a timelocked proposal.
The issue only names PAUSER_ROLE. It should also cover the other roles with the same off-chain-key compromise exposure:
All three are held by an off-chain multisig/bot whose keys can be lost or stolen. VETTER_ROLE (ManualVettingPolicy) is already GOVERNANCE_ROLE-administered — same pattern, precedent exists.
The contract-held roles (ROUTER_CALLER_ROLE, SLASH_ROLE, SLASH_APPEAL_ROLE, BLACKLIST_ROLE) point at immutable protocol-contract addresses — leave them frozen under the renounced DEFAULT_ADMIN. Replacing one of those is a redeploy anyway.
Interaction with the pause kill-switch (deliberately not changing it)
We are keeping the indefinite pause on purpose: pause() with no unpause() is a valid escape hatch for pausing/abandoning a faulty contract. That decision is why rotatable PAUSER matters — a compromised pauser could grief by freezing intake indefinitely (and, since the vote feed runs through FeeRouter.routeSettlement, a sustained FeeRouter pause eventually drains the trailing vote window, which is a separate accepted risk). Keeping PAUSER_ROLE governance-administered under B preserves the ability to evict such a pauser while the electorate still has standing. B is the fix that keeps our chosen kill-switch from becoming an un-evictable griefing lever.
Implementation shape (maps to the acceptance criteria)
In each affected contract's constructor: _setRoleAdmin(PAUSER_ROLE, GOVERNANCE_ROLE) (and EMERGENCY_MULTISIG_ROLE, KEEPER_ROLE where present). _setRoleAdmin is internal and ungated at construction, same as the existing VETTER_ROLE line.
Deploy handoff: after all wiring, renounce DEFAULT_ADMIN_ROLE on every target (drop it from the deployer without granting it onward to the Timelock — the Timelock keeps only GOVERNANCE_ROLE). Handle the genesis-activated BuybackBurner in the same sweep.
Flip the deploy assertions: _assertNoBackDoors / _requireRole currently assert the Timelock holdsDEFAULT_ADMIN; they must assert no holder of DEFAULT_ADMIN on every target, and assert the scoped getRoleAdmin values (PAUSER/EMERGENCY_MULTISIG/KEEPER → GOVERNANCE_ROLE).
Audit every grantRole/revokeRole reachability and every getRoleAdmin across all contracts; confirm the only surviving grant power post-renounce is GOVERNANCE_ROLE-administered rotation of the three key-holder roles, and that no path can mint a new GOVERNANCE_ROLE holder.
Test: prove grantRole(GOVERNANCE_ROLE, x) and grantRole(<any contract-held role>, x) both revert post-handoff (no admin), while a timelocked governance proposal can still rotate PAUSER/EMERGENCY_MULTISIG/KEEPER.
Net: A over-freezes (can't evict a rogue pauser — bad, given we're keeping the indefinite pause). C quietly re-arms the worst lever. B, extended to EMERGENCY_MULTISIG/KEEPER, reduces capture danger to reversible-only without kneecapping key rotation.
Activity
alpergundogdu commentedon Sep 15, 2026
Deferred pending a team decision on the renunciation strategy. Renouncing the blanket
DEFAULT_ADMIN_ROLEat deploy end freezes all role grants forever, which forces a fork: which roles, if any, stay rotatable?A — Max immutability: renounce
DEFAULT_ADMINentirely; every role frozen, includingPAUSERandGOVERNANCE. Simplest. Downside: a compromised emergency pauser can't be rotated out, and governance can't migrate to a successor Governor — both require a full redeploy.B — (leaning): renounce
DEFAULT_ADMIN, but makePAUSER_ROLEgovernance-administered (_setRoleAdmin(PAUSER_ROLE, GOVERNANCE_ROLE)in each pausable contract's constructor) so governance can rotate the emergency pauser via a timelocked proposal — important since a compromised pauser could grief by pausing intake. LeaveGOVERNANCE_ROLEfrozen (migration = redeploy, consistent with the no-proxy philosophy).C — B plus make
GOVERNANCE_ROLEself-administered, so governance can handGOVERNANCE_ROLEto a successor Governor without redeploying (a migration path). Adds no capture risk (a captured governance already controls the contract) but is a genuine extra power.The other 7 hardening issues in this milestone are implemented in #2038. This one is blocked on A/B/C.
alpergundogdu commentedon Sep 17, 2026
Decision: go with B, extended beyond
PAUSER_ROLE. Reject A and C.The milestone premise is: a captured or malicious governance must never reach a state the electorate can't vote its way back out of. Framed that way,
DEFAULT_ADMIN_ROLEis the last open entrenchment hole, and the three options land very differently against it.The precise danger — not "governance can change things," but capture becoming permanent and unilateral
DEFAULT_ADMINis a master key over the role table. The sharp escalation isgrantRole(GOVERNANCE_ROLE, attackerEOA):onlyRole(GOVERNANCE_ROLE), and the Timelock is just an address holding that role.GOVERNANCE_ROLEto a plain EOA and that EOA passes the same check — so it callssetShares,setWindowEpochs, etc. directly: no vote, no served-bytes weight, no 48h Timelock delay.So
DEFAULT_ADMINconverts a transient, vote-gated, delayed capture (win each proposal, wait out the timelock) into permanent, unilateral, instant control (own a standing key that answers to nobody). Capture stops being something the electorate can reverse. That is the whole reason this issue iscritical/prod-blocking, and it's a strictly worse failure than any individual frozen setter.Worth stating for scope:
DEFAULT_ADMINcannot resurrect the levers #2038 made immutable — nograntRoleun-deletessetFeeRouteror rewrites animmutable. Its residual power is narrow but potent: mint/rotate holders of roles that still gate live functions, above allGOVERNANCE_ROLEitself.Correction to option C's premise
The issue says C "adds no capture risk (a captured governance already controls the contract)." That's not quite right. Making
GOVERNANCE_ROLEself-administered reopens exactly thegrantRole(GOVERNANCE_ROLE, attackerEOA)escalation above. C's marginal risk isn't "more control" — it's immediacy and permanence: it lets a one-time captor drop the vote-and-wait envelope and hand themselves a standing key. C trades the entire Timelock+vote safety net for a migration convenience. Not free; reject.Why B, and why it must cover more than
PAUSERB renounces the blanket
DEFAULT_ADMINbut scopes the narrow, key-holder roles toGOVERNANCE_ROLEvia_setRoleAdmin. Result:GOVERNANCE_ROLE→ frozen (admin is the now-unheldDEFAULT_ADMIN) → the entrenchment escalation is closed. Governance migration = redeploy, consistent with the no-proxy philosophy.The issue only names
PAUSER_ROLE. It should also cover the other roles with the same off-chain-key compromise exposure:PAUSER_ROLE— PaymentPool, FeeRouter, CapacityBond, SlashJudge, SlashAppeal, BuybackBurnerEMERGENCY_MULTISIG_ROLE— ContentBlacklist, SlashAppealKEEPER_ROLE— BuybackBurnerAll three are held by an off-chain multisig/bot whose keys can be lost or stolen.
VETTER_ROLE(ManualVettingPolicy) is alreadyGOVERNANCE_ROLE-administered — same pattern, precedent exists.The contract-held roles (
ROUTER_CALLER_ROLE,SLASH_ROLE,SLASH_APPEAL_ROLE,BLACKLIST_ROLE) point at immutable protocol-contract addresses — leave them frozen under the renouncedDEFAULT_ADMIN. Replacing one of those is a redeploy anyway.Interaction with the pause kill-switch (deliberately not changing it)
We are keeping the indefinite pause on purpose:
pause()with nounpause()is a valid escape hatch for pausing/abandoning a faulty contract. That decision is why rotatablePAUSERmatters — a compromised pauser could grief by freezing intake indefinitely (and, since the vote feed runs throughFeeRouter.routeSettlement, a sustained FeeRouter pause eventually drains the trailing vote window, which is a separate accepted risk). KeepingPAUSER_ROLEgovernance-administered under B preserves the ability to evict such a pauser while the electorate still has standing. B is the fix that keeps our chosen kill-switch from becoming an un-evictable griefing lever.Implementation shape (maps to the acceptance criteria)
_setRoleAdmin(PAUSER_ROLE, GOVERNANCE_ROLE)(andEMERGENCY_MULTISIG_ROLE,KEEPER_ROLEwhere present)._setRoleAdminis internal and ungated at construction, same as the existingVETTER_ROLEline.DEFAULT_ADMIN_ROLEon every target (drop it from the deployer without granting it onward to the Timelock — the Timelock keeps onlyGOVERNANCE_ROLE). Handle the genesis-activatedBuybackBurnerin the same sweep._assertNoBackDoors/_requireRolecurrently assert the Timelock holdsDEFAULT_ADMIN; they must assert no holder ofDEFAULT_ADMINon every target, and assert the scopedgetRoleAdminvalues (PAUSER/EMERGENCY_MULTISIG/KEEPER→GOVERNANCE_ROLE).grantRole/revokeRolereachability and everygetRoleAdminacross all contracts; confirm the only surviving grant power post-renounce isGOVERNANCE_ROLE-administered rotation of the three key-holder roles, and that no path can mint a newGOVERNANCE_ROLEholder.grantRole(GOVERNANCE_ROLE, x)andgrantRole(<any contract-held role>, x)both revert post-handoff (no admin), while a timelocked governance proposal can still rotatePAUSER/EMERGENCY_MULTISIG/KEEPER.Net: A over-freezes (can't evict a rogue pauser — bad, given we're keeping the indefinite pause). C quietly re-arms the worst lever. B, extended to
EMERGENCY_MULTISIG/KEEPER, reduces capture danger to reversible-only without kneecapping key rotation.docs(contracts): clarify #2028 role-renounce comments (Copilot review)
feat(contracts)!: renounce DEFAULT_ADMIN_ROLE, scope rotatable roles …