CVE-2022-29221
PHP Code Injection by malicious block or filename in Smarty
Severity Score
Exploit Likelihood
Affected Versions
Public Exploits
1Exploited in Wild
-Decision
Descriptions
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.
Smarty es un motor de plantillas para PHP, que facilita la separación de la presentación (HTML/CSS) de la lógica de la aplicación. En versiones anteriores a 3.1.45 y 4.1.1, los autores de plantillas podían inyectar código php eligiendo un nombre de archivo {block} o {include} malicioso. Los sitios que no pueden confiar plenamente en los autores de plantillas deben actualizar a versiones 3.1.45 o 4.1.1 para recibir un parche para este problema. Actualmente no se presentan mitigaciones conocidas
It was discovered that Smarty, that is integrated in the PostfixAdmin code, was not properly sanitizing user input when generating templates. An attacker could, through PHP injection, possibly use this issue to execute arbitrary code. It was discovered that Moment.js, that is integrated in the PostfixAdmin code, was using an inefficient parsing algorithm when processing date strings in the RFC 2822 standard. An attacker could possibly use this issue to cause a denial of service.
CVSS Scores
SSVC
- Decision:-
Timeline
- 2022-04-13 CVE Reserved
- 2022-05-24 CVE Published
- 2022-05-25 First Exploit
- 2024-08-03 CVE Updated
- 2025-03-30 EPSS Updated
- ---------- Exploited in Wild
- ---------- KEV Due Date
CWE
- CWE-94: Improper Control of Generation of Code ('Code Injection')
CAPEC
References (10)
URL | Tag | Source |
---|---|---|
https://github.com/smarty-php/smarty/releases/tag/v3.1.45 | Release Notes | |
https://github.com/smarty-php/smarty/releases/tag/v4.1.1 | Release Notes | |
https://github.com/smarty-php/smarty/security/advisories/GHSA-634x-pc3q-cf4c | Third Party Advisory | |
https://lists.debian.org/debian-lts-announce/2022/05/msg00044.html | Mailing List |
|
URL | Date | SRC |
---|---|---|
https://github.com/sbani/CVE-2022-29221-PoC | 2022-05-25 |
URL | Date | SRC |
---|---|---|
https://github.com/smarty-php/smarty/commit/64ad6442ca1da31cefdab5c9874262b702cccddd | 2023-11-07 |
Affected Vendors, Products, and Versions
Vendor | Product | Version | Other | Status | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Vendor | Product | Version | Other | Status | <-- --> | Vendor | Product | Version | Other | Status |
Smarty Search vendor "Smarty" | Smarty Search vendor "Smarty" for product "Smarty" | < 3.1.45 Search vendor "Smarty" for product "Smarty" and version " < 3.1.45" | - |
Affected
| ||||||
Smarty Search vendor "Smarty" | Smarty Search vendor "Smarty" for product "Smarty" | >= 4.0.0 < 4.1.1 Search vendor "Smarty" for product "Smarty" and version " >= 4.0.0 < 4.1.1" | - |
Affected
| ||||||
Debian Search vendor "Debian" | Debian Linux Search vendor "Debian" for product "Debian Linux" | 9.0 Search vendor "Debian" for product "Debian Linux" and version "9.0" | - |
Affected
| ||||||
Debian Search vendor "Debian" | Debian Linux Search vendor "Debian" for product "Debian Linux" | 10.0 Search vendor "Debian" for product "Debian Linux" and version "10.0" | - |
Affected
| ||||||
Debian Search vendor "Debian" | Debian Linux Search vendor "Debian" for product "Debian Linux" | 11.0 Search vendor "Debian" for product "Debian Linux" and version "11.0" | - |
Affected
| ||||||
Fedoraproject Search vendor "Fedoraproject" | Fedora Search vendor "Fedoraproject" for product "Fedora" | 36 Search vendor "Fedoraproject" for product "Fedora" and version "36" | - |
Affected
| ||||||
Fedoraproject Search vendor "Fedoraproject" | Fedora Search vendor "Fedoraproject" for product "Fedora" | 37 Search vendor "Fedoraproject" for product "Fedora" and version "37" | - |
Affected
|