Skip to content

fix(policydsl): guard against deeply nested policies#5450

Open
malsomesh9 wants to merge 1 commit into
hyperledger:mainfrom
malsomesh9:codex/fix-5304-stack-overflow
Open

fix(policydsl): guard against deeply nested policies#5450
malsomesh9 wants to merge 1 commit into
hyperledger:mainfrom
malsomesh9:codex/fix-5304-stack-overflow

Conversation

@malsomesh9
Copy link
Copy Markdown

Summary

Harden common/policydsl.FromString() against malformed policy strings that can drive the underlying expression parser into excessive recursion.

Changes

  • reject policy strings that exceed a reasonable maximum input length
  • reject policy strings whose parenthesis nesting exceeds a safe parser depth
  • add regression coverage for both guardrails

Verification

  • GOCACHE=/tmp/fabric-go-cache go test ./common/policydsl/...

Fixes #5304

Signed-off-by: malsomesh9 <malsomesh9@gmail.com>
@malsomesh9 malsomesh9 requested a review from a team as a code owner April 6, 2026 20:50
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.

stack overflow deep nesting

1 participant