netliomax25-code opened a new pull request, #2711:
URL: https://github.com/apache/groovy/pull/2711

   1. MarkdownSlurper walks the parsed CommonMark tree recursively 
(blocksToList/nodeToMap, and textOf/appendText) with one stack frame per 
nesting level and no depth bound.
   2. CommonMark builds that tree iteratively, so a small but deeply nested 
document (a single ~8 KB line of nested block quotes, or a deeply nested list) 
overflows the walk and raises a StackOverflowError inside parse()/parseText(). 
That raw Error escapes the documented MarkdownRuntimeException that callers 
guarding untrusted input catch.
   3. Added a configurable cap (maxNestingDepth, default 1000, property 
groovy.markdown.maxNestingDepth) checked once before the walk, throwing 
MarkdownRuntimeException past the limit, matching the nesting cap JsonSlurper 
already applies.
   
   Validation: a 5000-deep block-quote input now throws 
MarkdownRuntimeException instead of overflowing, documents within the limit 
parse unchanged, and the added regression tests plus the existing 
MarkdownSlurper suite pass.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to