-
Notifications
You must be signed in to change notification settings - Fork 104
Fix/authz #379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/v22
Are you sure you want to change the base?
Fix/authz #379
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements a critical security fix by introducing the AuthzLimiterDecorator
to prevent dangerous contract-related messages from being executed via the Cosmos SDK authz
module, addressing a vulnerability where malicious actors could bypass ante handlers.
- Added
AuthzLimiterDecorator
that blocks specific dangerous message types from being nested insideauthz.MsgExec
transactions - Integrated the decorator into the ante handler chain to enforce restrictions during transaction processing
- Implemented comprehensive testing to verify the security fix works correctly
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
app/authz_ante.go | Core implementation of AuthzLimiterDecorator with message validation logic |
app/ante.go | Integration of the new decorator into the ante handler chain with restricted message types |
app/authz_ante_test.go | Unit tests verifying decorator functionality for both allowed and restricted messages |
app/authz_integration_test.go | Integration tests demonstrating vulnerability prevention and comprehensive message type blocking |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]> Signed-off-by: TwiceBurnt <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: TwiceBurnt <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤘
Converting to Draft to avoid accidental merge |
This pull request introduces a new security mechanism to prevent dangerous contract-related messages from being executed via the Cosmos SDK
authz
module, addressing a critical vulnerability. The main addition is theAuthzLimiterDecorator
, which blocks specific message types (such as contract execution and management) from being nested insideauthz.MsgExec
transactions. Comprehensive unit and integration tests are included to ensure the decorator works as intended and does not interfere with legitimate authz operations.Security hardening:
AuthzLimiterDecorator
inapp/authz_ante.go
to prevent execution of dangerous message types (e.g., contract execution, instantiation, migration, admin updates) viaauthz.MsgExec
, mitigating a known bypass vulnerability.AuthzLimiterDecorator
into the ante handler chain inapp/ante.go
to enforce these restrictions during transaction processing.Testing and verification:
app/authz_ante_test.go
to verify that restricted message types are blocked and legitimate messages are allowed by the decorator.app/authz_integration_test.go
to demonstrate that the decorator prevents the reported vulnerability and blocks all dangerous contract-related message types, while allowing safe authz operations.