Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
.NET
.NET NuGet
Not in CISA KEV
MEDIUM severity

GHSA-5rpf-x9jg-8j5p scriban

MEDIUMFix: scriban/scriban@a6fe607

GHSA-5rpf-x9jg-8j5p is a medium-severity (CVSS 5.3) vulnerability in scriban. A fix is available for scriban — see the affected versions and patch details below.

Scriban Affected by Memory Exhaustion (OOM) via Unbounded String Generation (Denial of Service)

Published
Mar 19, 2026
Updated
Jul 6, 2026
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed
Exploitation data as of Jul 6, 2026 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

2 pkgs affected
.NETscriban.NETScriban.Signed

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects NuGet packages — download data is not available via public APIs for these ecosystems.

Description

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.

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

public int LimitToString { get; set; } = 1048576; 

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
.NETNuGetscribanall versions6.6.0dotnet add package scriban --version 6.6.0
.NETNuGetScriban.Signedall versions6.6.0dotnet add package Scriban.Signed --version 6.6.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for scriban, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update scriban to 6.6.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-5rpf-x9jg-8j5p is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-5rpf-x9jg-8j5p can be triaged on real exposure rather than presence alone.

Tailored to GHSA-5rpf-x9jg-8j5p. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

`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
O3 Security · Impact-Aware SCA

Is GHSA-5rpf-x9jg-8j5p in your dependencies?

O3 Security finds GHSA-5rpf-x9jg-8j5p across NuGet dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-5rpf-x9jg-8j5p: scriban (Medium 5.3) | O3 Security