Register for the AI for Security Summit: Join Figma, Perplexity & Wiz

CVE-2024-35226
PHP vulnerability analysis and mitigation

Overview

Smarty, a template engine for PHP that facilitates the separation of presentation (HTML/CSS) from application logic, was found to contain a code injection vulnerability identified as CVE-2024-35226. The vulnerability was discovered and disclosed on May 28, 2024, affecting all versions of Smarty v3.x.x and versions before 4.5.3 and 5.2.0. The vulnerability allows template authors to inject PHP code by manipulating the file name parameter in the extends-tag (GitHub Advisory).

Technical details

The vulnerability is classified as a PHP code injection flaw (CWE-94) with a CVSS v3.1 base score of 7.3 (High). The attack vector is network-based (AV:N) with low attack complexity (AC:L), requiring low privileges (PR:L) and user interaction (UI:R). The scope is unchanged (S:U) with high impacts on confidentiality (C:H) and integrity (I:H), but no impact on availability (A:N) (NVD).

Impact

The vulnerability allows malicious template authors to execute arbitrary PHP code through crafted file names in the extends-tag. This poses a significant security risk for sites that cannot fully trust their template authors, potentially leading to unauthorized code execution and system compromise (GitHub Advisory).

Exploitability

The vulnerability requires low attack complexity and can be exploited by an attacker with low privileges. The attack requires user interaction and can be executed remotely over the network (NVD).

Mitigation and workarounds

Users are strongly advised to upgrade to Smarty version 4.5.3 or 5.2.0, which contain patches for this vulnerability. For users on the v3 branch, there is no patch available, and no known workarounds exist. Sites that cannot fully trust template authors should update as soon as possible (GitHub Advisory, Ubuntu Notice).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

smarty4: 4.3.0-1+deb12u2

Fixed

bullseye

smarty3: 3.1.39-2+deb11u2

Fixed

sid

smarty4: 4.5.4-1

Fixed

trixie

smarty4: 4.5.4-1

Fixed

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-56829HIGH8.1
  • PHP logoPHP
  • shopper/framework
NoYesSep 15, 2026
CVE-2026-56827HIGH8.1
  • PHP logoPHP
  • shopper/framework
NoYesSep 15, 2026
CVE-2026-84997HIGH7.5
  • PHP logoPHP
  • composer://react/http
NoYesSep 16, 2026
CVE-2026-56831MEDIUM6.5
  • PHP logoPHP
  • shopper/framework
NoYesSep 15, 2026
CVE-2026-56830MEDIUM6.5
  • PHP logoPHP
  • shopper/framework
NoYesSep 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