Scriban has a Stack Overflow via Nested Array Initializers That Bypass the ExpressionDepthLimit Fix
### Summary StackOverflowException via nested array initializers bypasses ExpressionDepthLimit fix (GHSA-wgh7-7m3c-fx25) ### Details The recent fix for GHSA-wgh7-7m3c-fx25 (uncontrolled recursion in parser) added `ExpressionDepthLimit` defaulting to 250. However, deeply nested **array initializers** (`[[[[...`) recurse through `ParseArrayInitializer` → `ParseExpression` → `ParseArrayInitializer`, which is a **different recursion path** not covered by the expression depth counter. This causes a `StackOverflowException` on current main (commit b5ac4bf - "Add limits for default safety"). ### PoC ``` using Scriban; // ExpressionDepthLimit (default 250) does NOT prevent this crash string nested = "{{ " + new string('[', 5000) + "1" + new string(']', 5000) + " }}"; Template.Parse(nested); // StackOverflowException - process terminates ``` ### Impact Same as GHSA-wgh7-7m3c-fx25: High severity. StackOverflowException cannot be caught with try/catch in .NET - the process terminates immediately. Any application calling Template.Parse with untrusted input is vulnerable, even with the new default ExpressionDepthLimit enabled.
AI Analysis
Technical Summary
The vulnerability in Scriban involves a StackOverflowException triggered by deeply nested array initializers that circumvent the ExpressionDepthLimit fix introduced in a previous advisory (GHSA-wgh7-7m3c-fx25). While the ExpressionDepthLimit limits recursion depth for expressions, nested array initializers recurse via a different code path (ParseArrayInitializer → ParseExpression → ParseArrayInitializer) that is not accounted for by this limit. This results in a stack overflow when parsing templates with excessive nested arrays, causing the .NET process to terminate abruptly. The vulnerability affects Scriban versions before 7.0.0 and poses a high severity risk due to denial of service via process termination.
Potential Impact
The impact is a denial of service condition where the Scriban template parser crashes with a StackOverflowException when processing deeply nested array initializers. Because StackOverflowException cannot be caught in .NET, the entire process terminates immediately. Applications that parse untrusted input using vulnerable Scriban versions are at risk of unexpected termination, potentially disrupting service availability.
Mitigation Recommendations
No official patch or fix is currently available for this vulnerability. Users should avoid parsing untrusted input containing deeply nested array initializers with affected Scriban versions (<7.0.0). Monitor the vendor advisory for updates on remediation. Since this is not a cloud service, remediation depends on upgrading Scriban when a fix is released.
Scriban has a Stack Overflow via Nested Array Initializers That Bypass the ExpressionDepthLimit Fix
Description
### Summary StackOverflowException via nested array initializers bypasses ExpressionDepthLimit fix (GHSA-wgh7-7m3c-fx25) ### Details The recent fix for GHSA-wgh7-7m3c-fx25 (uncontrolled recursion in parser) added `ExpressionDepthLimit` defaulting to 250. However, deeply nested **array initializers** (`[[[[...`) recurse through `ParseArrayInitializer` → `ParseExpression` → `ParseArrayInitializer`, which is a **different recursion path** not covered by the expression depth counter. This causes a `StackOverflowException` on current main (commit b5ac4bf - "Add limits for default safety"). ### PoC ``` using Scriban; // ExpressionDepthLimit (default 250) does NOT prevent this crash string nested = "{{ " + new string('[', 5000) + "1" + new string(']', 5000) + " }}"; Template.Parse(nested); // StackOverflowException - process terminates ``` ### Impact Same as GHSA-wgh7-7m3c-fx25: High severity. StackOverflowException cannot be caught with try/catch in .NET - the process terminates immediately. Any application calling Template.Parse with untrusted input is vulnerable, even with the new default ExpressionDepthLimit enabled.
CVSS v3.1
Score 7.5high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Scriban involves a StackOverflowException triggered by deeply nested array initializers that circumvent the ExpressionDepthLimit fix introduced in a previous advisory (GHSA-wgh7-7m3c-fx25). While the ExpressionDepthLimit limits recursion depth for expressions, nested array initializers recurse via a different code path (ParseArrayInitializer → ParseExpression → ParseArrayInitializer) that is not accounted for by this limit. This results in a stack overflow when parsing templates with excessive nested arrays, causing the .NET process to terminate abruptly. The vulnerability affects Scriban versions before 7.0.0 and poses a high severity risk due to denial of service via process termination.
Potential Impact
The impact is a denial of service condition where the Scriban template parser crashes with a StackOverflowException when processing deeply nested array initializers. Because StackOverflowException cannot be caught in .NET, the entire process terminates immediately. Applications that parse untrusted input using vulnerable Scriban versions are at risk of unexpected termination, potentially disrupting service availability.
Mitigation Recommendations
No official patch or fix is currently available for this vulnerability. Users should avoid parsing untrusted input containing deeply nested array initializers with affected Scriban versions (<7.0.0). Monitor the vendor advisory for updates on remediation. Since this is not a cloud service, remediation depends on upgrading Scriban when a fix is released.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-p6q4-fgr8-vx4p
- Osv Schema Version
- 1.4.0
- Aliases
- []
- Ecosystems
- ["NuGet"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a4c346127e9c79719600adf
Added to database: 07/06/2026, 23:04:01 UTC
Last enriched: 07/06/2026, 23:33:55 UTC
Last updated: 07/31/2026, 12:27:30 UTC
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.