All vulnerabilities

Servers and applications

CVE-2021-21408

Access to restricted PHP code by dynamic static class access

Severity
High 8.8
Published
10 Jan 2022
Last changed
17 Jun 2026
Added to UpHeron
1 Nov 2026
Fixed in
3.1.43, 4.0.3
Also known as
GHSA-4h9c-v5vg-5m6m
Sources
NVD, Project advisories (GitHub)

Description

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Prior to versions 3.1.43 and 4.0.3, template authors could run restricted static php methods. Users should upgrade to version 3.1.43 or 4.0.3 to receive a patch.

Affected software

SoftwareAffected versions
SmartyServers and applications · cpe:a:smarty:smarty
  • Every version before 3.1.43
  • From 4.0.0 before 4.0.3
SmartyServers and applications · github:smarty-php/smarty
  • Every version before 3.1.43
  • Every version before 4.0.3

References

  • NVD https://nvd.nist.gov/vuln/detail/CVE-2021-21408
  • CVE.org https://www.cve.org/CVERecord?id=CVE-2021-21408
  • GitHub Advisory Database https://github.com/advisories/GHSA-4h9c-v5vg-5m6m
  • github.com https://github.com/smarty-php/smarty/security/advisories/GHSA-4h9c-v5vg-5m6m