fix: reject the zero address in initializers and setters - #2299
Open
0xrlawrence wants to merge 1 commit into
Open
fix: reject the zero address in initializers and setters#22990xrlawrence wants to merge 1 commit into
0xrlawrence wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
AlignedLayerServiceManagerandBatcherPaymentServiceboth revert withInvalidAddresson every address they are initialized with.AlignedProofAggregationServicevalidates none of them, and a zeronewOwnerthere permanently disables_authorizeUpgradeand every setter, with no recovery path.This applies the same check the sibling contracts already use:
AlignedProofAggregationService.initialize—newOwner,alignedAggregatorAddress,sp1VerifierAddress,risc0VerifierAddress.setSP1VerifierAddress/setRisc0VerifierAddress— either would otherwise point verification at an empty address, where the call to a non-contract silently succeeds.BatcherPaymentService.withdrawFromServiceManager—withdrawAddressis unchecked, andtransfer()toaddress(0)succeeds and burns the funds, so an owner typo is unrecoverable.InvalidAddress(string param)is added toIAlignedProofAggregationServiceto match the error already used by the other two contracts.Left alone deliberately: the
bytes32program commitments ininitializeare not address-typed and zero may be meaningful there, so they are not validated.Type of change
Checklist
testnet, everything else tostagingVerified with
forge buildonstaging.