CVE-2026-74787
No CISA KEV listing is included in this saved record. Exploitation may still have occurred.
FIRST EPSS: 0.49 % · percentile 42.69 % · scored 18 Nov 2026.
Saved 18 Nov 2026 15:46:44 UTC · View this risk record (JSON)
No access to your tenant or devices. Every item links to its source. What this means
Scriban before 7.0.0 contains an uncontrolled recursion vulnerability in the object.to_json builtin function that lacks depth limits and circular reference detection. Attackers can craft templates with self-referencing objects to trigger unbounded recursion, causing a StackOverflowException that fatally terminates the hosting .NET process.
Read the publisher's advisoryScriban before 7.0.0 contains an uncontrolled recursion vulnerability in the object.to_json builtin function that lacks depth limits and circular reference detection. Attackers can craft templates with self-referencing objects to trigger unbounded recursion, causing a StackOverflowException that fatally terminates the hosting .NET process.
Read the publisher's advisoryScriban before 7.0.0 contains an uncontrolled recursion vulnerability in the object.to_json builtin function that lacks depth limits and circular reference detection. Attackers can craft templates with self-referencing objects to trigger unbounded recursion, causing a StackOverflowException that fatally terminates the hosting .NET process.
Read the publisher's advisory## Summary The `object.to_json` builtin function in Scriban performs recursive JSON serialization via an internal `WriteValue()` static local function that has no depth limit, no circular reference detection, and no stack overflow guard. A Scriban template containing a self-referencing object passed to `object.to_json` triggers unbounded recursion, causing a `StackOverflowException` that terminates the hosting .NET process. This is a fatal, unrecoverable crash — `StackOverflowException` cannot be caught by user code in .NET. ## Details The vulnerable code is the `WriteValue()` static local function at `src/Scriban/Functions/ObjectFunctions.cs:494`: ```csharp static void WriteValue(TemplateContext context, Utf8JsonWriter writer, object value) { var type = value?.GetType() ?? typeof(object); if (value is null || value is string || value is bool || type.IsPrimitiveOrDecimal() || value is IFormattable) { JsonSerializer.Serialize(writer, value, type); } else if (value is IList || type.IsArray) { writer.WriteStartArray(); foreach (var x in context.ToList(context.CurrentSpan, value)) { WriteValue(context, writer, x); // recursive, no depth check } writer.WriteEndArray(); } else { writer.WriteStartObject(); var accessor = context.GetMemberAccessor(value); foreach (var member in accessor.GetMembers(context, context.CurrentSpan, value)) { if (accessor.TryGetValue(context, context.CurrentSpan, value, member, out var memberValue)) { writer.WritePropertyName(member); WriteValue(context, writer, memberValue); // recursive, no depth check } } writer.WriteEndObject(); } } ``` This function has **none** of the safety mechanisms present in other recursive paths: - `ObjectToString()` at `TemplateContext.Helpers.cs:98` checks `ObjectRecursionLimit` (default 20) - `EnterRecursive()` at `TemplateContext.cs:957` calls `RuntimeHelpers.EnsureSufficientExecutionStack()` - `CheckAbort()` at `TemplateContext.cs:464` also calls `EnsureSufficientExecutionStack()` The `WriteValue()` function bypasses all of these because it is a static local function that only takes the `TemplateContext` for member access — it never calls `EnterRecursive()`, never checks `ObjectRecursionLimit`, and never calls `EnsureSufficientExecutionStack()`. **Execution flow:** 1. Template creates a ScriptObject: `{{ x = {} }}` 2. Sets a self-reference: `x.self = x` — stores a reference in `ScriptObject.Store` dictionary 3. Pipes to `object.to_json`: `x | object.to_json` → calls `ToJson()` at line 477 4. `ToJson()` calls `WriteValue(context, writer, value)` at line 488 5. `WriteValue` enters the `else` branch (line 515), gets members via accessor, finds "self" 6. `TryGetValue` returns `x` itself, `WriteValue` recurses with the same object — infinite loop 7. `StackOverflowException` is thrown — **fatal, cannot be caught, process terminates** ## PoC ```scriban {{ x = {}; x.self = x; x | object.to_json }} ``` In a hosting application: ```csharp using Scriban; // This will crash the entire process with StackOverflowException var template = Template.Parse("{{ x = {}; x.self = x; x | object.to_json }}"); var result = template.Render(); // FATAL: process terminates here ``` Even without circular references, deeply nested objects can exhaust the stack since no depth limit is enforced: ```scriban {{ a = {} b = {inner: a} c = {inner: b} d = {inner: c} # ... continue nesting ... result = deepest | object.to_json }} ``` ## Impact - **Process crash DoS**: Any application embedding Scriban for user-provided templates (CMS platforms, email template engines, report generators, static site generators) can be crashed by a single malicious template. The crash is unrecoverable — `StackOverflowException` terminates the .NET process. - **No try/catch protection possible**: Unlike most exceptions, `StackOverflowException` cannot be caught by application code. The hosting application cannot wrap `template.Render()` in a try/catch to survive this. - **No authentication required**: `object.to_json` is a default builtin function (registered in `BuiltinFunctions.cs`), available in all Scriban templates unless explicitly removed. - **Trivial to exploit**: The PoC is a single line of template code. ## Recommended Fix Add a depth counter parameter to `WriteValue()` and check it against `ObjectRecursionLimit`, consistent with how `ObjectToString` is protected. Also add `EnsureSufficientExecutionStack()` as a safety net: ```csharp static void WriteValue(TemplateContext context, Utf8JsonWriter writer, object value, int depth = 0) { if (context.ObjectRecursionLimit != 0 && depth > context.ObjectRecursionLimit) { throw new ScriptRuntimeException(context.CurrentSpan, $"Exceeding object recursion limit `{context.ObjectRecursionLimit}` in object.to_json"); } try { RuntimeHelpers.EnsureSufficientExecutionStack(); } catch (InsufficientExecutionStackException) { throw new ScriptRuntimeException(context.CurrentSpan, "Exceeding recursive depth limit in object.to_json, near to stack overflow"); } var type = value?.GetType() ?? typeof(object); if (value is null || value is string || value is bool || type.IsPrimitiveOrDecimal() || value is IFormattable) { JsonSerializer.Serialize(writer, value, type); } else if (value is IList || type.IsArray) { writer.WriteStartArray(); foreach (var x in context.ToList(context.CurrentSpan, value)) { WriteValue(context, writer, x, depth + 1); } writer.WriteEndArray(); } else { writer.WriteStartObject(); var accessor = context.GetMemberAccessor(value); foreach (var member in accessor.GetMembers(context, context.CurrentSpan, value)) { if (accessor.TryGetValue(context, context.CurrentSpan, value, member, out var memberValue)) { writer.WritePropertyName(member); WriteValue(context, writer, memberValue, depth + 1); } } writer.WriteEndObject(); } } ```
Read the publisher's advisoryCISA KEV lists vulnerabilities known to be exploited. FIRST EPSS estimates the likelihood of exploitation in the next 30 days. An unavailable score does not mean zero risk.
This view includes predictions for CVE identifiers explicitly listed in public NuGet advisories. Microsoft release pages have their own prediction coverage. Check source status for the scope and latest checks.
No CISA KEV listing is included in this saved record. Exploitation may still have occurred.
FIRST EPSS: 0.49 % · percentile 42.69 % · scored 18 Nov 2026.
Saved 18 Nov 2026 15:46:44 UTC · View this risk record (JSON)
Compare earlier KEV listings and EPSS scores. Advisory wording and affected versions have a separate history.
A prediction change is reported when EPSS rises from below 10% to 10% or higher. Every daily score change from the last 30 days stays in this history. Before that, it keeps KEV changes and moves between EPSS bands (0.1%, 1%, 5%, 10%, 20%, 50% and 90%).
CVE-2026-74787 · 18 Nov 2026 15:46:44 UTC
CVE-2026-74787 · 17 Nov 2026 15:26:11 UTC
CVE-2026-74787 · 17 Nov 2026 02:39:16 UTC
CVE-2026-74787 · 15 Nov 2026 14:45:34 UTC
CVE-2026-74787 · 14 Nov 2026 16:37:01 UTC
CVE-2026-74787 · 13 Nov 2026 19:59:34 UTC
CVE-2026-74787 · 12 Nov 2026 18:18:51 UTC
CVE-2026-74787 · 10 Nov 2026 20:24:10 UTC
CVE-2026-74787 · 09 Nov 2026 21:04:24 UTC
CVE-2026-74787 · 08 Nov 2026 15:12:21 UTC
CVE-2026-74787 · 07 Nov 2026 16:07:52 UTC
CVE-2026-74787 · 06 Nov 2026 19:10:17 UTC
CVE-2026-74787 · 05 Nov 2026 22:49:22 UTC
CVE-2026-74787 · 05 Nov 2026 02:54:06 UTC
CVE-2026-74787 · 03 Nov 2026 16:59:18 UTC
CVE-2026-74787 · 02 Nov 2026 23:59:04 UTC
CVE-2026-74787 · 01 Nov 2026 23:58:58 UTC
CVE-2026-74787 · 01 Nov 2026 03:04:52 UTC
CVE-2026-74787 · 31 Oct 2026 01:52:30 UTC
CVE-2026-74787 · 29 Oct 2026 18:29:26 UTC
CVE-2026-74787 · 28 Oct 2026 19:55:37 UTC
CVE-2026-74787 · 27 Oct 2026 15:46:19 UTC
CVE-2026-74787 · 27 Oct 2026 00:23:05 UTC
CVE-2026-74787 · 25 Oct 2026 15:18:41 UTC
See how the publisher's advisory changed over time. Each link opens the version saved at that time. The publisher's update date can differ from the date shown here.
Each link identifies one complete publisher record. History can include advisories that previously shared an identifier; an identifier removed by a publisher no longer establishes a current relationship. A historical link shows only that record and earlier saved versions. Failed checks and unchanged reads do not create new versions.
euvd · EUVD-2026-59953 · Published
euvd · EUVD-2026-59953 · Published
euvd · EUVD-2026-59953 · Published
euvd · EUVD-2026-59953 · Published
euvd · EUVD-2026-59953 · Published
euvd · EUVD-2026-59953 · Published
euvd · EUVD-2026-59953 · Published
euvd · EUVD-2026-59953 · Published
euvd · EUVD-2026-59953 · Published
euvd · EUVD-2026-59953 · Published
euvd · EUVD-2026-59953 · Published
nvd · CVE-2026-74787 · Published
osv · GHSA-xcx6-vp38-8hr5 · Published
cve-program · CVE-2026-74787 · Published