Advisory Database
  • Advisories
  • Dependency Scanning
  1. nuget
  2. ›
  3. scriban
  4. ›
  5. GHSA-m2p3-hwv5-xpqw

GHSA-m2p3-hwv5-xpqw: Scriban: Denial of Service via Unbounded Cumulative Template Output Bypassing LimitToString

March 24, 2026

The LimitToString safety limit (default 1MB since commit b5ac4bf) can be bypassed to allocate approximately 1GB of memory by exploiting the per-call reset of _currentToStringLength in ObjectToString. Each template expression rendered through TemplateContext.Write(SourceSpan, object) triggers a separate top-level ObjectToString call that resets the length counter to zero, and the underlying StringBuilderOutput has no cumulative output size limit. An attacker who can supply a template can cause an out-of-memory condition in the host application.

References

  • github.com/advisories/GHSA-m2p3-hwv5-xpqw
  • github.com/scriban/scriban
  • github.com/scriban/scriban/security/advisories/GHSA-m2p3-hwv5-xpqw

Code Behaviors & Features

Detect and mitigate GHSA-m2p3-hwv5-xpqw with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 7.0.0

Fixed versions

  • 7.0.0

Solution

Upgrade to version 7.0.0 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-770: Allocation of Resources Without Limits or Throttling

Source file

nuget/scriban/GHSA-m2p3-hwv5-xpqw.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 25 Mar 2026 12:18:39 +0000.