# CVE-2022-29221: PHP Code Injection by malicious block or filename in Smarty

- Severity: High 8.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 4.91%, higher than 92% of CVEs (2026-12-01)
- Published: 2022-05-24T00:00:00.000Z
- Modified: 2026-06-17T04:39:51.637Z
- Also known as: GHSA-634x-pc3q-cf4c
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- smarty-php smarty: < 3.1.45; >= 4.0.0, < 4.1.1
- smarty/smarty (Packagist): before 3.1.45; from 4.0.0 before 4.1.1
- smarty smarty: before 3.1.45; from 4.0.0 before 4.1.1
- debian debian_linux: 9.0; 10.0; 11.0
- fedoraproject fedora: 36; 37

## Every score

- GitHub_M: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 6.5 Medium `AV:N/AC:L/Au:S/C:P/I:P/A:P`

## References

- <https://github.com/smarty-php/smarty/security/advisories/GHSA-634x-pc3q-cf4c> (third-party-advisory, web)
- <https://github.com/smarty-php/smarty/commit/64ad6442ca1da31cefdab5c9874262b702cccddd> (patch, third-party-advisory, web)
- <https://github.com/smarty-php/smarty/releases/tag/v3.1.45> (release-notes, third-party-advisory, web)
- <https://github.com/smarty-php/smarty/releases/tag/v4.1.1> (release-notes, third-party-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2022/05/msg00044.html> (mailing-list, third-party-advisory, web)
- <https://www.debian.org/security/2022/dsa-5151> (third-party-advisory, vendor-advisory, web)
- <https://security.gentoo.org/glsa/202209-09> (third-party-advisory, vendor-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/> (vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/> (vendor-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-29221> (advisory)
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2022-29221.yaml> (web)
- <https://github.com/smarty-php/smarty> (package)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI> (web)

## Sources

- CVE List: [CVE-2022-29221](https://www.cve.org/CVERecord?id=CVE-2022-29221), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-634x-pc3q-cf4c](https://github.com/advisories/GHSA-634x-pc3q-cf4c), CC-BY-4.0, modified 2024-02-21
- NVD: [CVE-2022-29221](https://nvd.nist.gov/vuln/detail/CVE-2022-29221), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-29221 · Whole record: https://cve.day/CVE-2022-29221.json · Rebuilt by cve.day 2026-11-25T22:58:11.915Z
