CVE-2021-21408
PHP vulnerability analysis and mitigation

Overview

Smarty, a PHP template engine for separating presentation from application logic, was found to have a security vulnerability identified as CVE-2021-21408. The vulnerability was discovered in versions prior to 3.1.43 and 4.0.3, where template authors could run restricted static PHP methods. This vulnerability was disclosed in January 2022 and affected multiple versions of the Smarty template engine (GitHub Advisory, CVE Mitre).

Technical details

The vulnerability allowed template authors to bypass the static_classes security policy through dynamic static class access. This security policy was designed to restrict access to static PHP methods, but the implementation had a flaw that could be exploited. The issue was addressed by adding additional security checks to prevent evasion of the static_classes security policy (GitHub Commit).

Impact

The vulnerability could allow template authors to execute restricted static PHP methods, potentially leading to unauthorized code execution within the application context. This could compromise the security boundaries established by the Smarty template engine's security features (Debian Security, Gentoo Security).

Mitigation and workarounds

Users were advised to upgrade to Smarty version 3.1.43 or 4.0.3 or later to receive the security patch. The fix was implemented across multiple distribution channels including Debian, Fedora, and Gentoo (Debian LTS, Fedora Update).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-23622HIGH8.7
  • PHPPHP
  • alextselegidis/easyappointments
NoNoJan 15, 2026
CVE-2026-23493HIGH8.6
  • PHPPHP
  • pimcore/pimcore
NoYesJan 15, 2026
CVE-2026-23496MEDIUM5.4
  • PHPPHP
  • pimcore/web2print-tools-bundle
NoYesJan 15, 2026
CVE-2026-23495MEDIUM4.3
  • PHPPHP
  • pimcore/admin-ui-classic-bundle
NoYesJan 15, 2026
CVE-2026-23494MEDIUM4.3
  • PHPPHP
  • pimcore/pimcore
NoYesJan 15, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management