{"id":"CVE-2021-26120","published":"2021-02-22T01:38:15Z","modified":"2024-08-03T20:19:20Z","title":"Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring","vendor":null,"product":null,"tier":"core","eol":null,"description":{"text":"Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring.","provenance":"source","from":"CVE.org"},"summary":{"text":"The flaw is in Smarty, the PHP template engine, prior to version 3.1.39, where the template parser mishandles a function name that follows a \"{function name=\" substring. An attacker can exploit this to inject code, though the available record does not specify the required network access, authentication, user interaction, or configuration.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-10-29T07:23:35Z"},"cvss":null,"epss":{"score":0.82316,"percentile":0.99661,"date":"2026-11-03","provenance":"source"},"kev":null,"vulncheckKev":null,"exploited":false,"otx":{"pulseCount":0,"pulses":[],"provenance":"machine"},"cwes":[],"references":[{"url":"https://github.com/smarty-php/smarty/blob/master/CHANGELOG.md","tags":["x_refsource_MISC"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/04/msg00004.html","tags":["mailing-list","x_refsource_MLIST"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/04/msg00014.html","tags":["mailing-list","x_refsource_MLIST"]},{"url":"https://security.gentoo.org/glsa/202105-06","tags":["vendor-advisory","x_refsource_GENTOO"]},{"url":"https://www.debian.org/security/2022/dsa-5151","tags":["vendor-advisory","x_refsource_DEBIAN"]}],"techniques":[],"reports":[],"affected":[{"ecosystem":"Packagist","package":"smarty/smarty","vulnerableRanges":["<3.1.39"],"patched":["3.1.39"],"from":["GHSA-3rpf-5rqv-689q"],"provenance":"source"}],"advisories":[{"id":"GHSA-3rpf-5rqv-689q","url":"https://github.com/advisories/GHSA-3rpf-5rqv-689q","severity":"CRITICAL","ecosystem":"Packagist","package":"smarty/smarty","vulnerableRanges":["<3.1.39"],"patched":["3.1.39"],"provenance":"source","from":"GHSA"}],"euvd":{"id":"EUVD-2021-0528","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2021-0528","exploited":false,"exploitedSince":null,"provenance":"source"},"exploits":[],"exploitSources":null,"exploitRefs":[],"flow":[],"timeline":[{"date":"2021-02-22","kind":"published","label":"Published (CVE.org)","url":"https://www.cve.org/CVERecord?id=CVE-2021-26120","provenance":"source"}],"speed":{"daysToPublicExploit":null,"firstExploitFrom":null,"daysToKev":null},"priority":{"score":19.9,"factors":[{"name":"In a KEV catalog","points":0.0,"detail":"not listed"},{"name":"Recent KEV listing","points":0.0,"detail":"not listed"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":19.93,"detail":"percentile 0.9966"},{"name":"Named in threat reports","points":0.0,"detail":"0 reports"},{"name":"Public exploit code","points":0.0,"detail":"none found"},{"name":"Mentioned in OTX pulses","points":0.0,"detail":"0 pulses"},{"name":"CVSS severity","points":0.0,"detail":"no CVSS"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]},"lineage":{"familyId":"fam-smarty-php-smarty-cve-2021-26120","children":[{"from":"CVE-2021-26120","to":"CVE-2022-29221","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["libs/sysplugins/smarty_internal_compile_function.php"],"commits":["https://github.com/smarty-php/smarty/commit/165f1bd4d2eec328cfeaca517a725b46001de838","https://github.com/smarty-php/smarty/commit/64ad6442ca1da31cefdab5c9874262b702cccddd"],"basis":"shared function","functions":["compile"]}]}],"packageHistory":[{"cve":"CVE-2018-13982","published":"2018-09-18","fixed":"3.1.33","kev":false},{"cve":"CVE-2018-16831","published":"2018-09-11","fixed":"3.1.33","kev":false},{"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-26120","to":"CVE-2021-29454","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Packagist:smarty/smarty","fromFixed":"3.1.39","toFixed":"3.1.42","daysApart":322}]}},{"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}],"package":"Packagist:smarty/smarty"}}