GHSA-5rpf-x9jg-8j5p: Scriban Denial of Service Vulnerability

MODERATE
CVSS 5.3
CWE-770
Published
Advisory Summary

GHSA-5rpf-x9jg-8j5p is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Scriban libraries in the NuGet ecosystem. The issue involves scriban affected by memory exhaustion (oom) via unbounded string generation (denial of service). Remediation is available by upgrading affected packages to version 6.6.0.

GHSA-5rpf-x9jg-8j5p at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-5rpf-x9jg-8j5p
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Scriban
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:L).

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 Low (A:L)

How to Fix GHSA-5rpf-x9jg-8j5p

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-5rpf-x9jg-8j5p, 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. 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

`TemplateContext.LimitToString` defaults to `0` (unlimited). While Scriban implements a default `LoopLimit` of 1000, an attacker can still cause massive memory allocation via exponential string growth. Doubling a string for just 30 iterations generates over 1GB of text, instantly exhausting heap memory and crashing the host process. Because no output size limit is enforced, repeated string concatenation results in exponential memory growth. **Proof of Concept (PoC):** The following payload executes in under 30 iterations but results in ~1GB string allocation, crashing the process. ```csharp using Scriban; string maliciousTemplate = @" {{ a = ""A"" for i in 1..30 a = a + a end a }}"; var template = Template.Parse(maliciousTemplate); var context = new TemplateContext(); try { template.Render(context); } catch (Exception ex) { Console.WriteLine("\nException: " + ex.Message); } ``` **Impact:** An attacker can supply a small template that triggers exponential string growth, forcing the application to allocate excessive memory. This leads to severe memory pressure, garbage collection thrashing, and eventual process termination (DoS). **Suggested Fix:** Enforce a sensible default limit for string output. Set default `LimitToString` to 1MB (1,048,576 characters). ```csharp public int LimitToString { get; set; } = 1048576; ```

GHSA-5rpf-x9jg-8j5p 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-5rpf-x9jg-8j5p?
GHSA-5rpf-x9jg-8j5p is a security vulnerability in Scriban involving Scriban Affected by Memory Exhaustion (OOM) via Unbounded String Generation (Denial of Service) under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Scriban versions are affected?
Affected versions include releases prior to 6.6.0 across affected packages: scriban, Scriban.Signed.
What version fixes GHSA-5rpf-x9jg-8j5p?
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-5rpf-x9jg-8j5p?
GHSA-5rpf-x9jg-8j5p has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with GHSA-5rpf-x9jg-8j5p?
GHSA-5rpf-x9jg-8j5p is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check NuGet dependencies for GHSA-5rpf-x9jg-8j5p?
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-5rpf-x9jg-8j5p",
  "modified" : "2026-07-06T13:06:49Z",
  "published" : "2026-03-19T21:31:10Z",
  "aliases" : [ ],
  "summary" : "Scriban Affected by Memory Exhaustion (OOM) via Unbounded String Generation (Denial of Service)",
  "details" : "`TemplateContext.LimitToString` defaults to `0` (unlimited). While Scriban implements a default `LoopLimit` of 1000, an attacker can still cause massive memory allocation via exponential string growth. Doubling a string for just 30 iterations generates over 1GB of text, instantly exhausting heap memory and crashing the host process. Because no output size limit is enforced, repeated string concatenation results in exponential memory growth.\n\n**Proof of Concept (PoC):**\nThe following payload executes in under 30 iterations but results in ~1GB string allocation, crashing the process.\n\n```csharp\nusing Scriban;\n\nstring maliciousTemplate =\n    @\"\n        {{\n            a = \"\"A\"\"\n            for i in 1..30\n                a = a + a\n            end\n            a\n        }}\";\n\nvar template = Template.Parse(maliciousTemplate);\n\nvar context = new TemplateContext();\n\ntry\n{\n    template.Render(context);\n}\ncatch (Exception ex)\n{\n    Console.WriteLine(\"\\nException: \" + ex.Message);\n}\n```\n\n**Impact:**\nAn attacker can supply a small template that triggers exponential string growth, forcing the application to allocate excessive memory. This leads to severe memory pressure, garbage collection thrashing, and eventual process termination (DoS).\n\n**Suggested Fix:**\nEnforce a sensible default limit for string output. Set default `LimitToString` to 1MB (1,048,576 characters). \n\n```csharp\npublic int LimitToString { get; set; } = 1048576; \n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "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-5rpf-x9jg-8j5p"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/scriban/scriban/commit/a6fe6074199e5c04f4d29dc8d8e652b24d33e3e4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/scriban/scriban"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-19T21:31:10Z",
    "nvd_published_at" : null
  }
}