CVE-2026-74789 — Vulnerability in scriban — CVE Details
Scriban: Built-in operations bypass LoopLimit and delay cancellation, enabling Denial of Service
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.60%). Schedule for your next planned update.
Does your project use an affected Scriban version?
Paste your packages.lock.json to check it for CVE-2026-74789 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
Scriban's LoopLimit only applies to script loop statements, not to expensive iteration performed inside operators and builtins. An attacker can submit a single expression such as {{ 1..1000000 | array.size }} and force large amounts of CPU work even when LoopLimit is set to a very small value.
Details
The relevant code path is:
ScriptBlockStatement.Evaluate()callscontext.CheckAbort()once per statement insrc/Scriban/Syntax/Statements/ScriptBlockStatement.cslines 41–46.LoopLimitenforcement is tied to script loop execution viaTemplateContext.StepLoop(), not to internal helper iteration.array.sizeinsrc/Scriban/Functions/ArrayFunctions.cslines 596–609 callslist.Cast<object>().Count()for non-collection enumerables.1..Ncreates aScriptRangefromScriptBinaryExpression.RangeInclude()insrc/Scriban/Syntax/Expressions/ScriptBinaryExpression.cslines 745–748.ScriptRangethen yields every element one by one without going throughStepLoop()insrc/Scriban/Runtime/ScriptRange.cs.
This means a single statement can perform arbitrarily large iteration without being stopped by LoopLimit.
There is also a related memory-amplification path in string * int:
ScriptBinaryExpression.CalculateToString()appends in a plainforloop insrc/Scriban/Syntax/Expressions/ScriptBinaryExpression.cslines 301–334.
Proof of Concept
Setup
mkdir scriban-poc3
cd scriban-poc3
dotnet new console --framework net8.0
dotnet add package Scriban --version 6.6.0
Program.cs
using Scriban;
var template = Template.Parse("{{ 1..1000000 | array.size }}");
var context = new TemplateContext
{
LoopLimit = 1
};
Console.WriteLine(template.Render(context));
Run
dotnet run
Actual Output
1000000
Expected Behavior
A safety limit of LoopLimit = 1 should prevent a template from performing one million iterations worth of work.
Optional Stronger Variant (Memory Amplification)
using Scriban;
var template = Template.Parse("{{ 'A' * 200000000 }}");
var context = new TemplateContext
{
LoopLimit = 1
};
template.Render(context);
This variant demonstrates that LoopLimit also does not constrain large internal allocation work.
Impact
This is an uncontrolled resource consumption issue. Any application that accepts attacker-controlled templates and relies on LoopLimit as part of its safe-runtime configuration can still be forced into heavy CPU or memory work by a single expression.
The issue impacts:
- Template-as-a-service systems
- CMS or email rendering systems that accept user templates
- Any multi-tenant use of Scriban with untrusted template content
Advisory Timeline
- First published March 24, 2026 (247 days ago).
- Last revised August 17, 2026 — 145 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
dotnet add package scriban --version 7.0.0
dotnet add package Scriban.Signed --version 7.0.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: NuGet (2).
| Package | Fixed In |
|---|---|
| scriban NuGet · Affected: 0.1.0, 0.10.0, 0.11.0, 0.12.0 (+119 more) | 7.0.0 |
| Scriban.Signed NuGet · Affected: 0.10.0, 0.11.0, 0.12.0, 0.12.1 (+107 more) | 7.0.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-400Uncontrolled Resource ConsumptionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
Frequently Asked Questions
- What is CVE-2026-74789?
- Scriban: Built-in operations bypass LoopLimit and delay cancellation, enabling Denial of Service. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2026-74789?
- CVE-2026-74789 affects scriban and Scriban.Signed. It has a 0.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-74789 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 42.5% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-74790CRITICAL
Scriban: Sandbox escape due to TypedObjectAccessorcache bypassing MemberFilter after TemplateContext reuse
- CVE-2026-74784HIGH
Scriban: array.insert_at index parameter DoS bypasses LoopLimit and LimitToString
- CVE-2026-74794HIGH
Scriban has an Infinite Recursion during Object Rendering Leads to Stack Overflow and Process Crash (Denial of Service)
- CVE-2026-74792HIGH
Scriban has a Stack Overflow via Nested Array Initializers That Bypass the ExpressionDepthLimit Fix
- CVE-2026-74788HIGH
Scriban: Uncontrolled Memory Allocation via string.pad_left/pad_right Allows Remote Denial of Service
- CVE-2026-74783MEDIUM
Scriban: ExpressionDepthLimit guard is non-enforcing — parser-recursion DoS in 6.6.0–7.2.0 (incomplete fix for GHSA-wgh7-7m3c-fx25 / GHSA-p6q4-fgr8-vx4p)
- CVE-2026-74786MEDIUM
Scriban: Denial of Service via Unbounded Cumulative Template Output Bypassing LimitToString
- CVE-2026-73062MEDIUM
Scriban: array * int (ScriptArray<T>.TryEvaluate) bypasses LoopLimit — incomplete fix for GHSA-c875-h985-hvrc, missed sibling of GHSA-24c8-4792-22hx