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

- Priority: **Routine**
- Reason: Not severe (CVSS 8.8, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2022-05-24 · Modified: 2025-04-23
- Aliases: MGASA-2022-0226, UBUNTU-CVE-2022-29221, USN-6012-1, DEBIAN-CVE-2022-29221, DLA-3033-1
- Record: https://cvemate.com/vulnerability/CVE-2022-29221 · JSON: https://cvemate.com/vulnerability/CVE-2022-29221/json

## Description

```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.
```

## Signals

- CVSS: 8.8 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 4.914%, percentile 92.362%, as of 2026-12-05
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- debian smarty3 (Debian): \< 3.1.31+20161214.1.c7d42e4+selfpack1-2+deb9u6 \| \< 3.1.45-1
- debian smarty4 (Debian): \< 4.1.1-1
- ubuntu collabtive (Ubuntu): All versions (No fix recorded)
- ubuntu galette (Ubuntu): All versions (No fix recorded)
- ubuntu gosa (Ubuntu): All versions (No fix recorded)
- ubuntu postfixadmin (Ubuntu): \< 3.0.2-2ubuntu0.1~esm1 \| \< 3.2.1-3ubuntu0.1~esm1 \| \< 3.3.10-2ubuntu0.1~esm1
- ubuntu smarty3 (Ubuntu): All versions (No fix recorded) \| \< 3.1.39-2ubuntu1.22.04.1
- debian debian\_linux: 9.0 \| 10.0 \| 11.0
- fedoraproject fedora: 36 \| 37
- mageia php-smarty (Mageia): \< 4.1.1-1.mga8
- smarty-php smarty: \< 3.1.45 \| ≥ 4.0.0, \< 4.1.1
- smarty smarty: \< 3.1.45 \| ≥ 4.0.0, \< 4.1.1

## References

- <https://github.com/smarty-php/smarty/security/advisories/GHSA-634x-pc3q-cf4c>
- <https://github.com/smarty-php/smarty/commit/64ad6442ca1da31cefdab5c9874262b702cccddd>
- <https://github.com/smarty-php/smarty/releases/tag/v3.1.45>
- <https://github.com/smarty-php/smarty/releases/tag/v4.1.1>
- <https://lists.debian.org/debian-lts-announce/2022/05/msg00044.html>
- <https://www.debian.org/security/2022/dsa-5151>
- <https://security.gentoo.org/glsa/202209-09>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/>
- <https://advisories.mageia.org/MGASA-2022-0226.html>
- <https://bugs.mageia.org/show_bug.cgi?id=30495>
- <https://ubuntu.com/security/CVE-2022-29221>
- <https://github.com/smarty-php/smarty/commit/3606c4717ed6348e114a610ff1e446048dcd0345>
- <https://ubuntu.com/security/notices/USN-6012-1>
- <https://ubuntu.com/security/notices/USN-6550-1>
- <https://www.cve.org/CVERecord?id=CVE-2022-29221>
- <https://security-tracker.debian.org/tracker/CVE-2022-29221>

---

Data as of 2026-12-05T14:33:15.357Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
