CVE-2022-29221PHP Code Injection by malicious block or filename in Smarty
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.
What to do
Fixed builds are available from Debian, Packagist, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | gosa | Fix pending | UBUNTU-CVE-2022-29221 | |
| Ubuntu 26.04 | gosa | Under investigation | UBUNTU-CVE-2022-29221 | |
| Ubuntu 26.04 | postfixadmin | Not affected vulnerable_code_not_present | ||
| Ubuntu 26.04 | smarty4 | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | gosa | Will not fix postfixadmin does not contain embedded copies of smarty in trusty and xenial. In bionic, postfixadmin contains an embedded smarty copy at version 3.1.29,… | UBUNTU-CVE-2022-29221 | |
| Ubuntu 25.10 | postfixadmin | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | smarty4 | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | gosa | Under investigation | UBUNTU-CVE-2022-29221 | |
| Ubuntu 24.04 | smarty4 | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | gosa | Under investigation | UBUNTU-CVE-2022-29221 | |
| Ubuntu 22.04 | postfixadmin | Fix pending | 3.3.10-2ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2022-29221 |
| Ubuntu 22.04 | smarty3 | Fixed | 3.1.39-2ubuntu1.22.04.1 | UBUNTU-CVE-2022-29221 |
| Ubuntu 20.04 | gosa | Will not fix postfixadmin does not contain embedded copies of smarty in trusty and xenial. In bionic, postfixadmin contains an embedded smarty copy at version 3.1.29,… | UBUNTU-CVE-2022-29221 | |
| Ubuntu 20.04 | postfixadmin | Fix pending | 3.2.1-3ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2022-29221 |
| Ubuntu 20.04 | smarty3 | Fix pending | UBUNTU-CVE-2022-29221 | |
| Ubuntu 18.04 | gosa | Will not fix postfixadmin does not contain embedded copies of smarty in trusty and xenial. In bionic, postfixadmin contains an embedded smarty copy at version 3.1.29,… | UBUNTU-CVE-2022-29221 | |
| Ubuntu 18.04 | postfixadmin | Fix pending | 3.0.2-2ubuntu0.1~esm1 (Ubuntu Pro) | UBUNTU-CVE-2022-29221 |
| Ubuntu 18.04 | smarty3 | Fix pending | UBUNTU-CVE-2022-29221 | |
| Ubuntu 16.04 | collabtive | Fix pending | UBUNTU-CVE-2022-29221 | |
| Ubuntu 16.04 | galette | Fix pending | UBUNTU-CVE-2022-29221 | |
| Ubuntu 16.04 | gosa | Fix pending | UBUNTU-CVE-2022-29221 | |
| Ubuntu 16.04 | smarty3 | Fix pending | UBUNTU-CVE-2022-29221 | |
| Debian 14 | smarty3 | Fixed | 3.1.45-1 | DEBIAN-CVE-2022-29221 |
| Debian 14 | smarty4 | Fixed | 4.1.1-1 | DEBIAN-CVE-2022-29221 |
| Debian 13 | smarty3 | Fixed | 3.1.45-1 | DEBIAN-CVE-2022-29221 |
| Debian 13 | smarty4 | Fixed | 4.1.1-1 | DEBIAN-CVE-2022-29221 |
| Debian 12 | smarty3 | Fixed | 3.1.45-1 | DEBIAN-CVE-2022-29221 |
| Debian 12 | smarty4 | Fixed | 4.1.1-1 | DEBIAN-CVE-2022-29221 |
| Packagist library | smarty/smarty | Fixed | 3.1.45 | GHSA-634x-pc3q-cf4c |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- smarty-php smarty: affected: < 3.1.45, >= 4.0.0, < 4.1.1
Vendor advisories:
- https://www.debian.org/security/2022/dsa-5151 (vendor-advisory)
- https://security.gentoo.org/glsa/202209-09 (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
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/
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.