llamaCVEVulnerability Intelligence
/
Advisory · GitHub · NuGet · Scriban

GHSA-8637-5Q5Q-HXVW

TemplateContext.Reset retains attacker-controlled array.cycle state in Tags

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS 3.1
5.9
Media
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición14 dDesde la divulgación, 7 nov 2026, 5:23 p. m.
Detección12 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Agenda, parchea y celebra con un mate.Se arregla en el próximo ciclo. Sin estrés.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 7.6.0
Monitoreo
Detectada +1
7 nov 26
20 nov 26
21 nov 26
7 nov 26
11 nov 26
14 nov 26
18 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-8637-5Q5Q-HXVW divulgada · CVSS 5.9 (GitHub)
Remediación Parche 7.6.0 Scriban · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

Pooled `TemplateContext` instances retain attacker-chosen `array.cycle` group strings after `Reset()`, so memory grows per request.

Details

`ArrayFunctions.Cycle` (`src/Scriban/Functions/ArrayFunctions.cs:188-209`) stores `CycleKey(strGroup)` in public `Tags`. `Reset()` (`TemplateContext.cs:1026-1055`) clears output, globals, cultures, source files, `CachedTemplates` and `_memberAccessors`, but not `Tags`.

Suggested fix. Do not store per-render builtin state in the public `Tags` dictionary, or clear only the builtin-owned entries on reset. For example, move `CycleKey` state to a private `Dictionary<CycleKey, int>` on `TemplateContext` and clear it in `Reset()`, and store the `math.random` `Random` in a private field. If `Tags` must remain public for host use, add a small internal registry of builtin keys/prefixes and remove those in `Reset()` without touching host entries.

Proof of concept

Default context, five renders with `ctx.Reset()` between them:

var ctx = new TemplateContext();
ctx.PushGlobal(new ScriptObject());
var template = Template.Parse("{{ for i in 1..1000; s = 'x' * 100000 + math.uuid; array.cycle ['v'] s; end; '' }}");
for (var round = 0; round < 5; round++)
{
    template.Render(ctx);
    Console.WriteLine($"round={round} tags={ctx.Tags.Count}");
    ctx.Reset();
    Console.WriteLine($"afterReset tags={ctx.Tags.Count}");
}

Observed:

MODE=tags round=0 tags=1000 peakWS=308MB
MODE=tags afterReset round=0 tags=1000 ws=311MB
MODE=tags round=4 tags=5000 peakWS=1210MB
MODE=tags afterReset round=4 tags=5000 ws=1210MB

`Tags.Count` grows 1000 → 5000 and is unchanged by `Reset()`; peak working set reaches ~1.2 GB (~100 MB retained per render).

Impact

Unbounded memory retention and OOM in hosts that pool `TemplateContext` and call `Reset()`. Requires context reuse.

Remediation in Scriban 7.6.0

Upgrade either distribution, Scriban or Scriban.Signed, to 7.6.0 or later.

Per-render cycle and random state is now kept in a separate builtin-owned store that TemplateContext.Reset() clears. Host-owned Tags entries are preserved. Hosts pooling contexts must continue to call Reset() between independent uses. This report and GHSA-vhvh-mqjm-8vpg describe overlapping effects of the same state-retention defect.

No CVE identifier is requested for this advisory.

_Remediation notes and package metadata updated by CodeAlta._

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:H
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:N
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
7.1/ 10Alto
Vector 7.1 (fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
Scriban · Scriban.Signed≤ 7.5.3
7.5.3
7.6.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
nugetScriban
Corregida 7.6.0 0 d 7.6.1 no afectada
nugetScriban.Signed
Corregida 7.6.0 0 d 7.6.1 no afectada
Versiones corregidas7.6.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/scriban/scriban/security/advisories/GHSA-8637-5q5q-hxvw

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.