Skip to content

fix: reject the zero address in initializers and setters - #2299

Open
0xrlawrence wants to merge 1 commit into
yetanotherco:stagingfrom
0xrlawrence:fix/validate-addresses-in-setters
Open

fix: reject the zero address in initializers and setters#2299
0xrlawrence wants to merge 1 commit into
yetanotherco:stagingfrom
0xrlawrence:fix/validate-addresses-in-setters

Conversation

@0xrlawrence

Copy link
Copy Markdown

Description

AlignedLayerServiceManager and BatcherPaymentService both revert with InvalidAddress on every address they are initialized with. AlignedProofAggregationService validates none of them, and a zero newOwner there permanently disables _authorizeUpgrade and every setter, with no recovery path.

This applies the same check the sibling contracts already use:

  • AlignedProofAggregationService.initializenewOwner, alignedAggregatorAddress, sp1VerifierAddress, risc0VerifierAddress.
  • setSP1VerifierAddress / setRisc0VerifierAddress — either would otherwise point verification at an empty address, where the call to a non-contract silently succeeds.
  • BatcherPaymentService.withdrawFromServiceManagerwithdrawAddress is unchecked, and transfer() to address(0) succeeds and burns the funds, so an owner typo is unrecoverable.

InvalidAddress(string param) is added to IAlignedProofAggregationService to match the error already used by the other two contracts.

Left alone deliberately: the bytes32 program commitments in initialize are not address-typed and zero may be meaningful there, so they are not validated.

Type of change

  • Bug fix

Checklist

  • “Hotfix” to testnet, everything else to staging

Verified with forge build on staging.

AlignedLayerServiceManager and BatcherPaymentService both validate every
address they are initialized with, but AlignedProofAggregationService
validates none of them. A zero newOwner there permanently disables
_authorizeUpgrade and every setter, with no way back.

Apply the same InvalidAddress check the sibling contracts already use:

- AlignedProofAggregationService.initialize: newOwner,
  alignedAggregatorAddress, sp1VerifierAddress, risc0VerifierAddress
- setSP1VerifierAddress and setRisc0VerifierAddress, which would otherwise
  point verification at an empty address
- BatcherPaymentService.withdrawFromServiceManager: withdrawAddress, where
  transfer() to address(0) succeeds and burns the funds

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant