CVE-2026-74786
No CISA KEV listing is included in this saved record. Exploitation may still have occurred.
FIRST EPSS: 0.48 % · percentile 41.90 % · scored 19 Nov 2026.
Saved 19 Nov 2026 16:46:59 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 (affected versions <= 6.6.0) contains a denial-of-service vulnerability in which the LimitToString safety limit (default 1MB) can be bypassed because ObjectToString resets the per-call length counter (_currentToStringLength) on every top-level call and StringBuilderOutput enforces no cumulative output-size limit. An attacker who can supply a template can render a near-limit string repeatedly in a loop, allocating approximately 1GB of memory and causing an out-of-memory condition that crashes the host application.
Read the publisher's advisoryScriban before 7.0.0 (affected versions <= 6.6.0) contains a denial-of-service vulnerability in which the LimitToString safety limit (default 1MB) can be bypassed because ObjectToString resets the per-call length counter (_currentToStringLength) on every top-level call and StringBuilderOutput enforces no cumulative output-size limit. An attacker who can supply a template can render a near-limit string repeatedly in a loop, allocating approximately 1GB of memory and causing an out-of-memory condition that crashes the host application.
Read the publisher's advisoryScriban before 7.0.0 (affected versions <= 6.6.0) contains a denial-of-service vulnerability in which the LimitToString safety limit (default 1MB) can be bypassed because ObjectToString resets the per-call length counter (_currentToStringLength) on every top-level call and StringBuilderOutput enforces no cumulative output-size limit. An attacker who can supply a template can render a near-limit string repeatedly in a loop, allocating approximately 1GB of memory and causing an out-of-memory condition that crashes the host application.
Read the publisher's advisory## Summary The `LimitToString` safety limit (default 1MB since commit `b5ac4bf`) can be bypassed to allocate approximately 1GB of memory by exploiting the per-call reset of `_currentToStringLength` in `ObjectToString`. Each template expression rendered through `TemplateContext.Write(SourceSpan, object)` triggers a separate top-level `ObjectToString` call that resets the length counter to zero, and the underlying `StringBuilderOutput` has no cumulative output size limit. An attacker who can supply a template can cause an out-of-memory condition in the host application. ## Details The root cause is in `TemplateContext.Helpers.cs`, in the `ObjectToString` method: ```csharp // src/Scriban/TemplateContext.Helpers.cs:89-111 public virtual string ObjectToString(object value, bool nested = false) { if (_objectToStringLevel == 0) { _currentToStringLength = 0; // <-- resets on every top-level call } try { _objectToStringLevel++; // ... var result = ObjectToStringImpl(value, nested); if (LimitToString > 0 && _objectToStringLevel == 1 && result != null && result.Length >= LimitToString) { return result + "..."; } return result; } // ... } ``` Each time a template expression is rendered, `TemplateContext.Write(SourceSpan, object)` calls `ObjectToString`: ```csharp // src/Scriban/TemplateContext.cs:693-701 public virtual TemplateContext Write(SourceSpan span, object textAsObject) { if (textAsObject != null) { var text = ObjectToString(textAsObject); // fresh _currentToStringLength = 0 Write(text); } return this; } ``` The `StringBuilderOutput.Write` method appends unconditionally with no size check: ```csharp // src/Scriban/Runtime/StringBuilderOutput.cs:47-50 public void Write(string text, int offset, int count) { Builder.Append(text, offset, count); // no cumulative limit } ``` **Execution flow:** 1. Template creates a string of length 1,048,575 (one byte under the 1MB `LimitToString` default) 2. A `for` loop iterates up to `LoopLimit` (default 1000) times 3. Each iteration renders the string via `Write(span, x)` → `ObjectToString(x)` 4. `ObjectToString` resets `_currentToStringLength = 0` since `_objectToStringLevel == 0` 5. The string passes the `LimitToString` check (1,048,575 < 1,048,576) 6. Full string is appended to `StringBuilder` — no cumulative tracking 7. After 1000 iterations: ~1GB allocated in-memory ## PoC ```csharp using Scriban; // Uses only default TemplateContext settings (LoopLimit=1000, LimitToString=1048576) var template = Template.Parse("{{ x = \"\" | string.pad_left 1048575 }}{{ for i in 1..1000 }}{{ x }}{{ end }}"); // This will allocate ~1GB in the StringBuilder, likely causing OOM var result = template.Render(); ``` Equivalent Scriban template: ```scriban {{ x = "" | string.pad_left 1048575 }}{{ for i in 1..1000 }}{{ x }}{{ end }} ``` Each of the 1000 loop iterations outputs a 1,048,575-character string. Each passes the per-call `LimitToString` check independently. Total output: ~1,000,000,000 characters (~1GB) allocated in the `StringBuilder`. ## Impact - **Denial of Service:** An attacker who can supply Scriban templates (common in CMS, email templating, report generation) can crash the host application via out-of-memory - **Process-level impact:** OOM kills the entire .NET process, not just the template rendering — affects all concurrent users - **Bypass of safety mechanism:** The `LimitToString` limit was specifically introduced to prevent resource exhaustion, but the per-call reset makes it ineffective against cumulative abuse - **Low complexity:** The exploit template is trivial — a single line ## Recommended Fix Add a cumulative output size counter to `TemplateContext` that tracks total bytes written across all `Write` calls, independent of the per-object `LimitToString`: ```csharp // In TemplateContext.cs — add new property and field private long _totalOutputLength; /// <summary> /// Gets or sets the maximum total output length in characters. Default is 10485760 (10 MB). 0 means no limit. /// </summary> public int OutputLimit { get; set; } = 10485760; // In TemplateContext.Write(string, int, int) — add check before writing public TemplateContext Write(string text, int startIndex, int count) { if (text != null) { if (OutputLimit > 0) { _totalOutputLength += count; if (_totalOutputLength > OutputLimit) { throw new ScriptRuntimeException(CurrentSpan, $"The output limit of {OutputLimit} characters was reached."); } } // ... existing indent/write logic } return this; } ``` This provides defense-in-depth: `LimitToString` caps individual object serialization, while `OutputLimit` caps total template output.
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.48 % · percentile 41.90 % · scored 19 Nov 2026.
Saved 19 Nov 2026 16:46:59 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-74786 · 19 Nov 2026 16:46:59 UTC
CVE-2026-74786 · 18 Nov 2026 15:46:44 UTC
CVE-2026-74786 · 17 Nov 2026 15:26:11 UTC
CVE-2026-74786 · 17 Nov 2026 02:39:16 UTC
CVE-2026-74786 · 15 Nov 2026 14:45:34 UTC
CVE-2026-74786 · 14 Nov 2026 16:37:01 UTC
CVE-2026-74786 · 13 Nov 2026 19:59:34 UTC
CVE-2026-74786 · 12 Nov 2026 18:18:51 UTC
CVE-2026-74786 · 10 Nov 2026 20:24:10 UTC
CVE-2026-74786 · 09 Nov 2026 21:04:24 UTC
CVE-2026-74786 · 08 Nov 2026 15:12:21 UTC
CVE-2026-74786 · 07 Nov 2026 16:07:52 UTC
CVE-2026-74786 · 06 Nov 2026 19:10:17 UTC
CVE-2026-74786 · 05 Nov 2026 22:49:22 UTC
CVE-2026-74786 · 05 Nov 2026 02:54:06 UTC
CVE-2026-74786 · 03 Nov 2026 16:59:18 UTC
CVE-2026-74786 · 02 Nov 2026 23:59:04 UTC
CVE-2026-74786 · 01 Nov 2026 23:58:58 UTC
CVE-2026-74786 · 01 Nov 2026 03:04:52 UTC
CVE-2026-74786 · 31 Oct 2026 01:52:30 UTC
CVE-2026-74786 · 29 Oct 2026 18:29:26 UTC
CVE-2026-74786 · 28 Oct 2026 19:55:37 UTC
CVE-2026-74786 · 27 Oct 2026 15:46:19 UTC
CVE-2026-74786 · 27 Oct 2026 00:23:05 UTC
CVE-2026-74786 · 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-59952 · Published
euvd · EUVD-2026-59952 · Published
euvd · EUVD-2026-59952 · Published
euvd · EUVD-2026-59952 · Published
euvd · EUVD-2026-59952 · Published
euvd · EUVD-2026-59952 · Published
euvd · EUVD-2026-59952 · Published
euvd · EUVD-2026-59952 · Published
euvd · EUVD-2026-59952 · Published
euvd · EUVD-2026-59952 · Published
euvd · EUVD-2026-59952 · Published
euvd · EUVD-2026-59952 · Published
nvd · CVE-2026-74786 · Published
osv · GHSA-m2p3-hwv5-xpqw · Published
cve-program · CVE-2026-74786 · Published