CVE-2022-29221 json
PHP Code Injection by malicious block or filename in Smarty
published 2022-05-24 4 y ago modified 2026-06-17 4 mo ago also GHSA-634x-pc3q-cf4c , EUVD-2022-2696
- cvss
- 8.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 4.9%
- EPSS 4.9% chance of exploitation in 30 days, percentile 92%
- public exploits
- 0
- none known
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.
Patch / fix
- packagist smarty/smarty 3.1.45, 4.1.1
- smarty smarty 3.1.45, 4.1.1
- smarty3 Debian 14, Debian 13, Debian 12 3.1.45-1
- smarty4 Debian 14, Debian 13, Debian 12 4.1.1-1
debian advisories DEBIAN-CVE-2022-29221
- smarty3 Ubuntu 22.04 LTS 3.1.39-2ubuntu1.22.04.1
- postfixadmin Ubuntu Pro 18.04 LTS 3.0.2-2ubuntu0.1~esm1
- postfixadmin Ubuntu Pro 20.04 LTS 3.2.1-3ubuntu0.1~esm1
- postfixadmin Ubuntu Pro 22.04 LTS 3.3.10-2ubuntu0.1~esm1
ubuntu advisories UBUNTU-CVE-2022-29221
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-29221 updated
php-Smarty: php injection via malicious block name or include file name
-
Red Hat All currently supported Red Hat productsnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 18 mo ago
Exploit prediction
4.91% chance of exploitation in the next 30 days, higher than 92% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.5 | AV:N/AC:L/Au:S/C:P/I:P/A:P |
| GitHub | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| packagist | smarty/smarty | <3.1.45 >=4.0.0, <4.1.1 |
3.1.45 4.1.1 |
Affected products
- smarty-php smarty
Classification
- Weakness
-
- CWE-94 Improper Control of Generation of Code
References
-
github.com
/smarty-php/smarty/commit/64ad6442ca1da31cefdab5c9874262b702cccddd
web, patch, third-party-advisory
-
debian.org
/security/2022/dsa-5151
vendor-advisory, web, third-party-advisory
-
security.gentoo.org
/glsa/202209-09
vendor-advisory, web, third-party-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/
vendor-advisory
-
github.com
/smarty-php/smarty/security/advisories/GHSA-634x-pc3q-cf4c
web, third-party-advisory
-
github.com
/smarty-php/smarty/releases/tag/v3.1.45
web, release-notes, third-party-advisory
-
github.com
/smarty-php/smarty/releases/tag/v4.1.1
web, release-notes, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2022/05/msg00044.html
mailing-list, web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2022-29221
advisory
-
github.com
/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2022-29221.yaml
web
-
github.com
/smarty-php/smarty
package
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI
web
Sources
- CVE List CVE-2022-29221
- GitHub Advisory GHSA-634x-pc3q-cf4c
- NVD CVE-2022-29221
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.