fix: harden governance, JWK genesis, and proposer stake bound#79
Merged
fix: harden governance, JWK genesis, and proposer stake bound#79
Conversation
…ake bound - Governance: reject proposal batches that target the Governance contract itself, preventing a passing proposal from escalating via transferOwnership / addExecutor / removeExecutor when Governance owns itself. - JWKManager: validate genesis issuer and RSA_JWK entries (non-empty issuer, kid, kty, alg, e, n) so malformed genesis data cannot silently poison downstream signature verification. - GovernanceConfig: tighten requiredProposerStake bound from type(uint256).max to type(uint128).max, matching the uint128 clamp in Governance.getRemainingVotingPower. Any value above uint128.max is unreachable and would freeze governance. - Errors: add ProposalTargetsGovernance and InvalidJWK. - Tests: update GovernanceConfig fuzz bounds to respect the new uint128 cap. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
🛡️ Security Audit ResultsSecurity Audit SummaryGenerated on: Sat Apr 18 17:01:43 UTC 2026 Tools Executed
Next Steps
📁 Full reports available in GitHub Actions Artifacts |
ByteYue
approved these changes
Apr 21, 2026
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.
Summary
src/governance/Governance.sol): reject proposal batches that target the Governance contract itself. Without this guard, a passing proposal could invoketransferOwnership/addExecutor/removeExecutorwhen Governance is its own owner, escalating to full control.src/oracle/jwk/JWKManager.sol): validate genesis issuer + RSA_JWK fields (non-emptyissuer,kid,kty,alg,e,n) so malformed genesis data cannot silently poison downstream signature verification.src/runtime/GovernanceConfig.sol): tightenrequiredProposerStakebound fromtype(uint256).maxtotype(uint128).max. Pool voting power is clamped touint128inGovernance.getRemainingVotingPower, so any value aboveuint128.maxis unreachable and would freeze governance.ProposalTargetsGovernance(uint256 index)andInvalidJWK(bytes issuer).GovernanceConfigfuzz assumptions to respect the newuint128cap onrequiredProposerStake.Test plan
forge build— succeedsforge test— 935 tests pass, 0 failureskid/kty/alg/e/n🤖 Generated with Claude Code