High severity8.1NVD Advisory· Published Jan 10, 2022· Updated Jun 17, 2026
CVE-2021-29454
CVE-2021-29454
Description
Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Prior to versions 3.1.42 and 4.0.2, template authors could run arbitrary PHP code by crafting a malicious math string. If a math string was passed through as user provided data to the math function, external users could run arbitrary PHP code by crafting a malicious math string. Users should upgrade to version 3.1.42 or 4.0.2 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.42 | 3.1.42 |
smarty/smartyPackagist | >= 4.0.0, < 4.0.2 | 4.0.2 |
Affected products
8cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*+ 1 more
- cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*
- cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:*
Patches
Vulnerability mechanics
References
16- github.com/smarty-php/smarty/commit/215d81a9fa3cd63d82fb3ab56ecaf97cf1e7db71nvdPatchThird Party AdvisoryWEB
- github.com/advisories/GHSA-29gp-2c3m-3j6mghsaADVISORY
- github.com/smarty-php/smarty/releases/tag/v3.1.42nvdRelease NotesThird Party AdvisoryWEB
- github.com/smarty-php/smarty/releases/tag/v4.0.2nvdRelease NotesThird Party AdvisoryWEB
- github.com/smarty-php/smarty/security/advisories/GHSA-29gp-2c3m-3j6mnvdThird Party AdvisoryWEB
- lists.debian.org/debian-lts-announce/2022/05/msg00005.htmlnvdMailing ListThird Party AdvisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2021-29454ghsaADVISORY
- packagist.org/packages/smarty/smartynvdProductThird Party AdvisoryWEB
- security.gentoo.org/glsa/202209-09nvdThird Party AdvisoryWEB
- www.debian.org/security/2022/dsa-5151nvdThird Party AdvisoryWEB
- www.smarty.net/docs/en/language.function.math.tplnvdVendor AdvisoryWEB
- github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2021-29454.yamlghsaWEB
- lists.fedoraproject.org/archives/list/[email protected]/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQghsaWEB
- lists.fedoraproject.org/archives/list/[email protected]/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNIghsaWEB
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/nvd
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/nvd
News mentions
0No linked articles in our index yet.