Read the docs
TI-2022-11764 Aliases CVE-2022-29221GHSA-634x-pc3q-cf4c

PHP Code Injection by malicious block or filename in Smarty

Priority MEDIUM 48CWE-94Published · Updated

Key facts

Attack vector
Network
Privileges required
Low
User interaction
None
Attack complexity
Low
Impact type
Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-94.

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.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.04914 92nd percentileScored 2026-11-07
Fix Fixed smarty (smarty-php): 3.1.45, 4.1.1smarty/smarty (Packagist): 3.1.45, 4.1.1

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
smarty-phpsmartybefore 3.1.45; 4.0.0 to before 4.1.13.1.45, 4.1.1Patch availableCNA
—smarty/smarty (Packagist)before 3.1.453.1.45Patch availableGHSA-634x-pc3q-cf4c
—smarty/smarty (Packagist)4.0.0 to before 4.1.14.1.1Patch availableGHSA-634x-pc3q-cf4c
  • smarty Vendorsmarty-php Affected before 3.1.45; 4.0.0 to before 4.1.1 Fixed in 3.1.45, 4.1.1 Patch available CNA
  • smarty/smarty (Packagist) Vendor— Affected before 3.1.45 Fixed in 3.1.45 Patch available GHSA-634x-pc3q-cf4c
  • smarty/smarty (Packagist) Vendor— Affected 4.0.0 to before 4.1.1 Fixed in 4.1.1 Patch available GHSA-634x-pc3q-cf4c

CPE configurations NVD · 6

CPEVersionsRoleVendor
cpe:2.3:a:smarty:smarty:*:*:*:*:*:*:*:*before 3.1.45; 4.0.0 to before 4.1.1Vulnerablesmarty-php
cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*9.0VulnerableDebian
cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*10.0VulnerableDebian
cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*11.0VulnerableDebian
cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*36VulnerableFedoraproject
cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:*37VulnerableFedoraproject
  • cpe:2.3:a:smarty:smarty:*:*:*:*:*:*:*:* Versions before 3.1.45; 4.0.0 to before 4.1.1 Vulnerable ·smarty-php
  • cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* Versions 9.0 Vulnerable ·Debian
  • cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
  • cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* Versions 11.0 Vulnerable ·Debian
  • cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* Versions 36 Vulnerable ·Fedoraproject
  • cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:* Versions 37 Vulnerable ·Fedoraproject

Remediation

  • Fix · CNA smarty (smarty-php) Fixed in 3.1.45, 4.1.1
  • Fix · GHSA-634x-pc3q-cf4c smarty/smarty (Packagist) Fixed in 3.1.45 Advisory →
  • Fix · GHSA-634x-pc3q-cf4c smarty/smarty (Packagist) Fixed in 4.1.1 Advisory →

Vendor assessments

Red Hat

Red Hat's page for this CVE →

Not affected: 1 product
  • Red Hat

Timeline

  1. 2026-10-02 Threatist record created from CVE-2022-29221
  2. 2026-10-03 Alias added: GHSA-634x-pc3q-cf4c

References

  • TI-2021-08070 Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring. CVSS 3.1CRITICAL 9.8
  • TI-2009-01585 The smarty_function_math function in libs/plugins/function.math.php in Smarty 2.6.22… CVSS 2.0HIGH 10.0
  • TI-2006-06846 PHP remote file inclusion vulnerability in libs/Smarty.class.php in Smarty 2.6.9 allows… CVSS 3.1CRITICAL 9.8
  • TI-2017-14689 Smarty 3 before 3.1.32 is vulnerable to a PHP code injection when calling fetch() or… CVSS 3.0CRITICAL 9.8
  • TI-2010-04450 Smarty before 3.0.0 beta 7 does not properly handle the <?php and ?> tags, which has… CVSS 2.0HIGH 10.0
  • TI-2010-04449 Unspecified vulnerability in the math plugin in Smarty before 3.0.0 RC1 has unknown… CVSS 2.0HIGH 10.0
See all 30 →

Sources