Skip to content

fix[oz-retainer-07-n-03]: add two-step OOReporter ownership - #60

Open
md0x wants to merge 2 commits into
unaudited-pm-v2-oo-reporterfrom
pablo/oz-retainer-07-n-03-two-step-ownership
Open

fix[oz-retainer-07-n-03]: add two-step OOReporter ownership#60
md0x wants to merge 2 commits into
unaudited-pm-v2-oo-reporterfrom
pablo/oz-retainer-07-n-03-two-step-ownership

Conversation

@md0x

@md0x md0x commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Audit finding

OpenZeppelin Retainer 07 identified the following issue:

N-03 — Single-Step Ownership Transfer Can Lead to Accidental Loss Of Admin Control

  • Severity: Notes
  • Status: Open

OOReporter transfers ownership immediately without requiring the nominated address to accept it. A typo or incorrectly pasted address can therefore permanently transfer ownership to an inaccessible account and lose administrative control.

References: OpenZeppelin audit findings · FRO-103 · audited scope tag

Resolution

  • Replace OwnableUpgradeable with Ownable2StepUpgradeable.
  • Keep the current owner in control until the nominated pendingOwner calls acceptOwnership().
  • Allow the current owner to replace an incorrect pending nominee before acceptance.
  • Disable renounceOwnership() so the reporter cannot accidentally lose its administrative, recovery, and upgrade authority.
  • Preserve the existing owner slot and store the pending owner in OpenZeppelin's separate ERC-7201 namespace.
  • Add focused coverage for nomination, replacement, acceptance, and disabled ownership renunciation.

Ownership handoffs now require the nominated account, including a Safe, to execute the second acceptance transaction.

Validation

  • cd pm-v2-oo-reporter && forge fmt --check
  • cd pm-v2-oo-reporter && forge build --sizesOOReporter runtime is 24,088 bytes, leaving 488 bytes below the EIP-170 limit
  • cd pm-v2-oo-reporter && forge test --match-path test/OOReporter.t.sol --match-test test_renounceOwnershipIsDisabled — 1 test passed
  • cd pm-v2-oo-reporter && forge test — 41 tests passed
  • git diff --check

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@md0x
md0x requested a review from Reinis-FRP July 30, 2026 10:36
@linear

linear Bot commented Jul 30, 2026

Copy link
Copy Markdown

FRO-103

@md0x
md0x requested a review from chrismaree July 30, 2026 10:36

@Reinis-FRP Reinis-FRP left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@chrismaree chrismaree left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against FRO-103 and the pinned OpenZeppelin Ownable2Step upgradeable storage model. Existing owner/UUPS authority remains unchanged until the pending owner accepts, the new pending-owner state uses its separate ERC-7201 namespace, and the handoff/replacement coverage matches the finding.


Sent from Chris Codex Agent 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants