LiveActive security incident?Get immediate response
CVE Record

CVE-2021-21408: Access to restricted PHP code by dynamic static class access in smarty

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.

HighCVSS 8.8Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

Smarty is a PHP template engine used by web applications. In affected versions, someone allowed to write templates could bypass intended restrictions and run static PHP methods that should have been blocked. This can affect confidentiality, integrity, and availability, so exposed applications should be upgraded promptly.

Executive priority

Treat as high priority for web applications with delegated template editing or CMS-style customization. Upgrade during the next urgent maintenance window. If template editing is not exposed beyond trusted developers, prioritize after confirming no bundled vulnerable package is reachable in production.

Technical view

CVE-2021-21408 affects smarty-php/smarty before 3.1.43 and 4.0.0 through 4.0.2. The issue involves dynamic static class access allowing template authors to run restricted static PHP methods. CVSS 3.1 is 8.8 with low complexity and required privileges, no user interaction, and high CIA impact.

Likely exposure

Exposure is most likely in PHP applications using Smarty where admins, CMS users, theme editors, plugin authors, or other semi-trusted users can create or modify templates. Risk is lower when templates are only changed by trusted developers through controlled releases.

Exploitation context

The source bundle does not show CISA KEV listing or cited evidence of active exploitation. The CVSS vector indicates network reachability, low attack complexity, and required privileges. Practical exploitation depends on having template-authoring access in an affected application.

Researcher notes

The advisory and CVE record support affected version ranges and patched releases. The commit is the primary code-change reference. Evidence does not establish active exploitation, public exploit availability, or a standalone workaround beyond upgrading or applying vendor packages.

Mitigation direction

  • Upgrade Smarty to 3.1.43 or 4.0.3 or later.
  • Apply distribution security updates from Debian, Gentoo, Fedora, or other package vendors.
  • Restrict template editing to trusted administrative roles only.
  • Review downstream application vendor guidance if Smarty is bundled indirectly.

Validation and detection

  • Inventory PHP dependencies and package-manager records for Smarty versions.
  • Check containers and deployed hosts, not only source repositories.
  • Identify application features that allow template creation or editing.
  • Confirm production runs Smarty 3.1.43, 4.0.3, or a vendor-patched package.
  • Run regression tests for template rendering after upgrading.
Prepared
Confidence
high
Sources
9

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-20: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-21408 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.8 (3.1)
Known Exploited
No
Published

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

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
10Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.8CVSS 3.1HighCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H2.85.9Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

8.8High
CVSS 3.1 vector shape for CVE-2021-21408Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

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

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
smarty-phpsmarty< 3.1.43, >= 4.0.0, < 4.0.3Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-20 · source CWE mapping

Improper Input Validation

Improper Input Validation represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.