CVE-2021-21408
JSON

8.8high

Access to restricted PHP code by dynamic static class access in smarty

Severity
8.8high CVSS:3.1 by GitHub_M
Exploit likelihood
2.14% (higher than 82% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4h9c-v5vg-5m6m

Description

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Prior to versions 3.1.43 and 4.0.3, template authors could run restricted static php methods. Users should upgrade to version 3.1.43 or 4.0.3 to receive a patch.

Affected

Product or packageVersionsReported by
smarty-php smarty< 3.1.43, >= 4.0.0, < 4.0.3CVE List
smarty/smarty (Packagist)before 3.1.43, from 4.0.0 before 4.0.3GitHub Advisory Database
smarty smartybefore 3.1.43, from 4.0.0 before 4.0.3NVD
debian debian_linux9.0, 10.0, 11.0NVD
fedoraproject fedora36, 37NVD

All scores

GitHub_M8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
GitHub8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD6.5medium CVSS:2.0AV:N/AC:L/Au:S/C:P/I:P/A:P

Classification

CWE-20

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.43 and 4.0.3, template authors could run restricted static php methods. Users should upgrade to version 3.1.43 or 4.0.3 to receive a patch.

GitHub Advisory Database
Impact

Template authors could run restricted static php methods.

Patches

Please upgrade to 3.1.40 or higher.

References

See the documentation on Smarty security features on the static_classes access filter.

For more information

If you have any questions or comments about this advisory please 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. Antes de las versiones 3.1.43 y 4.0.3, los autores de plantillas podían ejecutar métodos estáticos restringidos de php. Los usuarios deben actualizar a la versión 3.1.43 o 4.0.3 para recibir el parche

References

https://github.com/smarty-php/smarty/security/advisories/GHSA-4h9c-v5vg-5m6mthird-party-advisory, web
https://github.com/smarty-php/smarty/commit/19ae410bf56007a5ef24441cdc6414619cfaf664patch, third-party-advisory, web
https://github.com/smarty-php/smarty/releases/tag/v3.1.43release-notes, third-party-advisory, web
https://github.com/smarty-php/smarty/releases/tag/v4.0.3release-notes, third-party-advisory, web
https://lists.debian.org/debian-lts-announce/2022/05/msg00005.htmlmailing-list, third-party-advisory, web
https://www.debian.org/security/2022/dsa-5151third-party-advisory, vendor-advisory, web
https://security.gentoo.org/glsa/202209-09third-party-advisory, vendor-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/vendor-advisory
https://nvd.nist.gov/vuln/detail/CVE-2021-21408advisory
https://github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2021-21408.yamlweb
https://github.com/smarty-php/smartypackage

Sources

SourceRecordLicence
CVE ListCVE-2021-21408 changed 2025-04-23CVE Terms of Use
GitHub Advisory DatabaseGHSA-4h9c-v5vg-5m6m changed 2026-07-08CC-BY-4.0
NVDCVE-2021-21408 changed 2026-06-17Public domain