High severityNVD Advisory· Published Jan 10, 2022· Updated Apr 23, 2025
Access to restricted PHP code by dynamic static class access in smarty
CVE-2021-21408
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
smarty/smartyPackagist | < 3.1.43 | 3.1.43 |
smarty/smartyPackagist | >= 4.0.0, < 4.0.3 | 4.0.3 |
Affected products
2Patches
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
14- github.com/advisories/GHSA-4h9c-v5vg-5m6mghsaADVISORY
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/mitrevendor-advisory
- nvd.nist.gov/vuln/detail/CVE-2021-21408ghsaADVISORY
- security.gentoo.org/glsa/202209-09ghsavendor-advisoryWEB
- www.debian.org/security/2022/dsa-5151ghsavendor-advisoryWEB
- github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2021-21408.yamlghsaWEB
- github.com/smarty-php/smarty/commit/19ae410bf56007a5ef24441cdc6414619cfaf664ghsaWEB
- github.com/smarty-php/smarty/releases/tag/v3.1.43ghsaWEB
- github.com/smarty-php/smarty/releases/tag/v4.0.3ghsaWEB
- github.com/smarty-php/smarty/security/advisories/GHSA-4h9c-v5vg-5m6mghsaWEB
- lists.debian.org/debian-lts-announce/2022/05/msg00005.htmlghsamailing-listWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQghsaWEB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNIghsaWEB
News mentions
0No linked articles in our index yet.