# CVE-2026-74788: Scriban uncontrolled memory allocation in string.pad_left and string.pad_right

Source: https://junglewise.ai/threats/cve-2026-74788-scriban-uncontrolled-memory-allocation-in-string-pad-left-and  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-16. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-74788 · Severity: high · CVSS 7.5 · Published 2026-08-16

Scriban is a template engine used to render dynamic content in .NET applications. When exposed to untrusted templates, the string.pad_left and string.pad_right functions fail to validate the width parameter, allowing an attacker to trigger massive memory allocations (up to ~1GB per request) and crash the service via OutOfMemoryException. This affects the official Scriban playground on Azure and any application using Scriban with user-supplied templates.

Technologies: [scriban (NuGet)](https://junglewise.ai/threats/technologies/scriban), [Scriban.Signed (NuGet)](https://junglewise.ai/threats/technologies/scriban-signed). Vendors: [NuGet](https://junglewise.ai/threats/vendors/nuget).

## Quick answers

**Is CVE-2026-74788 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-74788 being exploited in the wild.

**How severe is CVE-2026-74788?** High severity, with a CVSS score of 7.5, published 16 August 2026.

**Which products and versions are affected?** scriban (NuGet) ECOSYSTEM:introduced=0,fixed=7.0.0; Scriban.Signed (NuGet) ECOSYSTEM:introduced=0,fixed=7.0.0.

**Is there a fix for CVE-2026-74788?** Yes. scriban (NuGet): upgrade to 7.0.0 or later; Scriban.Signed (NuGet): upgrade to 7.0.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-74788 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-74788?** Check whether you run scriban (NuGet) or Scriban.Signed (NuGet) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- scriban (NuGet): upgrade to 7.0.0 or later

  ```sh
  dotnet add package scriban --version 7.0.0
  ```

- Scriban.Signed (NuGet): upgrade to 7.0.0 or later

  ```sh
  dotnet add package Scriban.Signed --version 7.0.0
  ```


## Technical details

The vulnerability is an uncontrolled resource allocation (CWE-770) in the StringFunctions.PadLeft and StringFunctions.PadRight functions, which directly delegate to .NET's String.PadLeft/PadRight without bounds checking on the width parameter. An attacker can supply an arbitrarily large width value (e.g., 500,000,000) to trigger memory exhaustion before template rendering completes. The existing TemplateContext.LimitToString mitigation is ineffective because it only enforces the limit during ObjectToString() conversion—after the string has already been fully allocated in memory. Attack requires only network access and no authentication; a 39-byte POST request can consume ~1GB of memory. Scriban 7.0.0 patched this by adding width validation to both functions.

## Affected products

- Scriban Scriban <= 6.6.0

## Identifiers

- CVE-2026-74788
- GHSA-v66j-x4hw-fv9g

## Timeline

- 2026-03-22: disclosed: GHSA-v66j-x4hw-fv9g published on GitHub
- 2026-08-16: advisory: CVE-2026-74788 published on NVD
- 2026: patched: Scriban 7.0.0 released with fix

## References

- [https://github.com/scriban/scriban/security/advisories/GHSA-v66j-x4hw-fv9g](https://github.com/scriban/scriban/security/advisories/GHSA-v66j-x4hw-fv9g)
- [https://www.vulncheck.com/advisories/scriban-before-denial-of-service-via-string-pad-left-pad-right](https://www.vulncheck.com/advisories/scriban-before-denial-of-service-via-string-pad-left-pad-right)

## Related threats

- [Scriban uncontrolled recursion stack overflow in parser](https://junglewise.ai/threats/cve-2026-74795-scriban-uncontrolled-recursion-stack-overflow-in-parser)
- [Scriban infinite recursion in object rendering](https://junglewise.ai/threats/cve-2026-74794-scriban-infinite-recursion-in-object-rendering)
- [Scriban stack overflow in nested array initializer parsing](https://junglewise.ai/threats/cve-2026-74792-scriban-stack-overflow-in-nested-array-initializer-parsing)
- [Scriban authorization bypass via stale include cache](https://junglewise.ai/threats/cve-2026-74791-scriban-authorization-bypass-via-stale-include-cache)
- [Scriban TypedObjectAccessor cache MemberFilter bypass](https://junglewise.ai/threats/cve-2026-74790-scriban-typedobjectaccessor-cache-memberfilter-bypass)
