{"id":"CVE-2022-29221","aliases":["CVE-2022-29221","GHSA-634x-pc3q-cf4c"],"related":[],"kind":"vulnerability","state":"published","title":"PHP Code Injection by malicious block or filename 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.45 and 4.1.1, template authors could inject php code by choosing a malicious {block} name or {include} file name. Sites that cannot fully trust template authors should upgrade to versions 3.1.45 or 4.1.1 to receive a patch for this issue. There are currently no known workarounds.","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.45 and 4.1.1, template authors could inject php code by choosing a malicious {block} name or {include} file name. Sites that cannot fully trust template authors should upgrade to versions 3.1.45 or 4.1.1 to receive a patch for this issue. There are currently no known workarounds.","source":"cvelist"},{"lang":"en","text":"### Impact\nTemplate authors could inject php code by choosing a malicous {block} name or {include} file name. Sites that cannot fully trust template authors should update asap.\n\n### Patches\nPlease upgrade to the most recent version of Smarty v3 or v4.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\n### References\n_Are there any links users can visit to find out more?_\n\n### For more information\nIf you have any questions or comments about this advisory:\n* 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. En versiones anteriores a 3.1.45 y 4.1.1, los autores de plantillas podían inyectar código php eligiendo un nombre de archivo {block} o {include} malicioso. Los sitios que no pueden confiar plenamente en los autores de plantillas deben actualizar a versiones 3.1.45 o 4.1.1 para recibir un parche para este problema. Actualmente no se presentan mitigaciones conocidas","source":"nvd"}],"published":"2022-05-24T00:00:00.000Z","modified":"2026-06-17T04:39:51.637Z","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-94"],"affected":[{"ranges":[{"version":"< 3.1.45","status":"affected"},{"version":">= 4.0.0, < 4.1.1","status":"affected"}],"vendor":"smarty-php","product":"smarty","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.1.45"}],"ecosystem":"Packagist","package":"smarty/smarty","purl":"pkg:composer/smarty/smarty","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.0.0","status":"affected","fixed":"4.1.1"}],"ecosystem":"Packagist","package":"smarty/smarty","purl":"pkg:composer/smarty/smarty","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.1.45"},{"status":"affected","introduced":"4.0.0","fixed":"4.1.1"}],"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-634x-pc3q-cf4c","tags":["third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/commit/64ad6442ca1da31cefdab5c9874262b702cccddd","tags":["patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v3.1.45","tags":["release-notes","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v4.1.1","tags":["release-notes","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/05/msg00044.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-2022-29221","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2022-29221.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:52:58.668Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-29221","url":"https://www.cve.org/CVERecord?id=CVE-2022-29221","licence":"CVE Terms of Use","modified":"2025-04-23T18:22:54.999Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-634x-pc3q-cf4c","url":"https://github.com/advisories/GHSA-634x-pc3q-cf4c","licence":"CC-BY-4.0","modified":"2024-02-21T05:31:14.008Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-29221","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-29221","licence":"Public domain","modified":"2026-06-17T04:39:51.637Z"}],"updatedAt":"2026-11-25T22:58:11.915Z","epss":{"score":0.04914,"percentile":0.923,"date":"2026-12-01T12:00:22.000Z"}}