llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · apostrophe

GHSA-FFMJ-5CGG-P842

Stored XSS: JSX templates insert string props into Nunjucks blocks unescaped

Parche disponible
Descargar PNG JSON
CVSS 3.1
5.4
Media
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N 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ón8 dDesde la divulgación, 11 nov 2026, 3:28 p. m.
Detección6 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Parche 4.34.1
Monitoreo
Detectada +1
11 nov 26
18 nov 26
19 nov 26
11 nov 26
13 nov 26
15 nov 26
17 nov 26
19 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-FFMJ-5CGG-P842 divulgada · CVSS 5.4 (GitHub)
Divulgación Modificada Última actualización del registro
Remediación Parche 4.34.1 apostrophe · 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

When a JSX template extends a Nunjucks template with `<Extend>`, each prop overrides the Nunjucks block of the same name. A prop that is a plain string is inserted into the block without escaping. Everywhere else in JSX, and in a Nunjucks block that outputs `{{ value }}`, the same string would be escaped.

The pattern documented for JSX projects passes the page title this way:

<Extend templateName={outerLayout} title={page.title} main={...} />

Core's `outerLayout.html` is Nunjucks, so every JSX project's layout extends a Nunjucks template. Anyone who can edit a page or piece title can therefore set a title such as `</title><script>...</script>`, and the script runs for every visitor to that page, including administrators. The `bodyClass` block sits inside the `class` attribute of `<body>`, so a string with a quote there escapes the attribute too.

Affected
  • `apostrophe` 4.31.0 and later, when JSX templates are used.
  • Only string props passed through `<Extend>` to a Nunjucks template. JSX elements and fragments (`title={<>{page.title}</>}`) were always escaped, as were JSX-to-JSX templates.
  • Exploitation needs an account that can edit content which reaches such a prop, such as a page or piece title.
Fix

String props are now escaped, as Nunjucks escapes `{{ value }}`, including quotes, since some blocks sit in attribute values. Markup is passed as a JSX element or fragment, or as a string marked with `apos.template.safe()`, which already passed through unescaped. A plain object passed to a block is written as HTML attributes with escaped values, for blocks such as `extraHtml` inside the `<html>` tag: `extraHtml={{ 'data-theme': 'dark' }}`.

A project that deliberately passes HTML elements to a block should use the `{<element>...</.element>}` or `{<>...</>}` syntax. A project that deliberately passes raw HTML attributes and not complete elements must now wrap it with `apos.template.safe()` or use the object form.

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:L
BajaAlta
PrivilegiosPR:L
NingunoBajosAltos
InteracciónUI:R
NingunaRequerida
AlcanceS:C
CambiadoSin cambio
ConfidencialidadC:L
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
apostrophe≥ 4.31.0 < 4.34.1
4.31.0
4.34.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmapostrophe
Corregida 4.34.1 0 d 4.34.1 no afectada
Versiones corregidas4.34.1
Explotación

Arsenal público

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

Referencias
Advisoryhttps://github.com/apostrophecms/apostrophe/security/advisories/GHSA-ffmj-5cgg-p842

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