fix: Expedited Governance Proposal Whitelist Bypass via authz Wrapping - #353
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis change fixes a bypass in Changes
Estimated code review effort: 2 (Simple) | ~15 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ante/gov_expedited_ante.go (1)
50-82: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract a shared authz-unwrapping helper
ante/gov_expedited_ante.goandante/gov_vote_ante.goboth recurse throughauthz.MsgExecin the same way. Pulling that into a small helper would remove duplication and keep the bypass checks aligned.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ante/gov_expedited_ante.go` around lines 50 - 82, The authz unwrapping logic is duplicated between GovExpeditedProposalsDecorator.validateMsgs/validateAuthzExec and the similar flow in gov_vote_ante.go. Extract the shared MsgExec recursion and Any unpacking into a small helper, then call that helper from both decorators so bypass checks and authz handling stay consistent in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@ante/gov_expedited_ante.go`:
- Around line 50-82: The authz unwrapping logic is duplicated between
GovExpeditedProposalsDecorator.validateMsgs/validateAuthzExec and the similar
flow in gov_vote_ante.go. Extract the shared MsgExec recursion and Any unpacking
into a small helper, then call that helper from both decorators so bypass checks
and authz handling stay consistent in one place.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 092f5b47-5165-4c8c-96d4-3681782df074
📒 Files selected for processing (3)
CHANGELOG.mdante/gov_expedited_ante.goante/gov_expedited_ante_test.go
There was a problem hiding this comment.
Pull request overview
Fixes an expedited governance proposal whitelist bypass where GovExpeditedProposalsDecorator only validated top-level messages, allowing non-whitelisted expedited MsgSubmitProposal to slip through when wrapped in authz.MsgExec.
Changes:
- Add recursive unwrapping/validation of
authz.MsgExecmessages inGovExpeditedProposalsDecorator. - Add test coverage for expedited/non-expedited proposals wrapped in
authz.MsgExec, including nested execs. - Document the fix in the changelog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| CHANGELOG.md | Documents the expedited governance whitelist bypass fix and the new recursive authz exec validation. |
| ante/gov_expedited_ante.go | Recursively unwraps authz.MsgExec and applies the expedited proposal whitelist validation to inner MsgSubmitProposal messages. |
| ante/gov_expedited_ante_test.go | Adds tests ensuring wrapped (and nested wrapped) expedited proposals are validated consistently. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
The
GovExpeditedProposalsDecoratoronly inspected top level messages, so a non-whitelistedMsgSubmitProposalmarked as expedited could slip through by being wrapped inside anauthz.MsgExec. That let non-whitelisted proposal types use the shortened expedited voting window that governance policy intended to reserve for the standard timeline.The fix unwraps
authz.MsgExecrecursively and applies the same expedited whitelist validation to the wrapped proposals, matching the pattern already used byGovVoteDecorator.No new dependencies.
Type of change
How Has This Been Tested?
go test -tags=test ./ante/ -run TestGovExpeditedProposalsDecorator -vauthz.MsgExec(and nestedexec(exec(...))) is now rejectedPR Checklist:
make lint-fix