{"schemaVersion":3,"id":"CVE-2021-29454","aliases":["UBUNTU-CVE-2021-29454","DEBIAN-CVE-2021-29454"],"status":"published","duplicateOf":null,"title":null,"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.","dates":{"published":"2022-01-10T00:00:00.000Z","modified":"2025-04-23T19:14:05.629Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":8.8,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":8.1,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","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","exploitability":7.2,"impact":9.8,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Debian","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","exploitability":7.2,"impact":9.8,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","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","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":6.5,"severity":"medium","vector":"AV:N/AC:L/Au:S/C:P/I:P/A:P","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.01927,"percentile":0.79684,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.01927},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.01927,"percentile":0.79684}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.01927,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.01927,"percentile":0.79684}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')","description":"The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.","type":"weakness","status":"Incomplete","abstraction":"Class","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/74.html"}],"affected":[{"vendor":"debian","product":"smarty3","name":"smarty3","label":"smarty3","ecosystem":"Debian","cpePart":null,"purl":"pkg:deb/debian/smarty3","purlType":"deb","versions":[{"text":"< 3.1.45-1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 3.1.45-1","eol":null,"hubHref":null},{"vendor":"debian","product":"smarty4","name":"smarty4","label":"smarty4","ecosystem":"Debian","cpePart":null,"purl":"pkg:deb/debian/smarty4","purlType":"deb","versions":[{"text":"< 4.1.1-1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 4.1.1-1","eol":null,"hubHref":null},{"vendor":"ubuntu","product":"smarty3","name":"smarty3","label":"smarty3","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/smarty3","purlType":"deb","versions":[{"text":"< 3.1.21-1ubuntu1+esm1","noFixRecorded":false,"fixedIn":null},{"text":"< 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1","noFixRecorded":false,"fixedIn":null},{"text":"< 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1~esm1","noFixRecorded":false,"fixedIn":null},{"text":"< 3.1.39-2ubuntu1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 3.1.21-1ubuntu1+esm1 | < 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1 | < 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1~esm1 | < 3.1.39-2ubuntu1","eol":null,"hubHref":null},{"vendor":"debian","product":"debian_linux","name":"debian linux","label":"debian_linux","ecosystem":null,"cpePart":"o","purl":null,"purlType":null,"versions":[{"text":"9.0","noFixRecorded":false,"fixedIn":null},{"text":"10.0","noFixRecorded":false,"fixedIn":null},{"text":"11.0","noFixRecorded":false,"fixedIn":null}],"versionsText":"9.0 | 10.0 | 11.0","eol":{"isEol":true,"eolDate":"2022-07-01T00:00:00.000Z","matchMethod":"cpe","cycle":{"name":"9","label":"9 (Stretch)","eolFrom":"2022-07-01T00:00:00.000Z","isLts":false,"isMaintained":true,"latestVersion":"9.13"},"product":{"name":"debian","label":"Debian","category":"os"}},"hubHref":"/vendor/debian/debian_linux"},{"vendor":"fedoraproject","product":"fedora","name":"fedora","label":"fedora","ecosystem":null,"cpePart":"o","purl":null,"purlType":null,"versions":[{"text":"36","noFixRecorded":false,"fixedIn":null},{"text":"37","noFixRecorded":false,"fixedIn":null}],"versionsText":"36 | 37","eol":{"isEol":true,"eolDate":"2023-05-16T00:00:00.000Z","matchMethod":"cpe","cycle":{"name":"36","label":"36","eolFrom":"2023-05-16T00:00:00.000Z","isLts":false,"isMaintained":false,"latestVersion":null},"product":{"name":"fedora","label":"Fedora Linux","category":"os"}},"hubHref":"/vendor/fedoraproject/fedora"},{"vendor":"smarty-php","product":"smarty","name":"smarty","label":"smarty","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 3.1.42","noFixRecorded":false,"fixedIn":null},{"text":"≥ 4.0.0, < 4.0.2","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 3.1.42 | ≥ 4.0.0, < 4.0.2","eol":null,"hubHref":"/vendor/smarty-php/smarty"},{"vendor":"smarty","product":"smarty","name":"smarty","label":"smarty","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 3.1.42","noFixRecorded":false,"fixedIn":null},{"text":"≥ 4.0.0, < 4.0.2","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 3.1.42 | ≥ 4.0.0, < 4.0.2","eol":null,"hubHref":"/vendor/smarty/smarty"}],"affectedCount":7,"eol":{"hasEol":true,"count":2},"references":[{"url":"https://github.com/smarty-php/smarty/security/advisories/GHSA-29gp-2c3m-3j6m","label":"github.com/smarty-php/smarty/security/advisories/GHSA-29gp-2c3m-3j6m","hostname":"github.com","tags":["REPORT","Third Party Advisory"]},{"url":"https://github.com/smarty-php/smarty/commit/215d81a9fa3cd63d82fb3ab56ecaf97cf1e7db71","label":"github.com/smarty-php/smarty/commit/215d81a9fa3cd63d82fb3ab56ecaf97cf1e7db71","hostname":"github.com","tags":["REPORT","Patch","Third Party Advisory"]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v3.1.42","label":"github.com/smarty-php/smarty/releases/tag/v3.1.42","hostname":"github.com","tags":["REPORT","Release Notes","Third Party Advisory"]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v4.0.2","label":"github.com/smarty-php/smarty/releases/tag/v4.0.2","hostname":"github.com","tags":["REPORT","Release Notes","Third Party Advisory"]},{"url":"https://packagist.org/packages/smarty/smarty","label":"packagist.org/packages/smarty/smarty","hostname":"packagist.org","tags":["REPORT","Product","Third Party Advisory"]},{"url":"https://www.smarty.net/docs/en/language.function.math.tpl","label":"www.smarty.net/docs/en/language.function.math.tpl","hostname":"www.smarty.net","tags":["REPORT","Vendor Advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/05/msg00005.html","label":"lists.debian.org/debian-lts-announce/2022/05/msg00005.html","hostname":"lists.debian.org","tags":["Mailing List","Third Party Advisory"]},{"url":"https://www.debian.org/security/2022/dsa-5151","label":"www.debian.org/security/2022/dsa-5151","hostname":"www.debian.org","tags":["Vendor Advisory","Third Party Advisory"]},{"url":"https://security.gentoo.org/glsa/202209-09","label":"security.gentoo.org/glsa/202209-09","hostname":"security.gentoo.org","tags":["Vendor Advisory","Third Party Advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/","label":"lists.fedoraproject.org/archives/…","hostname":"lists.fedoraproject.org","tags":["Vendor Advisory"]},{"url":"https://ubuntu.com/security/CVE-2021-29454","label":"ubuntu.com/security/CVE-2021-29454","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://ubuntu.com/security/notices/USN-5348-1","label":"ubuntu.com/security/notices/USN-5348-1","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://ubuntu.com/security/notices/USN-5348-3","label":"ubuntu.com/security/notices/USN-5348-3","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://ubuntu.com/security/notices/USN-5348-2","label":"ubuntu.com/security/notices/USN-5348-2","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-29454","label":"www.cve.org/CVERecord?id=CVE-2021-29454","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2021-29454","label":"security-tracker.debian.org/tracker/CVE-2021-29454","hostname":"security-tracker.debian.org","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":["DLA-2995-1","DSA-5151-1","MGASA-2022-0127","USN-5348-1","USN-5348-2","USN-5348-3"],"duplicates":[],"related":["USN-5348-1","USN-5348-2","USN-5348-3"]},"timeline":[{"kind":"published","date":"2022-01-10T00:00:00.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2025-04-23T19:14:05.629Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":36,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T20:57:54.041Z","stale":false,"partial":false}}