GHSA-p6q4-fgr8-vx4p: Scriban Scriban Has A Stack Overflow Vulnerability

HIGH
CVSS 7.5
CWE-674
Published
Advisory Summary

GHSA-p6q4-fgr8-vx4p is a HIGH (CVSS 7.5) scriban has a stack overflow vulnerability (CWE-674: Uncontrolled Recursion) affecting Scriban libraries in the NuGet ecosystem. The issue involves scriban has a stack overflow via nested array initializers that bypass the expressiondepthlimit fix. Remediation is available by upgrading affected packages to version 7.0.0.

GHSA-p6q4-fgr8-vx4p at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-p6q4-fgr8-vx4p
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-674: Uncontrolled Recursion
Affected Product Scriban
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix GHSA-p6q4-fgr8-vx4p

To remediate this vulnerability, upgrade all affected Scriban dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

Scriban fixed: 7.0.0
Upgrade Scriban to 7.0.0
Scriban.Signed fixed: 7.0.0
Upgrade Scriban.Signed to 7.0.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for Scriban

How to Check if You Are Affected

To determine whether your application is affected by GHSA-p6q4-fgr8-vx4p, inspect your project dependencies for Scriban:

inspect dependencies for Scriban

Analyze the terminal output to locate any version of Scriban in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.0.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-674: Uncontrolled Recursion, where the product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack. In Scriban, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

GHSA-p6q4-fgr8-vx4p Affected Scriban Versions

2 component(s)
Fixed Versions:
7.0.0
Product / Package Ecosystem Affected Versions Fixed Version
Scriban
NuGet
< 7.0.0
7.0.0
Scriban.Signed
NuGet
< 7.0.0
7.0.0

References

Frequently Asked Questions

What is GHSA-p6q4-fgr8-vx4p?
GHSA-p6q4-fgr8-vx4p is a security vulnerability in Scriban involving Scriban has a Stack Overflow via Nested Array Initializers That Bypass the ExpressionDepthLimit Fix under CWE-674: Uncontrolled Recursion.
Which Scriban versions are affected?
Affected versions include releases prior to 7.0.0 across affected packages: Scriban, Scriban.Signed.
What version fixes GHSA-p6q4-fgr8-vx4p?
Upgrading to 7.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Scriban affected?
Yes, Scriban is affected in releases prior to 7.0.0. Upgrade your dependency to 7.0.0 or later.
Is Scriban.Signed affected?
Yes, Scriban.Signed is affected in releases prior to 7.0.0. Upgrade your dependency to 7.0.0 or later.
What is the CVSS score of GHSA-p6q4-fgr8-vx4p?
GHSA-p6q4-fgr8-vx4p has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with GHSA-p6q4-fgr8-vx4p?
GHSA-p6q4-fgr8-vx4p is classified under CWE-674: Uncontrolled Recursion (The product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.).
How can I check NuGet dependencies for GHSA-p6q4-fgr8-vx4p?
Run the dependency tree command: 'inspect dependencies for Scriban'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-p6q4-fgr8-vx4p",
  "modified" : "2026-07-06T13:07:26Z",
  "published" : "2026-03-24T22:06:24Z",
  "aliases" : [ ],
  "summary" : "Scriban has a Stack Overflow via Nested Array Initializers That Bypass the ExpressionDepthLimit Fix",
  "details" : "### Summary\nStackOverflowException via nested array initializers bypasses ExpressionDepthLimit fix (GHSA-wgh7-7m3c-fx25)\n\n### Details\nThe 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.\n\nThis causes a `StackOverflowException` on current main (commit b5ac4bf - \"Add limits for default safety\").\n\n### PoC\n```\nusing Scriban;\n\n// ExpressionDepthLimit (default 250) does NOT prevent this crash\nstring nested = \"{{ \" + new string('[', 5000) + \"1\" + new string(']', 5000) + \" }}\";\nTemplate.Parse(nested); // StackOverflowException - process terminates\n```\n\n### Impact\nSame 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Scriban"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.0.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Scriban.Signed"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/scriban/scriban/security/advisories/GHSA-p6q4-fgr8-vx4p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-wgh7-7m3c-fx25"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/scriban/scriban"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-674" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-24T22:06:24Z",
    "nvd_published_at" : null
  }
}