Vulnerability · Published May 24, 2022 · Assigned by GitHub_M
CVE-2022-29221PHP Code Injection by malicious block or filename in Smarty
High 8.8
In plain English
A high-severity code injection in smarty from smarty-php. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 4.9% (higher than 92% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | smarty3 | 3.1.45-1 | DEBIAN-CVE-2022-29221 |
| Debian:13 | smarty3 | 3.1.45-1 | DEBIAN-CVE-2022-29221 |
| Debian:14 | smarty3 | 3.1.45-1 | DEBIAN-CVE-2022-29221 |
| Debian:12 | smarty4 | 4.1.1-1 | DEBIAN-CVE-2022-29221 |
| Debian:13 | smarty4 | 4.1.1-1 | DEBIAN-CVE-2022-29221 |
| Debian:14 | smarty4 | 4.1.1-1 | DEBIAN-CVE-2022-29221 |
| Packagist | smarty/smarty | 4.1.1 | GHSA-634x-pc3q-cf4c |
| Packagist | smarty/smarty | 3.1.45 | GHSA-634x-pc3q-cf4c |
| Ubuntu:22.04:LTS | gosa | no fix listed | UBUNTU-CVE-2022-29221 |
| Ubuntu:24.04:LTS | gosa | no fix listed | UBUNTU-CVE-2022-29221 |
| Ubuntu:25.10 | gosa | no fix listed | UBUNTU-CVE-2022-29221 |
| Ubuntu:26.04:LTS | gosa | no fix listed | UBUNTU-CVE-2022-29221 |
| Ubuntu:26.10 | gosa | no fix listed | UBUNTU-CVE-2022-29221 |
| Ubuntu:22.04:LTS | smarty3 | 3.1.39-2ubuntu1.22.04.1 | UBUNTU-CVE-2022-29221 |
| Ubuntu:22.04:LTS | smarty3 | 3.1.39-2ubuntu1.22.04.1 | USN-6012-1 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| smarty-php | smarty | < 3.1.45>= 4.0.0, < 4.1.1 |
Weakness: CWE-94 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
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
- [debian-lts-announce] 20220529 [SECURITY] [DLA 3033-1] smarty3 security update mailing-list
- DSA-5151 vendor-advisory
- GLSA-202209-09 vendor-advisory
- FEDORA-2022-52154efd61 vendor-advisory
- FEDORA-2022-d5fc9dcdd7 vendor-advisory