Skip to content

fix(ante): check nested authz#294

Open
julienrbrt wants to merge 4 commits intomainfrom
julien/7
Open

fix(ante): check nested authz#294
julienrbrt wants to merge 4 commits intomainfrom
julien/7

Conversation

@julienrbrt
Copy link
Collaborator

Fix A-7.

@tbruyelle
Copy link
Collaborator

Thank you @julienrbrt , I think a complete test would be welcome here.

@tbruyelle
Copy link
Collaborator

Looks like the test was useful :P

Comment on lines +88 to +90
if msg, ok := innerMsg.(*authz.MsgExec); ok {
return g.validAuthz(ctx, msg)
}
Copy link
Collaborator

@Pantani Pantani Mar 18, 2026

Choose a reason for hiding this comment

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

Returning directly means we stop validating the remaining sibling messages in the outer MsgExec. Could we recurse, handle any error, and then continue the loop instead? Otherwise, a payload like nested-valid-exec, invalid-vote can still bypass the stake check

Suggested change
if msg, ok := innerMsg.(*authz.MsgExec); ok {
return g.validAuthz(ctx, msg)
}
if msg, ok := innerMsg.(*authz.MsgExec); ok {
if err := g.validAuthz(ctx, msg); err != nil {
return err
}
continue
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch! Added a test for that too.

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