CVE-2021-29454
mediumpriority · track · 36EPSS 0.018 · 78 %ileEURUUSEPSS · scored 2026-10-27
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 6.5–8.8
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (13)
Products and version ranges known to be affected.
advisories (1)
Vendor and ecosystem advisories describing this.
- GHSA-29gp-2c3m-3j6mSandbox Escape by math function in smarty2022-01-12ghsa · osvUS
### Impact Template authors could run arbitrary PHP code by crafting a malicious math string. If a math string is passed through as user provided data to the math function, external users could run arbitrary PHP code by crafting a malicious math string. ### Patches Please upgrade to 4.0.2 or 3.1.42 or higher. ### References See [documentation on Math function](https://www.smarty.net/docs/en/language.function.math.tpl). ### For more information If you have any questions or comments about this advisory please open an issue in [the Smarty repo](https://github.com/smarty-php/smarty)
also known as (5)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (39)
External citations — patches, advisories, analysis.
- https://github.com/smarty-php/smarty/commit/215d81a9fa3cd63d82fb3ab56ecaf97cf1e7db71cnnvd
- https://github.com/smarty-php/smarty/releases/tag/v3.1.42cnnvd
- https://github.com/smarty-php/smarty/releases/tag/v4.0.2cnnvd
- https://github.com/smarty-php/smarty/security/advisories/GHSA-29gp-2c3m-3j6mcnnvd
- https://lists.debian.org/debian-lts-announce/2022/05/msg00005.htmlcnnvd
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/cnnvd
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/cnnvd
- https://nvd.nist.gov/vuln/detail/CVE-2021-29454cnnvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan