CVE-2024-35226
JSON

7.3high

PHP Code Injection by malicious attribute in extends-tag in Smarty

Severity
7.3high CVSS:3.1 by GitHub_M
Exploit likelihood
0.51% (higher than 44% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4rmg-292m-wg3w

Description

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. In affected versions template authors could inject php code by choosing a malicious file name for an extends-tag. Sites that cannot fully trust template authors should update asap. All users are advised to update. There is no patch for users on the v3 branch. There are no known workarounds for this vulnerability.

Affected

Product or packageVersionsReported by
smarty-php smarty>= 5.0.0, < 5.1.1, >= 3.0.0, < 4.5.3, from 5.0.0 before 5.1.1, from 3.0.0 before 4.5.3CVE List
smarty/smarty (Packagist)from 5.0.0 before 5.1.1, from 3.0.0 before 4.5.3GitHub Advisory Database

All scores

GitHub_M7.3high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N
GitHub7.3high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N

Classification

CWE-94

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. In affected versions template authors could inject php code by choosing a malicious file name for an extends-tag. Sites that cannot fully trust template authors should update asap. All users are advised to update. There is no patch for users on the v3 branch. There are no known workarounds for this vulnerability.

GitHub Advisory Database
Impact

Template authors could inject php code by choosing a malicous file name for an extends-tag. Users that cannot fully trust template authors should update asap.

Patches

Please upgrade to the most recent version of Smarty v4 or v5. There is no patch for v3.

NVD (es)

Smarty es un motor de plantillas para PHP que facilita la separación de la presentación (HTML/CSS) de la lógica de la aplicación. En las versiones afectadas, los autores de plantillas podían inyectar código php eligiendo un nombre de archivo malicioso para una etiqueta extendida. Los sitios que no pueden confiar plenamente en los autores de las plantillas deben actualizarlas lo antes posible. Se recomienda a todos los usuarios que actualicen. No hay ningún parche para los usuarios de la rama v3. No se conocen workarounds para esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-35226 changed 2025-11-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-4rmg-292m-wg3w changed 2025-11-04CC-BY-4.0
NVDCVE-2024-35226 changed 2026-06-17Public domain