Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

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

0
High
Published: 03/19/2026 (03/19/2026, 21:31:01 UTC)
Source: GCVE Database
Product: scriban

Description

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.

CVSS v3.1

Score 7.5high

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

Affected software

NuGetghsa
scriban
Affected versions
<6.6.0
NuGetghsa
Scriban.Signed
Affected versions
<6.6.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/06/2026, 23:34:09 UTC

Technical Analysis

Scriban's template rendering engine recursively inspects object properties when rendering. If an object contains circular references, the renderer enters infinite recursion because the ObjectRecursionLimit property defaults to 0 (unlimited). This causes a StackOverflowException that immediately terminates the hosting .NET process, bypassing error handling. The vulnerability affects Scriban versions before 6.6.0. The recommended remediation is to set ObjectRecursionLimit to a safe default (e.g., 20) to cause a catchable exception instead of a fatal crash.

Potential Impact

An attacker who can supply or influence the data passed to Scriban's rendering context can cause the hosting process to crash via a stack overflow. This results in a denial of service condition. There is no impact on confidentiality or integrity, only availability is affected.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The suggested remediation is to update the TemplateContext to set ObjectRecursionLimit to a safe default such as 20. This change prevents infinite recursion by throwing a catchable exception instead of crashing the process. Until a patch is available, avoid passing untrusted or user-controlled data structures with potential circular references to the Scriban renderer.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-grr9-747v-xvcp
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["NuGet"]
Database Specific Severity
HIGH
Cvss Version
3.1

Threat ID: 6a4c346127e9c79719600aea

Added to database: 07/06/2026, 23:04:01 UTC

Last enriched: 07/06/2026, 23:34:09 UTC

Last updated: 07/31/2026, 12:27:30 UTC

Views: 13

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses