{"id":"CVE-2021-21408","aliases":["CVE-2021-21408","GHSA-4h9c-v5vg-5m6m"],"related":[],"kind":"vulnerability","state":"published","title":"Access to restricted PHP code by dynamic static class access in smarty","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"en","text":"### Impact\nTemplate authors could run restricted static php methods.\n\n### Patches\nPlease upgrade to 3.1.40 or higher.\n\n### References\nSee the [documentation on Smarty security features](https://www.smarty.net/docs/en/advanced.features.tpl#advanced.features.security) on the static_classes access filter.\n\n### For more information\nIf you have any questions or comments about this advisory please open an issue in [the Smarty repo](https://github.com/smarty-php/smarty)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Smarty es un motor de plantillas para PHP que facilita la separación de la presentación (HTML/CSS) de la lógica de la aplicación. Antes de las versiones 3.1.43 y 4.0.3, los autores de plantillas podían ejecutar métodos estáticos restringidos de php. Los usuarios deben actualizar a la versión 3.1.43 o 4.0.3 para recibir el parche","source":"nvd"}],"published":"2022-01-10T00:00:00.000Z","modified":"2026-07-08T06:28:50.962Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:S/C:P/I:P/A:P","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-20"],"affected":[{"ranges":[{"version":"< 3.1.43","status":"affected"},{"version":">= 4.0.0, < 4.0.3","status":"affected"}],"vendor":"smarty-php","product":"smarty","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.43"}],"ecosystem":"Packagist","package":"smarty/smarty","purl":"pkg:composer/smarty/smarty","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.0.0","status":"affected","fixed":"4.0.3"}],"ecosystem":"Packagist","package":"smarty/smarty","purl":"pkg:composer/smarty/smarty","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.1.43"},{"status":"affected","introduced":"4.0.0","fixed":"4.0.3"}],"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"},{"ranges":[{"status":"affected","version":"36"},{"status":"affected","version":"37"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/smarty-php/smarty/security/advisories/GHSA-4h9c-v5vg-5m6m","tags":["third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/commit/19ae410bf56007a5ef24441cdc6414619cfaf664","tags":["patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v3.1.43","tags":["release-notes","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v4.0.3","tags":["release-notes","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/05/msg00005.html","tags":["mailing-list","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.debian.org/security/2022/dsa-5151","tags":["third-party-advisory","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://security.gentoo.org/glsa/202209-09","tags":["third-party-advisory","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/","tags":["vendor-advisory","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/","tags":["vendor-advisory","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21408","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2021-21408.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/smarty-php/smarty","tags":["package"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2025-04-23T15:57:17.189Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-21408","url":"https://www.cve.org/CVERecord?id=CVE-2021-21408","licence":"CVE Terms of Use","modified":"2025-04-23T19:14:12.719Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4h9c-v5vg-5m6m","url":"https://github.com/advisories/GHSA-4h9c-v5vg-5m6m","licence":"CC-BY-4.0","modified":"2026-07-08T06:28:50.962Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-21408","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21408","licence":"Public domain","modified":"2026-06-17T03:35:30.470Z"}],"updatedAt":"2026-11-25T22:58:06.453Z","epss":{"score":0.02143,"percentile":0.82591,"date":"2026-12-01T12:00:22.000Z"}}