VDB

CVE-2022-29221

CVE-2022-29221 PUBLISHED CVSS 8.8 HIGH

PHP Code Injection by malicious block or filename in Smarty

Reported by github_m · Published May 24, 2022

smarty/smarty is fixed in 4.1.1 and 3.1.45 (Packagist)

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
smarty/smartyPackagist4.1.1, 3.1.45
smartysmarty4.1.1, 3.1.45

Risk scores

CVSS 3.1
8.8
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected products

VendorProductVersions
smarty-phpsmarty< 3.1.45, >= 4.0.0, < 4.1.1
smartysmarty0, 4.0.0
smarty-phpsmarty0, 4.0.0

Timeline

  • May 24, 2022 CVE Published
  • May 25, 2022 EPSS Score (30 in total, the first dated here)
  • Nov 21, 2024 CVE Updated
  • Apr 3, 2026 Distribution Patch
  • Apr 3, 2026 Security Advisory (3 in total, the first dated here)
  • Jun 27, 2026 Coalition ESS Score

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2022-29221
vulnetix vdb fixes CVE-2022-29221

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-29221/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›