CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-GRR9-747V-XVCP

GHSA-GRR9-747V-XVCP: Uncontrolled Recursion in Scriban Templates Leads to Denial of Service

Alon Barad
Alon Barad
Software Engineer

Mar 20, 2026·6 min read·61 visits

Executive Summary (TL;DR)

A denial-of-service vulnerability exists in the Scriban .NET templating engine due to missing depth limits for nested expressions and object traversal. Attackers can trigger an uncatchable StackOverflowException, immediately terminating the host process. Mitigation requires updating the package or manually configuring recursion limits.

Scriban, a .NET text templating engine, is vulnerable to a high-severity denial-of-service (DoS) flaw due to uncontrolled recursion during template parsing and object rendering. The lack of default depth boundaries allows maliciously crafted templates or objects with circular references to exhaust the call stack, causing an unrecoverable process crash.

Vulnerability Overview

Scriban is a fast, powerful text templating engine for .NET applications, frequently used for dynamic content generation, email rendering, and code generation. GHSA-GRR9-747V-XVCP identifies a high-severity vulnerability within the engine's core processing logic that allows for unauthenticated denial-of-service (DoS) attacks.

The vulnerability is classified as Uncontrolled Recursion (CWE-674) and Uncontrolled Resource Consumption (CWE-400). It manifests in two distinct phases of the engine's lifecycle: the parsing of the template structure and the rendering of the provided data model. In both cases, the engine fails to enforce bounds on the depth of the operations.

Because the underlying platform is .NET, exhausting the call stack results in a StackOverflowException. Unlike standard exceptions, a stack overflow in modern .NET environments is unrecoverable and immediately terminates the process, making this an effective and highly disruptive attack vector against applications relying on Scriban.

Root Cause Analysis

The root cause of this vulnerability lies in the "unlimited by default" configuration design of the Scriban engine. The engine exposes limits for parsing and rendering, but prior to the patch, these bounds were either disabled or absent by default, shifting the burden of safety entirely onto the implementing developer.

During the rendering phase, the TemplateContext object is responsible for managing the state and traversal of the data model. The property ObjectRecursionLimit was historically initialized to 0, which the engine interpreted as an instruction to perform boundless recursion. If the object graph contains a circular reference, the engine traverses it infinitely until thread stack space is entirely consumed.

During the parsing phase, the abstract syntax tree (AST) generation is governed by the ParserOptions class. The ExpressionDepthLimit property was set to null by default. This permitted the parser to accept and process templates containing extreme levels of syntactic nesting, such as thousands of nested parenthetical expressions, leading to call stack exhaustion before the rendering phase even begins.

Code Analysis & Patch Review

The remediation introduced in commit a6fe6074199e5c04f4d29dc8d8e652b24d33e3e4 addresses the vulnerability by enforcing safe, finite default limits across both affected code paths. The fix fundamentally alters the default state of the engine to prioritize resilience over unbounded processing.

// Vulnerable State (Conceptual)
public class TemplateContext {
    public int ObjectRecursionLimit { get; set; } = 0; // 0 = Unlimited
}
 
public class ParserOptions {
    public int? ExpressionDepthLimit { get; set; } = null; // null = Unlimited
}

The patched version establishes hardcoded default limits. The ObjectRecursionLimit is now defaulted to 20, ensuring that rendering traversal will abort safely if an object graph is exceptionally deep or circular. Similarly, the ExpressionDepthLimit is defaulted to 250, preventing AST parsing from spiraling out of control.

// Patched State (Conceptual)
public class TemplateContext {
    public int ObjectRecursionLimit { get; set; } = 20;
}
 
public class ParserOptions {
    public int? ExpressionDepthLimit { get; set; } = 250;
}

Crucially, when these new limits are exceeded, the engine explicitly halts processing and throws a ScriptRuntimeException. This is a standard managed exception that can be caught by the host application's error handling logic, preventing the fatal process crash.

Exploitation & Attack Methodology

Exploitation requires no specialized tooling and relies solely on the ability to provide input that the target application processes using the Scriban engine. The attack is highly deterministic and consistently results in a denial-of-service condition.

The parsing vector involves injecting a maliciously crafted template string. An attacker can construct a payload containing hundreds or thousands of nested structures. A simple example involves deeply nested parentheses: {{ (((...))) }}. When the application invokes the template parsing logic, the recursive descent parser exhausts the call stack attempting to evaluate the nested nodes.

The rendering vector involves manipulating the data model passed to the engine. If the application serializes user-controlled data into an object that is subsequently rendered, the attacker can establish a self-referencing relationship. For example, creating an entity where ObjectA.Child = ObjectA. When Template.Render(context) is called, the renderer attempts to resolve the infinite loop.

Impact Assessment

