Loading...
Skip to main content

CVE-2026-74794 — Vulnerability in scriban — CVE Details

HIGH

Scriban has an Infinite Recursion during Object Rendering Leads to Stack Overflow and Process Crash (Denial of Service)

Published March 19, 2026Updated August 17, 2026Source: osv

Summary

When Scriban renders an object that contains a circular reference, it traverses the object's members infinitely. Because the `ObjectRecursionLimit` property defaults to unlimited, this behavior exhausts the thread's stack space, triggering an uncatchable `StackOverflowException` that immediately terminates the hosting process. When rendering objects (e.g., `{{ obj }}`), the Scriban rendering engine recursively inspects and formats the object's properties. To prevent infinite loops caused by deeply nested or circular data structures, `TemplateContext` contains an `ObjectRecursionLimit` property. However, this property currently defaults to `0` (unlimited). If the data context pushed into the template contains a circular reference, the renderer will recurse indefinitely. This is especially dangerous for web applications that map user-controlled payloads (like JSON) directly to rendering contexts, or for applications that pass ORM objects (like Entity Framework models, which frequently contain circular navigation properties) into the template. #### Proof of Concept (PoC) The following C# code demonstrates the vulnerability. Executing this will cause an immediate, fatal `StackOverflowException`, bypassing any standard error handling. ```csharp using Scriban; using Scriban.Runtime; var template = Template.Parse("{{ a }}"); var context = new TemplateContext(); var a = new ScriptObject(); // Introduce a cycle a["self"] = a; context.PushGlobal(new ScriptObject { { "a", a } }); try { // This crashes the entire process immediately template.Render(context); } catch (Exception ex) { // This will never execute because StackOverflowException Console.WriteLine("Caught exception: " + ex.Message); } ``` #### Impact This vulnerability allows a Denial of Service (DoS) attack. If a malicious user can manipulate the data structure passed to the renderer to include a cyclic reference, or if the application passes a complex object graph to an untrusted template, the entire .NET hosting process will crash. #### Suggested Remediation Update `TemplateContext.cs` to set `ObjectRecursionLimit` to a safe default, such as `20`. ```csharp public int ObjectRecursionLimit { get; set; } = 20; ``` By implementing this default, circular references will gracefully result in a catchable `ScriptRuntimeException` rather than a fatal process crash.

Advisory Timeline

  • First published March 19, 2026 (207 days ago).
  • Last revised August 17, 2026 — 150 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

NuGet
Update scriban to 6.6.0 or later
dotnet add package scriban --version 6.6.0
NuGet
Update Scriban.Signed to 6.6.0 or later
dotnet add package Scriban.Signed --version 6.6.0

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: nuget (2).

PackageEcosystemAffectedFixed In
scriban
nuget
0.1.0, 0.10.0, 0.11.0, 0.12.0 (+118 more)6.6.0
Scriban.Signed
nuget
0.10.0, 0.11.0, 0.12.0, 0.12.1 (+106 more)6.6.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Frequently Asked Questions

What is CVE-2026-74794?
Scriban has an Infinite Recursion during Object Rendering Leads to Stack Overflow and Process Crash (Denial of Service) This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2026-74794?
CVE-2026-74794 affects scriban and Scriban.Signed. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-74794 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-grr9-747v-xvcp

Related CVEs

  • CVE-2026-74789
    HIGH

    Scriban: Built-in operations bypass LoopLimit and delay cancellation, enabling Denial of Service

  • CVE-2026-74792
    HIGH

    Scriban has a Stack Overflow via Nested Array Initializers That Bypass the ExpressionDepthLimit Fix

  • CVE-2026-74788
    HIGH

    Scriban: Uncontrolled Memory Allocation via string.pad_left/pad_right Allows Remote Denial of Service

  • CVE-2026-74795
    HIGH

    Scriban has Uncontrolled Recursion in Parser Leads to Stack Overflow and Process Crash (Denial of Service)

  • CVE-2026-74791
    HIGH

    Scriban has an authorization bypass due to stale include cache surviving TemplateContext.Reset()

  • CVE-2026-74787
    HIGH

    Scriban has Uncontrolled Recursion in `object.to_json` Causing Unrecoverable Process Crash via StackOverflowException

  • CVE-2026-74786
    MEDIUM

    Scriban: Denial of Service via Unbounded Cumulative Template Output Bypassing LimitToString

  • CVE-2026-73062
    MEDIUM

    Scriban: array * int (ScriptArray<T>.TryEvaluate) bypasses LoopLimit — incomplete fix for GHSA-c875-h985-hvrc, missed sibling of GHSA-24c8-4792-22hx

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies