GHSA-wgh7-7m3c-fx25: Scriban Denial of Service Vulnerability

HIGH
CVSS 7.5
CWE-674
Published
Advisory Summary

GHSA-wgh7-7m3c-fx25 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-674: Uncontrolled Recursion) affecting Scriban libraries in the NuGet ecosystem. The issue involves scriban has uncontrolled recursion in parser leads to stack overflow and process crash (denial of service). Remediation is available by upgrading affected packages to version 6.6.0.

GHSA-wgh7-7m3c-fx25 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-wgh7-7m3c-fx25
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-wgh7-7m3c-fx25

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: 6.6.0
Upgrade scriban to 6.6.0
Scriban.Signed fixed: 6.6.0
Upgrade Scriban.Signed to 6.6.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-wgh7-7m3c-fx25, 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 6.6.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

Scriban is vulnerable to an uncontrolled process crash resulting in a Denial of Service. Because the recursive-descent parser does not enforce a default limit on expression depth, an attacker who controls template input can craft a heavily nested template that triggers a `StackOverflowException`. In .NET, a `StackOverflowException` cannot be caught by standard `try-catch` blocks, resulting in the immediate and ungraceful termination of the entire hosting process. Scriban utilizes a recursive-descent parser to process template expressions. While the library exposes an `ExpressionDepthLimit` property in its `ParserOptions`, this property defaults to `null` (disabled). If an application accepts user-supplied templates (or dynamically constructs templates from untrusted input), an attacker can supply thousands of nested parentheses or blocks. As the parser recursively evaluates each nested layer, it consumes thread stack space until it exceeds the limits of the host OS, triggering a fatal crash. #### Impact An attacker can supply crafted input that triggers a `StackOverflowException`, causing immediate termination of the hosting process and resulting in a Denial of Service. In applications that process untrusted or user-controlled templates (e.g., web applications or APIs), this can be exploited remotely without authentication. The failure is not recoverable, requiring a full process restart and leading to service disruption. #### Proof of Concept (PoC) The following C# code demonstrates the vulnerability. Executing this code will immediately terminate the application process. ```csharp using Scriban; // Creates a deeply nested expression: (((( ... (1) ... )))) string nested = new string('(', 10000) + "1" + new string(')', 10000); try { // This will crash the entire process immediately Scriban.Template.Parse("{{ " + nested + " }}"); } catch (Exception ex) { // This catch block will never execute because StackOverflowException Console.WriteLine("Caught exception: " + ex.Message); } ``` #### Suggested Remediation Update the `ParserOptions` constructor (or the internal parser initialization) to set a default value for `ExpressionDepthLimit`. A limit of `1000` (or even lower, such as `250` or `500`) is generally more than enough for legitimate templates while safely preventing stack exhaustion. ```csharp public int? ExpressionDepthLimit { get; set; } = 250; ``` Alternatively, document the risk heavily and warn developers to manually set `ExpressionDepthLimit` if evaluating untrusted templates, though a secure-by-default approach is strongly preferred.

GHSA-wgh7-7m3c-fx25 Affected Scriban Versions

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

References

Frequently Asked Questions

What is GHSA-wgh7-7m3c-fx25?
GHSA-wgh7-7m3c-fx25 is a security vulnerability in Scriban involving Scriban has Uncontrolled Recursion in Parser Leads to Stack Overflow and Process Crash (Denial of Service) under CWE-674: Uncontrolled Recursion.
Which Scriban versions are affected?
Affected versions include releases prior to 6.6.0 across affected packages: scriban, Scriban.Signed.
What version fixes GHSA-wgh7-7m3c-fx25?
Upgrading to 6.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is scriban affected?
Yes, scriban is affected in releases prior to 6.6.0. Upgrade your dependency to 6.6.0 or later.
Is Scriban.Signed affected?
Yes, Scriban.Signed is affected in releases prior to 6.6.0. Upgrade your dependency to 6.6.0 or later.
What is the CVSS score of GHSA-wgh7-7m3c-fx25?
GHSA-wgh7-7m3c-fx25 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-wgh7-7m3c-fx25?
GHSA-wgh7-7m3c-fx25 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-wgh7-7m3c-fx25?
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-wgh7-7m3c-fx25",
  "modified" : "2026-07-06T13:06:02Z",
  "published" : "2026-03-19T21:30:54Z",
  "aliases" : [ ],
  "summary" : "Scriban has Uncontrolled Recursion in Parser Leads to Stack Overflow and Process Crash (Denial of Service)",
  "details" : "Scriban is vulnerable to an uncontrolled process crash resulting in a Denial of Service. Because the recursive-descent parser does not enforce a default limit on expression depth, an attacker who controls template input can craft a heavily nested template that triggers a `StackOverflowException`. In .NET, a `StackOverflowException` cannot be caught by standard `try-catch` blocks, resulting in the immediate and ungraceful termination of the entire hosting process. \n\nScriban utilizes a recursive-descent parser to process template expressions. While the library exposes an `ExpressionDepthLimit` property in its `ParserOptions`, this property defaults to `null` (disabled). \n\nIf an application accepts user-supplied templates (or dynamically constructs templates from untrusted input), an attacker can supply thousands of nested parentheses or blocks. As the parser recursively evaluates each nested layer, it consumes thread stack space until it exceeds the limits of the host OS, triggering a fatal crash.\n\n#### Impact\n\nAn attacker can supply crafted input that triggers a `StackOverflowException`, causing immediate termination of the hosting process and resulting in a Denial of Service. In applications that process untrusted or user-controlled templates (e.g., web applications or APIs), this can be exploited remotely without authentication. The failure is not recoverable, requiring a full process restart and leading to service disruption.\n\n#### Proof of Concept (PoC)\nThe following C# code demonstrates the vulnerability. Executing this code will immediately terminate the application process.\n\n```csharp\nusing Scriban;\n\n// Creates a deeply nested expression: (((( ... (1) ... ))))\nstring nested = new string('(', 10000) + \"1\" + new string(')', 10000);\n\ntry {\n  // This will crash the entire process immediately\n  Scriban.Template.Parse(\"{{ \" + nested + \" }}\");\n} catch (Exception ex) {\n  // This catch block will never execute because StackOverflowException\n  Console.WriteLine(\"Caught exception: \" + ex.Message);\n}\n```\n\n#### Suggested Remediation\n\nUpdate the `ParserOptions` constructor (or the internal parser initialization) to set a default value for `ExpressionDepthLimit`. A limit of `1000` (or even lower, such as `250` or `500`) is generally more than enough for legitimate templates while safely preventing stack exhaustion.\n\n```csharp\npublic int? ExpressionDepthLimit { get; set; } = 250; \n```\nAlternatively, document the risk heavily and warn developers to manually set `ExpressionDepthLimit` if evaluating untrusted templates, though a secure-by-default approach is strongly preferred.",
  "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" : "6.6.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.5.8"
    }
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "Scriban.Signed"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.6.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.5.8"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/scriban/scriban/security/advisories/GHSA-wgh7-7m3c-fx25"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/scriban/scriban/commit/a6fe6074199e5c04f4d29dc8d8e652b24d33e3e4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/scriban/scriban/commit/b5ac4bf30459fdc76964e3f751e16f7e96079ea7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/scriban/scriban"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-674" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-19T21:30:54Z",
    "nvd_published_at" : null
  }
}