llamaCVEVulnerability Intelligence
/
Twig

CVE-2026-46633

Twig: PHP code injection via {% use %} template name

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

Solo en configuraciones específicasParche disponiblecode injection
Descargar PNG JSON
CVSS 4.0
8.7
Alta
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Fuente: CNA
9.8NVD · CVSS 3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
ExplotaciónSin evidenciaSSVC: ninguna · no figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versión3.26.0
Exposición129 dDesde la divulgación, 14 jul 2026, 4:14 p. m.
Detección111 dDesde la divulgación hasta su ingreso al índice
Decisión SSVCSeguir de cerca
Monitorear y programar la remediación
Sin explotación conocida, no automatizable e impacto técnico total. Hay versiones corregidas disponibles.
Huele a "ya lo veré". No la dejes así.Saqué la lupa: aquí hay algo que investigar.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Evaluación SSVC
Modificada
Explotación
Remediación
Monitoreo
Detectada
Verificada
14 jul 26
15 jul 26
3 nov 26
4 nov 26
16 nov 26
21 nov 26
14 jul 26
16 ago 26
17 sept 26
20 oct 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada CVE-2026-46633 divulgada · CVSS 8.7 (CNA)
Divulgación Evaluación SSVC CISA-ADP · explotación ninguna
Monitoreo Detectada Ingresó al índice
Divulgación Modificada Última actualización del registro
Monitoreo Verificada Última verificación contra las fuentes
Resumen

Twig is a template language for PHP. Starting in 1.15.1 and prior to 3.26.0, Compiler::string() does not escape single quotes when a template name from a {% use %} tag is placed inside a PHP single-quoted string literal, allowing a crafted template name to terminate the string and inject arbitrary PHP expressions into the compiled cache file. This issue is fixed in version 3.26.0.

Twig from 1.15.1 before 3.26.0 is affected when templates use the {% use %} tag, even with allowedTags configured. Fixed in 3.26.0.

¿Qué significa?A template name given to a {% use %} tag is placed into a single-quoted PHP string when the compiled cache is built, so crafted text in that name can inject arbitrary PHP code. The injected code runs when the cache file is loaded, which can give remote code execution and bypass the Twig sandbox.
¿Quién está afectado?Versions from 1.15.1 up to but not including 3.26.0 of the Twig package (twigphp/Twig or twig/twig) are in the affected range. The risky setup is a template that uses the {% use %} tag; SecurityPolicy always allows that tag, even when allowedTags is set. To check a project, run `composer show twig/twig` or look at the Twig version in composer.lock, and search templates for {% use %}.
¿Qué hacer?Upgrade Twig to 3.26.0 or later, which contains the fix.
Contexto

Condiciones y alcance

Condiciones necesarias para que el fallo sea explotable
01
The template uses a {% use %} tag, and the template name is placed in a single-quoted PHP string when the cache is compiled“the template name from a {% use %} tag is compiled via subcompile()”
02
SecurityPolicy always allows the {% use %} tag, even when allowedTags is configured“SecurityPolicy unconditionally allows {% use %} regardless of the configured allowedTags”
Vector CVSS 3.1

Desglose de métricas

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

Rangos afectados

Afectada Corregida
Twig · twig/twig≥ 1.15.1 < 3.26.0
1.15.1
3.26.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Twig
Corregida 3.26.0 — —
Versiones corregidas3.26.0
Explotación

Arsenal público

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

Referencias
Fabricantehttps://github.com/twigphp/Twig/security/advisories/GHSA-7p85-w9px-jpjp
Otrahttps://github.com/twigphp/Twig/commit/679447fa29083043665482ccf7d64372472621b8
Otrahttps://github.com/twigphp/Twig/commit/a2c6db7ea7d2c90923e6708019ec1442526d1c30
Otrahttps://github.com/twigphp/Twig/commit/e9ff55f6910832428e48a35b2e0748189ad49ae3
Otrahttps://gist.github.com/vladko312/d61b950f168c791db4786b83dc7a81e6
Otrahttps://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46633.yaml
Otrahttps://github.com/twigphp/Twig/releases/tag/v3.26.0
Otrahttps://symfony.com/cve-2026-46633

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