{"id":"CVE-2021-26120","aliases":["CVE-2021-26120","GHSA-3rpf-5rqv-689q"],"related":[],"kind":"vulnerability","state":"published","title":"PHP Code Injection by malicious function name in smarty","summary":"Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring.","source":"cvelist"},{"lang":"en","text":"Template authors could inject php code by choosing a malicous {function} name. Sites that cannot fully trust template authors should update as soon as possible. Please upgrade to 3.1.39 or higher.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Smarty versiones anteriores a 3.1.39, permite una inyección de código por medio de un nombre de función no previsto después de una subcadena {function name=","source":"nvd"}],"published":"2021-02-22T01:38:15.000Z","modified":"2026-06-17T03:42:55.233Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.39"}],"ecosystem":"Packagist","package":"smarty/smarty","purl":"pkg:composer/smarty/smarty","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.1.39"}],"vendor":"smarty","product":"smarty","cpe":"cpe:2.3:a:smarty:smarty:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"9.0"},{"status":"affected","version":"10.0"},{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/smarty-php/smarty/blob/master/CHANGELOG.md","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/04/msg00004.html","tags":["mailing-list","third-party-advisory","web","x-refsource-mlist","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/04/msg00014.html","tags":["mailing-list","third-party-advisory","web","x-refsource-mlist","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://security.gentoo.org/glsa/202105-06","tags":["patch","third-party-advisory","vendor-advisory","web","x-refsource-gentoo","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.debian.org/security/2022/dsa-5151","tags":["third-party-advisory","vendor-advisory","web","x-refsource-debian","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/security/advisories/GHSA-3rpf-5rqv-689q","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26120","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/smarty-php/smarty/commit/165f1bd4d2eec328cfeaca517a725b46001de838","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2021-26120.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/smarty-php/smarty","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/smarty-php/smarty/blob/master/CHANGELOG.md#3139---2021-02-17","tags":["web"],"sources":["ghsa"]},{"url":"https://srcincite.io/blog/2021/02/18/smarty-template-engine-multiple-sandbox-escape-vulnerabilities.html","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-26120","url":"https://www.cve.org/CVERecord?id=CVE-2021-26120","licence":"CVE Terms of Use","modified":"2024-08-03T20:19:20.027Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3rpf-5rqv-689q","url":"https://github.com/advisories/GHSA-3rpf-5rqv-689q","licence":"CC-BY-4.0","modified":"2024-02-16T08:11:25.127Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-26120","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26120","licence":"Public domain","modified":"2026-06-17T03:42:55.233Z"}],"updatedAt":"2026-11-25T22:58:00.003Z","epss":{"score":0.82316,"percentile":0.99664,"date":"2026-12-01T12:00:22.000Z"}}