Skip to content

fix: limit authz.MsgExec nesting depth in ante decorators and coredaos VetoProposal msg#344

Merged
giunatale merged 2 commits into
mainfrom
giunatale/msgexec-nesting-limit
Jun 22, 2026
Merged

fix: limit authz.MsgExec nesting depth in ante decorators and coredaos VetoProposal msg#344
giunatale merged 2 commits into
mainfrom
giunatale/msgexec-nesting-limit

Conversation

@giunatale

Copy link
Copy Markdown
Collaborator

Unbounded nesting could be potentially abused to cause slowdowns. This PR limits nesting to a depth of 8 (arbitrary constants) in 2 places (constants kept separate for cleanliness) affecting the GovSubmitProposalDecorator and GovVoteDecorator ante decorators as well as the x/coredaos VetoProposal message.

Add tests for the nesting-depth cap introduced in the previous commit:

- x/coredaos/types: direct unit tests for FlattenAnyMsgs covering flatten
  correctness and the depth boundary (8 accepted, 9 rejected).
- ante: exercise the limit through ValidateVoteMsgs, asserting the inner
  vote is reached at the limit and that one layer beyond is rejected with
  the depth error.

@tbruyelle tbruyelle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM (I've added some tests here fcd4274)

@giunatale giunatale merged commit 631ec41 into main Jun 22, 2026
14 checks passed
@giunatale giunatale deleted the giunatale/msgexec-nesting-limit branch June 22, 2026 13:41
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