{"id":"CVE-2021-21408","published":"2022-01-10T00:00:00Z","modified":"2025-04-23T19:14:12Z","title":"Access to restricted PHP code by dynamic static class access in smarty","vendor":"smarty-php","product":"smarty","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.02143,"percentile":0.82516,"provenance":"source"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"https://github.com/smarty-php/smarty/security/advisories/GHSA-4h9c-v5vg-5m6m","tags":[]},{"url":"https://github.com/smarty-php/smarty/commit/19ae410bf56007a5ef24441cdc6414619cfaf664","tags":[]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v3.1.43","tags":[]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v4.0.3","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2022/05/msg00005.html","tags":["mailing-list"]},{"url":"https://www.debian.org/security/2022/dsa-5151","tags":["vendor-advisory"]},{"url":"https://security.gentoo.org/glsa/202209-09","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/","tags":["vendor-advisory"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/","tags":["vendor-advisory"]}],"priority":{"score":22.7,"factors":[{"name":"EPSS percentile","points":16.5},{"name":"CVSS severity","points":6.16}]},"vendorSlug":"smarty-php","affectedVersions":[{"vendor":"smarty-php","product":"smarty","versions":["< 3.1.43",">= 4.0.0, < 4.0.3"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-04-23T15:57:17.189839Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"smarty/smarty","vulnerableRanges":["<3.1.43",">=4.0.0, <4.0.3"],"patched":["3.1.43","4.0.3"],"from":["GHSA-4h9c-v5vg-5m6m"],"provenance":"source"}],"summary":{"text":"The flaw lies in the Smarty PHP template engine (product smarty, vendor smarty-php), where template authors were able to invoke restricted static PHP methods before versions 3.1.43 and 4.0.3, owing to improper input validation. An attacker with low-privileged access that lets them author or supply templates can exploit this over the network with low complexity and no user interaction, gaining high confidentiality, integrity and availability impact.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:40:48Z"},"euvd":{"id":"EUVD-2022-0443","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2021-26119","published":"2021-02-22","fixed":"3.1.39","kev":false},{"cve":"CVE-2021-26120","published":"2021-02-22","fixed":"3.1.39","kev":false},{"cve":"CVE-2021-29454","published":"2022-01-10","fixed":"4.0.2","kev":false,"link":{"from":"CVE-2021-29454","to":"CVE-2021-21408","relation":"successor","confidence":"low","kind":"sequence","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:smarty/smarty","fromFixed":"3.1.42","toFixed":"3.1.43","daysApart":0},{"kind":"version-step","provenance":"source","package":"Packagist:smarty/smarty","fromFixed":"4.0.2","toFixed":"4.0.3","daysApart":0}]}},{"cve":"CVE-2021-21408","published":"2022-01-10","fixed":"4.0.3","kev":false},{"cve":"CVE-2022-29221","published":"2022-05-24","fixed":"4.1.1","kev":false,"link":{"from":"CVE-2021-21408","to":"CVE-2022-29221","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:smarty/smarty","fromFixed":"3.1.43","toFixed":"3.1.45","daysApart":134},{"kind":"version-step","provenance":"source","package":"Packagist:smarty/smarty","fromFixed":"4.0.3","toFixed":"4.1.1","daysApart":134}]}},{"cve":"CVE-2018-25047","published":"2022-09-14","fixed":"4.2.1","kev":false},{"cve":"CVE-2023-28447","published":"2023-03-28","fixed":"4.3.1","kev":false}],"package":"Packagist:smarty/smarty"}}