Mar 20, 2026·6 min read·75 visits
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.
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.
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.
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 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.
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.
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.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
Scriban Scriban Contributors | All versions prior to the March 2026 fix | - |
| Attribute | Detail |
|---|---|
| Vulnerability Class | Uncontrolled Recursion (CWE-674) |
| Secondary Class | Uncontrolled Resource Consumption (CWE-400) |
| Attack Vector | Network |
| CVSS v3.1 Base Score | 7.5 (High) |
| Impact | Denial of Service (Process Crash) |
| Exploit Status | Proof of Concept available |
| Privileges Required | None |
The program does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.
CVE-2026-59992 is a critical broken access control vulnerability in the first-party production media adapters of Tina CMS, including next-tinacms-s3, next-tinacms-dos, next-tinacms-azure, and next-tinacms-cloudinary. The issue allows authenticated editors to escape the configured mediaRoot directory containment, facilitating unauthorized file uploads, modifications, and deletions across the entire storage bucket or container.
A Cross-Site Request Forgery (CSRF) vulnerability in the local development server of @tinacms/cli allowed malicious cross-origin pages to send state-changing HTTP requests. This issue permitted attackers to write arbitrary files into a developer's project directory or manipulate search and GraphQL indices without authorization.
A high-severity path traversal vulnerability exists in the @logto/tunnel npm package (part of the Logto repository) prior to version 0.3.9. Remote unauthenticated attackers can exploit this vulnerability to read arbitrary local files by sending crafted HTTP requests with directory traversal sequences when the static file proxy is active.
A critical stored Cross-Site Scripting (XSS) vulnerability was identified in Froxlor server administration software panel before version 2.3.8. Authenticated customers with DNS editor privileges can inject malicious JavaScript into DNS TXT records. Because the application processes these values via a raw formatting callback without context-aware HTML entity encoding, the payload executes in the security context of administrative users who view the affected domain's DNS zones.
An authenticated administrator with privileges to manage admin accounts (such as change_serversettings) can execute arbitrary SQL commands via a second-order SQL injection vulnerability. The flaw resides in Froxlor's administrative API endpoints, specifically during the handling of IP address mapping parameters which are stored as serialized arrays and later interpolated without sanitization into active database queries. This vulnerability allows high-privileged administrative attackers to compromise the database. By injecting a payload into administrative profile metadata, an attacker can extract sensitive credentials, manipulate backend settings, or potentially disrupt database integrity. The vulnerability affects all versions of Froxlor prior to 2.3.8.
CVE-2026-54543 is a DNS Resource Record (RR) Injection vulnerability in Froxlor, an open-source server administration control panel. Prior to version 2.3.8, the DomainZones.add API command failed to perform strict sanitization and validation on the user-controlled record (label) and type parameters before serializing them into BIND-compatible zone files. An authenticated customer with DNS zone management permissions can inject control characters, breaking out of the original record context to define unauthorized resource records within managed zones.