Scriban Affected by Memory Exhaustion (OOM) via Unbounded String Generation (Denial of Service)
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-770.
Summary
`TemplateContext.LimitToString` defaults to `0` (unlimited). While Scriban implements a default `LoopLimit` of 1000, an attacker can still cause massive memory allocation via exponential string growth. Doubling a string for just 30 iterations generates over 1GB of text, instantly exhausting heap memory and crashing the host process. Because no output size limit is enforced, repeated string concatenation results in exponential memory growth. **Proof of Concept (PoC):** The following payload executes in under 30 iterations but results in ~1GB string allocation, crashing the process. ```csharp using Scriban; string maliciousTemplate = @" {{ a = ""A"" for i in 1..30 a = a + a end a }}"; var template = Template.Parse(maliciousTemplate); var context = new TemplateContext(); try { template.Render(context); } catch (Exception ex) { Console.WriteLine("\nException: " + ex.Message); } ``` **Impact:** An attacker can supply a small template that triggers exponential string growth, forcing the application to allocate excessive memory. This leads to severe memory pressure, garbage collection thrashing, and eventual process termination (DoS). **Suggested Fix:** Enforce a sensible default limit for string output. Set default `LimitToString` to 1MB (1,048,576 characters). ```csharp public int LimitToString { get; set; } = 1048576; ```
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | scriban (NuGet) | before 6.6.0 | 6.6.0 | Patch available | GHSA-5rpf-x9jg-8j5p |
| — | Scriban.Signed (NuGet) | before 6.6.0 | 6.6.0 | Patch available | GHSA-5rpf-x9jg-8j5p |
- scriban (NuGet) Vendor— Affected before 6.6.0 Fixed in 6.6.0 Patch available GHSA-5rpf-x9jg-8j5p
- Scriban.Signed (NuGet) Vendor— Affected before 6.6.0 Fixed in 6.6.0 Patch available GHSA-5rpf-x9jg-8j5p
Remediation
- Fix · GHSA-5rpf-x9jg-8j5p scriban (NuGet) Fixed in 6.6.0 Advisory →
- Fix · GHSA-5rpf-x9jg-8j5p Scriban.Signed (NuGet) Fixed in 6.6.0 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-5rpf-x9jg-8j5p
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences