Skip to content

Conversation

@0xChin
Copy link
Member

@0xChin 0xChin commented Jul 17, 2025

Closes OPT-937
Fixes [L-0] Voting Module is not validated during submission

Regarding the voting module changed validation. It is not required given that the move to vote function retrieves the proposalHash based on current ProposalTypeConfigurator config. In case the votingModuleAddress has been changed for a given ProposalType, the computed hash won't be the same and the move to vote function will revert due to an unexisting proposal.

In case we anyways want to add this validation for better dev experience, it would involve a design modification, given that proposal data in move to vote functions is retrieved from the computed hash based on the proposal data, including the proposal types configurator voting module

@0xChin 0xChin requested a review from 0xOneTony July 17, 2025 13:21
@0xChin 0xChin self-assigned this Jul 17, 2025
@linear
Copy link

linear bot commented Jul 17, 2025

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@0xOneTony 0xOneTony mentioned this pull request Jul 18, 2025
@0xOneTony 0xOneTony changed the base branch from sc-feat/permissionless-proposals to fix/ir-findings July 18, 2025 09:31
Copy link
Member

@0xOneTony 0xOneTony left a comment

Choose a reason for hiding this comment

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

lgtm but lets merge #448 first

@0xChin 0xChin force-pushed the fix/voting-module-validation branch from 5ef7688 to 1e23489 Compare July 18, 2025 17:23
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Proposal Validation Fails for Zero Voting Module

The validation for an invalid voting module in submitUpgradeProposal, submitCouncilMemberElectionsProposal, and submitFundingProposal incorrectly checks bytes(proposalTypeConfig.name).length == 0. This allows proposals with a non-empty name but an invalid (zero) module address to pass validation. The check should instead directly validate if the module address is zero (votingModule == address(0)), which aligns with the ProposalValidator_InvalidVotingModule error's intent.

packages/contracts-bedrock/src/governance/ProposalValidator.sol#L342-L346

// Validate voting module exists
if (bytes(proposalTypeConfig.name).length == 0) {
revert ProposalValidator_InvalidVotingModule();
}

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@0xOneTony 0xOneTony merged commit a32244f into fix/ir-findings Jul 21, 2025
3 checks passed
0xOneTony pushed a commit that referenced this pull request Jul 29, 2025
* fix: check for uninitialized voting modules

* fix: pre-pr

* fix: pre-pr
0xOneTony pushed a commit that referenced this pull request Jul 29, 2025
* fix: check for uninitialized voting modules

* fix: pre-pr

* fix: pre-pr
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