Loading advisory.
Loading advisory.
Scriban: Built-in operations bypass LoopLimit and delay cancellation, enabling Denial of Service
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.
Published 2026-03-24 22:13 UTC · Modified 2026-08-17 16:04 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| scriban | NuGet | < 7.0.0 versions 0.1.0, 0.10.0, 0.11.0, 0.12.0, 0.12.1, 0.13.0, 0.14.0, 0.15.0, 0.16.0, 0.2.0, 0.2.1, 0.2.2, 0.3.0, 0.3.1, 0.3.1-pre028, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.9.0 and 103 more | 7.0.0 | dotnet add package scriban --version 7.0.0 |
| Scriban.Signed | NuGet | < 7.0.0 versions 0.10.0, 0.11.0, 0.12.0, 0.12.1, 0.13.0, 0.14.0, 0.15.0, 0.16.0, 0.9.0, 0.9.1, 1.0.0, 1.0.0-beta-001, 1.0.0-beta-002, 1.0.0-beta-003, 1.0.0-beta-004, 1.0.0-beta-005, 1.0.0-beta-006, 1.1.0, 1.1.1, 1.2.0 and 91 more | 7.0.0 | dotnet add package Scriban.Signed --version 7.0.0 |
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.
The relevant code path is:
ScriptBlockStatement.Evaluate() calls context.CheckAbort() once per statement in src/Scriban/Syntax/Statements/ScriptBlockStatement.cs lines 41–46.
LoopLimit enforcement is tied to script loop execution via TemplateContext.StepLoop(), not to internal helper iteration.
array.size in src/Scriban/Functions/ArrayFunctions.cs lines 596–609 calls list.Cast<object>().Count() for non-collection enumerables.
1..N creates a ScriptRange from ScriptBinaryExpression.RangeInclude() in src/Scriban/Syntax/Expressions/ScriptBinaryExpression.cs lines 745–748.
ScriptRange then yields every element one by one without going through StepLoop() in src/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 plain for loop in src/Scriban/Syntax/Expressions/ScriptBinaryExpression.cs lines 301–334.
mkdir scriban-poc3
cd scriban-poc3
dotnet new console --framework net8.0
dotnet add package Scriban --version 6.6.0Program.csusing Scriban;
var template = Template.Parse("{{ 1..1000000 | array.size }}");
var context = new TemplateContext
{
LoopLimit = 1
};
Console.WriteLine(template.Render(context));dotnet run1000000A safety limit of LoopLimit = 1 should prevent a template from performing one million iterations worth of work.
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.
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
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
One EPSS score on record: 0.006 on 2026-11-24.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.006 | first score | v2026.06.15 |