{"id":"CVE-2021-29454","url":"https://www.cyber-defence.io/tools/cve/CVE-2021-29454","generatedAt":"2026-10-28T06:34:21.653Z","title":"Prior to versions 3.1.42 and 4.0.2, template authors could run arbitrary PHP code by crafting a malicious math string.","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.","published":"2022-01-10T20:15:08.000Z","lastModified":"2026-06-17T03:47:40.000Z","status":"Modified","sourceIdentifier":"security-advisories@github.com","cvss":{"version":"3.1","score":8.8,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"},"cwe":["CWE-74"],"affected":["smarty/smarty","debian/debian linux","fedoraproject/fedora"],"epss":{"score":0.01801,"percentile":0.7839,"date":"2026-10-27","history":[]},"kev":{"listed":false},"exploits":{"count":0,"verified":false,"firstPublished":null,"source":"Exploit-DB (https://gitlab.com/exploit-database/exploitdb)","entries":[]},"verdict":{"level":"high","text":"High impact if exploited, but EPSS currently rates exploitation as unlikely (1.80%). Schedule it in the normal patch cycle and watch for a rise in EPSS or a public exploit."},"changes":[],"references":[{"url":"https://github.com/smarty-php/smarty/commit/215d81a9fa3cd63d82fb3ab56ecaf97cf1e7db71","tags":["Patch","Third Party Advisory"],"source":"security-advisories@github.com"},{"url":"https://github.com/smarty-php/smarty/releases/tag/v3.1.42","tags":["Release Notes","Third Party Advisory"],"source":"security-advisories@github.com"},{"url":"https://github.com/smarty-php/smarty/releases/tag/v4.0.2","tags":["Release Notes","Third Party Advisory"],"source":"security-advisories@github.com"},{"url":"https://github.com/smarty-php/smarty/security/advisories/GHSA-29gp-2c3m-3j6m","tags":["Third Party Advisory"],"source":"security-advisories@github.com"},{"url":"https://lists.debian.org/debian-lts-announce/2022/05/msg00005.html","tags":["Mailing List","Third Party Advisory"],"source":"security-advisories@github.com"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/","source":"security-advisories@github.com"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/","source":"security-advisories@github.com"},{"url":"https://packagist.org/packages/smarty/smarty","tags":["Product","Third Party Advisory"],"source":"security-advisories@github.com"},{"url":"https://security.gentoo.org/glsa/202209-09","tags":["Third Party Advisory"],"source":"security-advisories@github.com"},{"url":"https://www.debian.org/security/2022/dsa-5151","tags":["Third Party Advisory"],"source":"security-advisories@github.com"},{"url":"https://www.smarty.net/docs/en/language.function.math.tpl","tags":["Vendor Advisory"],"source":"security-advisories@github.com"},{"url":"https://github.com/smarty-php/smarty/commit/215d81a9fa3cd63d82fb3ab56ecaf97cf1e7db71","tags":["Patch","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://github.com/smarty-php/smarty/releases/tag/v3.1.42","tags":["Release Notes","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://github.com/smarty-php/smarty/releases/tag/v4.0.2","tags":["Release Notes","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://github.com/smarty-php/smarty/security/advisories/GHSA-29gp-2c3m-3j6m","tags":["Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://lists.debian.org/debian-lts-announce/2022/05/msg00005.html","tags":["Mailing List","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/","source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://packagist.org/packages/smarty/smarty","tags":["Product","Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://security.gentoo.org/glsa/202209-09","tags":["Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://www.debian.org/security/2022/dsa-5151","tags":["Third Party Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"},{"url":"https://www.smarty.net/docs/en/language.function.math.tpl","tags":["Vendor Advisory"],"source":"af854a3a-2127-422b-91ae-364da2661108"}],"sources":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2021-29454","epss":"https://www.first.org/epss/","kev":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","exploitdb":"https://www.exploit-db.com/"},"licence":"CC BY 4.0 — link back to the CVE Explorer if you publish the results; upstream data remains subject to its own terms."}