Description
Scriban before 7.0.0 (affected versions <= 6.6.0) contains an uncontrolled memory allocation vulnerability in the string.pad_left and string.pad_right template functions, which perform no validation on the width parameter before delegating to .NET's String.PadLeft/PadRight. When an application exposes Scriban to untrusted template input, an attacker can supply an arbitrarily large width value (e.g., 500,000,000) to trigger ~1GB memory allocations in a single call, resulting in OutOfMemoryException and denial of service. The TemplateContext.LimitToString limit does not prevent this because it is only enforced after the string has been fully allocated.
Published: 2026-08-16
Score: 8.7 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Scriban versions up through 6.6.0 contain an uncontrolled memory allocation flaw in the string.pad_left and string.pad_right template functions. The width argument is not validated before reaching .NET’s String.PadLeft/PadRight, allowing an attacker to submit a value such as 500,000,000. This triggers an allocation of roughly 1 GB of memory, causing an OutOfMemoryException and resulting in a denial of service. The weakness is identified as CWE‑770, an uncontrolled resource consumption vulnerability.

Affected Systems

The affected product is the Scriban templating engine, versions 6.6.0 and earlier. Any application that loads Scriban and accepts template input from untrusted sources is at risk, regardless of the host operating system or platform, as the vulnerability resides within the library itself.

Risk and Exploitability

The CVSS score of 8.7 reflects a high severity impact with potential for service disruption. The EPSS score is not available, but the flaw is not listed in CISA’s KEV catalog, indicating no public exploits are known. The likely attack vector is via tampered template data sent to an application that processes it with Scriban; an attacker would supply an excessively large width parameter to trigger the memory allocation. Successful exploitation would exhaust application memory, terminate the process, and render the affected service unavailable until restarted or memory is freed.

Generated by OpenCVE AI on August 16, 2026 at 14:38 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Scriban to version 7.0.0 or later, which removes the unchecked width handling.
  • If an upgrade is not immediately possible, validate or clamp the width argument before invoking pad_left or pad_right, ensuring it stays within a safe range (e.g., <10 000).
  • Restrict template input to trusted or sandboxed contexts, or apply strict access controls to prevent untrusted payloads from reaching the Scriban engine.

Generated by OpenCVE AI on August 16, 2026 at 14:38 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sun, 16 Aug 2026 13:30:00 +0000

Type Values Removed Values Added
Description Scriban before 7.0.0 (affected versions <= 6.6.0) contains an uncontrolled memory allocation vulnerability in the string.pad_left and string.pad_right template functions, which perform no validation on the width parameter before delegating to .NET's String.PadLeft/PadRight. When an application exposes Scriban to untrusted template input, an attacker can supply an arbitrarily large width value (e.g., 500,000,000) to trigger ~1GB memory allocations in a single call, resulting in OutOfMemoryException and denial of service. The TemplateContext.LimitToString limit does not prevent this because it is only enforced after the string has been fully allocated.
Title Scriban before 7.0.0 Denial of Service via string.pad_left/pad_right
Weaknesses CWE-770
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-16T13:14:13.132Z

Reserved: 2026-08-16T12:56:02.577Z

Link: CVE-2026-74788

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-16T14:16:56.787

Modified: 2026-08-16T14:16:56.787

Link: CVE-2026-74788

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-16T14:45:04Z

Weaknesses
  • CWE-770

    Allocation of Resources Without Limits or Throttling