The vulnerability directly compromises the availability of the application hosting the Scriban engine. The estimated CVSS v3.1 base score is 7.5, reflecting a network-based attack with low complexity, no required privileges, and a high impact on availability (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

The consequence of a StackOverflowException in the .NET Common Language Runtime (CLR) is severe. The runtime considers stack corruption to be an unrecoverable state, meaning standard try/catch blocks surrounding the Scriban rendering logic will be completely bypassed. The operating system immediately terminates the application process.

In a production environment, this translates to the complete outage of the affected service. For web applications, the application pool or worker process will crash, dropping all current connections and requiring a restart. In a distributed architecture, repeated exploitation will cause continuous health check failures, leading load balancers or container orchestrators to perpetually cycle the service, resulting in extended downtime.

Remediation & Mitigation

The most effective and comprehensive remediation is to update the Scriban NuGet package to the latest version published after March 2026, which includes the fix commit a6fe6074199e5c04f4d29dc8d8e652b24d33e3e4. The updated version safely handles deeply nested expressions and circular references by throwing manageable exceptions rather than crashing.

If an immediate upgrade is not feasible, developers must manually enforce the depth limits within their application code. This workaround exactly mirrors the logic introduced in the official patch and provides immediate protection against the vulnerability.

To apply the mitigation, the ObjectRecursionLimit must be set on every instantiated TemplateContext, and the ExpressionDepthLimit must be explicitly defined in the ParserOptions. Developers should ensure these limits are applied globally wherever the Scriban engine is initialized in the codebase.

Fix Analysis (1)

Technical Appendix

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

Affected Systems

Scriban .NET Templating EngineAny .NET application utilizing vulnerable versions of the Scriban NuGet package

Affected Versions Detail

Product
Affected Versions
Fixed Version
Scriban
Scriban Contributors
All versions prior to the March 2026 fix-
AttributeDetail
Vulnerability ClassUncontrolled Recursion (CWE-674)
Secondary ClassUncontrolled Resource Consumption (CWE-400)
Attack VectorNetwork
CVSS v3.1 Base Score7.5 (High)
ImpactDenial of Service (Process Crash)
Exploit StatusProof of Concept available
Privileges RequiredNone

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
T1190Exploit Public-Facing Application
Initial Access
CWE-674
Uncontrolled Recursion

The program does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.

Vulnerability Timeline

Patch Committed to Scriban Repository
2026-03-19
Security Advisory GHSA-GRR9-747V-XVCP Published
2026-03-20

References & Sources

  • [1]GitHub Advisory: GHSA-GRR9-747V-XVCP
  • [2]Official Scriban Repository
  • [3]Fix Commit (a6fe6074199e5c04f4d29dc8d8e652b24d33e3e4)

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 15 hours ago•GHSA-H5X8-XP6M-X6Q4
7.1

GHSA-H5X8-XP6M-X6Q4: Unvalidated Signature Generation in @jhb.software/payload-cloudinary-plugin

The @jhb.software/payload-cloudinary-plugin exposes an endpoint that performs unvalidated cryptographic signing of Cloudinary API parameters, allowing authenticated users with minimal privileges to forge valid signatures for arbitrary actions. This flaw allows attackers to overwrite remote storage assets, execute unauthorized file uploads, alter asset visibility parameters, trigger SSRF webhooks, and perform directory traversal within Cloudinary repositories.

Alon Barad
Alon Barad
3 views•6 min read
•about 15 hours ago•GHSA-G2GW-Q38M-VJFC
8.7

GHSA-G2GW-Q38M-VJFC: Server-Side Request Forgery and Bearer Token Exfiltration in @merill/lokka

A Server-Side Request Forgery (SSRF) and Bearer Token Exfiltration vulnerability exists in the @merill/lokka (Lokka) Model Context Protocol (MCP) server prior to version 2.1.2. The server constructed Azure Resource Manager request URLs by concatenating user-controlled path parameters directly into destination request strings. By injecting authority-redefinition characters, an attacker can manipulate URL parsing to execute a host-escape attack, forcing the server to send high-privilege Azure Resource Manager (ARM) Bearer tokens to an external attacker-controlled host. This allows complete administrative access to the associated Azure subscriptions.

Alon Barad
Alon Barad
6 views•7 min read
•about 17 hours ago•GHSA-4XGF-CPJX-PC3J
5.3

GHSA-4xgf-cpjx-pc3j: Directory Traversal and Symlink Following in Pydantic Settings

A directory traversal and symlink following vulnerability exists in Pydantic Settings when using the NestedSecretsSettingsSource with nested subdirectory lookups enabled. An attacker capable of writing to the secrets directory can bypass size limitations, read arbitrary host files, or cause a denial-of-service condition via cyclic symlinks.

Amit Schendel
Amit Schendel
2 views•7 min read
•about 18 hours ago•GHSA-H5RG-8P7F-47G2
4.1

GHSA-h5rg-8p7f-47g2: Server-Side Request Forgery (SSRF) in SurrealDB Identity & Access Management (IAM) JWKS Fetcher

A Server-Side Request Forgery (SSRF) vulnerability exists in SurrealDB's Identity & Access Management (IAM) module prior to version 3.1.5. When configuring JSON Web Key Set (JWKS) URLs for token verification, the remote fetcher follows HTTP redirects by default without validating redirect targets against configured network capabilities. This allows high-privileged users to bypass network access limits and perform blind port scanning of internal network resources.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 19 hours ago•GHSA-CC8F-FCX3-GPJR
7.7

GHSA-cc8f-fcx3-gpjr: Arbitrary File Disclosure via DEFINE ANALYZER mapper filter in SurrealDB

A local file disclosure vulnerability exists in SurrealDB's full-text search capabilities, allowing authenticated users with database EDITOR or OWNER roles to read arbitrary files from the host system filesystem. This occurs by abusing the mapper() filter inside a DEFINE ANALYZER statement to point to system files.

Alon Barad
Alon Barad
6 views•6 min read
•about 20 hours ago•GHSA-H4H3-3RFJ-X6FQ
4.3

GHSA-H4H3-3RFJ-X6FQ: Value-Ordering Oracle Side-Channel via Indexed ORDER BY in SurrealDB

SurrealDB versions 3.0.0 through 3.1.4 contain an information exposure vulnerability (CWE-203) where the query planner optimizes sorted queries using indexes on fields with field-level SELECT restrictions. Because the query planner performs index-based sorting before enforcing permission-based redaction, unauthorized users can observe the physical order of returned rows to deduce the relative values of protected fields.

Alon Barad
Alon Barad
4 views•8 min read