Skip to content
OpenAdvisories
High · 8.8 Public exploit CVE-2022-29221 EUVD-2022-2696GHSA-634x-pc3q-cf4c

PHP Code Injection by malicious block or filename in Smarty

Published May 24, 2022 · Updated Apr 23, 2025 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
smarty-php smarty < 3.1.45, >= 4.0.0, < 4.1.1 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 smarty3 3.1.45-1 —
Debian 14 smarty4 4.1.1-1 —
Debian 13 smarty3 3.1.45-1 —
Debian 13 smarty4 4.1.1-1 —
Debian 12 smarty3 3.1.45-1 —
Debian 12 smarty4 4.1.1-1 —
Debian 11 smarty3 3.1.39-2+deb11u1 DSA-5151-1
Debian 10 smarty3 3.1.33+20180830.1.3a78a21f+selfpack1-1+deb10u1 DSA-5151-1
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Debian 9 smarty3 3.1.31+20161214.1.c7d42e4+selfpack1-2+deb9u6 DLA-3033-1
ReleasePackageFixed inAdvisory
Ubuntu 26.10 gosa No fix yet —
Ubuntu 26.04 LTS gosa No fix yet —
Ubuntu 25.10 gosa No fix yet —
Ubuntu 24.04 LTS gosa No fix yet —
Ubuntu 22.04 LTS gosa No fix yet —
Ubuntu 22.04 LTS smarty3 3.1.39-2ubuntu1.22.04.1 USN-6012-1
Show 7 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS gosa No fix yet —
Ubuntu 18.04 LTS gosa No fix yet —
Ubuntu 16.04 LTS gosa +2 No fix yet —
Ubuntu Pro 22.04 LTS postfixadmin 3.3.10-2ubuntu0.1~esm1 USN-6550-1
Ubuntu Pro 20.04 LTS postfixadmin 3.2.1-3ubuntu0.1~esm1 USN-6550-1
Ubuntu Pro 20.04 LTS smarty3 No fix yet —
Ubuntu Pro 18.04 LTS postfixadmin 3.0.2-2ubuntu0.1~esm1 USN-6550-1
Ubuntu Pro 18.04 LTS smarty3 No fix yet —
Ubuntu Pro 16.04 LTS smarty3 No fix yet —

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
Packagist smarty/smarty < 3.1.45 3.1.45 GHSA-634x-pc3q-cf4c
Packagist smarty/smarty >= 4.0.0, < 4.1.1 4.1.1 GHSA-634x-pc3q-cf4c

Advisories 4

References