Scriban ExpressionDepthLimit bypass leads to StackOverflowException
The ExpressionDepthLimit parser guard in Scriban does not halt recursion; it only logs a non-fatal error.
What changed
The ExpressionDepthLimit parser guard in Scriban does not halt recursion; it only logs a non-fatal error. This allows deeply nested expressions to cause an uncatchable StackOverflowException, leading to process termination. All versions 6.6.0 through 7.2.0 are affected.
Who it affects
Any application that parses attacker-influenced templates or passes attacker-controlled strings to object.eval/object.eval_template.
What to do today
Apply the suggested remediation: make the limit actually stop descent by throwing a parse exception or logging with isFatal:true and unwinding. As defense in depth, call RuntimeHelpers.EnsureSufficientExecutionStack() at ParseExpression entry.