CVE-2022-29221
PHP Code Injection by malicious block or filename in Smarty
- State
- Published
- Severity
- 8.8 High
- Published
- May 24, 2022
- Updated
- Apr 23, 2025
- Reserved
- Apr 13, 2022
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.
Scores
| CVSS | Score | Vector | Source |
|---|---|---|---|
| 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_M |
Weaknesses
- CWE-94 Improper Control of Generation of Code ('Code Injection')
Affected Products
| Product | Versions |
|---|---|
smartysmarty-php |
|
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 updatemailing-list
- DSA-5151vendor-advisory
- GLSA-202209-09vendor-advisory
- FEDORA-2022-52154efd61vendor-advisory
- FEDORA-2022-d5fc9dcdd7vendor-advisory
Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.