Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Scriban Affected by Memory Exhaustion (OOM) via Unbounded String Generation (Denial of Service)

0
Medium
Published: 03/19/2026 (03/19/2026, 21:31:10 UTC)
Source: GCVE Database
Product: scriban

Description

`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; ```

CVSS v3.1

Score 5.3medium

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Affected software

NuGetghsa
scriban
Affected versions
<6.6.0
NuGetghsa
Scriban.Signed
Affected versions
<6.6.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/06/2026, 23:34:01 UTC

Technical Analysis

The Scriban template engine has a vulnerability in versions before 6.6.0 where the TemplateContext.LimitToString property defaults to unlimited output size. Although a LoopLimit of 1000 exists, it does not prevent exponential string growth through repeated concatenation. An attacker can supply a malicious template that doubles a string 30 times, causing over 1GB of memory allocation and crashing the process due to out-of-memory conditions. The suggested fix is to enforce a default limit on string output size, such as setting LimitToString to 1,048,576 characters (1MB).

Potential Impact

This vulnerability allows an unauthenticated attacker to cause a denial of service by exhausting the application's memory through exponential string growth during template rendering. The impact is limited to availability, as it leads to process crashes and severe memory pressure without affecting confidentiality or integrity.

Mitigation Recommendations

A fix is available by upgrading to Scriban version 6.6.0 or later, where a sensible default limit for string output (LimitToString) is enforced. If upgrading is not immediately possible, users should manually set the LimitToString property to a reasonable value such as 1,048,576 characters to prevent unbounded memory allocation. Patch status is not explicitly stated in a vendor advisory, so users should verify the fix in version 6.6.0 or later.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-5rpf-x9jg-8j5p
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["NuGet"]
Database Specific Severity
MODERATE
Cvss Version
3.1

Threat ID: 6a4c346127e9c79719600ae4

Added to database: 07/06/2026, 23:04:01 UTC

Last enriched: 07/06/2026, 23:34:01 UTC

Last updated: 07/31/2026, 15:42:45 UTC

Views: 14

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses