8.8high
PHP Code Injection by malicious block or filename in Smarty
- Severity
- 8.8high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 4.91% (higher than 92% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-634x-pc3q-cf4c
Description
Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Prior to versions 3.1.45 and 4.1.1, template authors could inject php code by choosing a malicious {block} name or {include} file name. Sites that cannot fully trust template authors should upgrade to versions 3.1.45 or 4.1.1 to receive a patch for this issue. There are currently no known workarounds.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| smarty-php smarty | < 3.1.45, >= 4.0.0, < 4.1.1 | CVE List |
| smarty/smarty (Packagist) | before 3.1.45, from 4.0.0 before 4.1.1 | GitHub Advisory Database |
| smarty smarty | before 3.1.45, from 4.0.0 before 4.1.1 | NVD |
| debian debian_linux | 9.0, 10.0, 11.0 | NVD |
| fedoraproject fedora | 36, 37 | NVD |
All scores
| GitHub_M | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 6.5medium CVSS:2.0 | AV:N/AC:L/Au:S/C:P/I:P/A:P |
Classification
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. Prior to versions 3.1.45 and 4.1.1, template authors could inject php code by choosing a malicious {block} name or {include} file name. Sites that cannot fully trust template authors should upgrade to versions 3.1.45 or 4.1.1 to receive a patch for this issue. There are currently no known workarounds.
GitHub Advisory Database
Impact
Template authors could inject php code by choosing a malicous {block} name or {include} file name. Sites that cannot fully trust template authors should update asap.
Patches
Please upgrade to the most recent version of Smarty v3 or v4.
Workarounds
Is there a way for users to fix or remediate the vulnerability without upgrading?
References
Are there any links users can visit to find out more?
For more information
If you have any questions or comments about this advisory:
- Open an issue in the Smarty repo
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 versiones anteriores a 3.1.45 y 4.1.1, los autores de plantillas podían inyectar código php eligiendo un nombre de archivo {block} o {include} malicioso. Los sitios que no pueden confiar plenamente en los autores de plantillas deben actualizar a versiones 3.1.45 o 4.1.1 para recibir un parche para este problema. Actualmente no se presentan mitigaciones conocidas
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-29221 changed 2025-04-23 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-634x-pc3q-cf4c changed 2024-02-21 | CC-BY-4.0 |
| NVD | CVE-2022-29221 changed 2026-06-17 | Public domain |