Live threats

All CVEs / Smarty

CVE-2021-29454Smarty

High 8.8

Priority
53
CVSS 3.1
8.8
EPSS
1.9%
probability of exploitation in 30 days · percentile 80
Auth required
Yes
Published
Jan 10, 2022
Updated
Jun 17, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-74
SSVC (CISA)
Exploitation: none · Automatable: no · Technical impact: total
Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

What happens

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Prior to versions 3.1.42 and 4.0.2, template authors could run arbitrary PHP code by crafting a malicious math string. If a math string was passed through as user provided data to the math function, external users could run arbitrary PHP code by crafting a malicious math string. Users should upgrade to version 3.1.42 or 4.0.2 to receive a patch.

Original NVD text.

What to do

  1. Apply the vendor's security update for Smarty.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
Packagist smarty/smarty < 3.1.42 3.1.42 composer require "smarty/smarty:^3.1.42"
Packagist smarty/smarty ≥ 4.0.0 < 4.0.2 4.0.2 composer require "smarty/smarty:^4.0.2"

Per OSV / GitHub Advisories (GHSA-29gp-2c3m-3j6m). Check the version in your lockfile before upgrading.

Affected products (CPE)

VendorProductVersions
smartysmarty< 3.1.42
smartysmarty≥ 4.0.0 < 4.0.2
debiandebian_linux9.0
debiandebian_linux10.0
debiandebian_linux11.0
fedoraprojectfedora36
fedoraprojectfedora37

Official sources

References

Links published by the sources. Open them with care.