CVE-2024-35226: PHP Code Injection by malicious attribute in extends-tag in Smarty

Published May 28, 2024
·
Updated

Impact Template authors could inject php code by choosing a malicous file name for an extends-tag. Users that cannot fully trust template authors should update asap.

Patches Please upgrade to the most recent version of Smarty v4 or v5. There is no patch for v3.

Other sources

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. In affected versions template authors could inject php code by choosing a malicious file name for an extends-tag. Sites that cannot fully trust template authors should update asap. All users are advised to update. There is no patch for users on the v3 branch. There are no known workarounds for this vulnerability.

NVD

Affected Software

4 affected componentsFixes available
composer/smarty/smarty>=3.0.0<4.5.3
4.5.3
composer/smarty/smarty>=5.0.0<5.1.1
5.1.1
debian/smarty3<=3.1.39-2+deb11u1
3.1.39-2+deb11u23.1.47-2+deb12u13.1.48-2
debian/smarty4
4.3.0-1+deb12u24.5.5-1

Event History

May 28, 2024
CVE Published
via MITRE·08:55 PM
Data Sourced
via MITRE·08:55 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeakness
May 29, 2024
Advisory Published
via GitHub·06:44 PM
Dec 13, 2024
Data Sourced
via Launchpad·01:26 AM
Description
Apr 16, 2025
Data Sourced
via Ubuntu·08:47 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-35226?

CVE-2024-35226 has a critical severity due to the potential for PHP code injection by untrusted template authors.

2

How do I fix CVE-2024-35226?

To fix CVE-2024-35226, upgrade to the latest version of Smarty, specifically version 4.5.3 or 5.1.1, as there is no patch for v3.

3

What are the affected versions of Smarty for CVE-2024-35226?

Affected versions of Smarty include versions 3.0.0 to 4.5.2 and 5.0.0 to 5.1.0.

4

What happens if I do not remediate CVE-2024-35226?

Failing to remediate CVE-2024-35226 may lead to unauthorized PHP code execution, compromising the security of your applications.

5

Which platforms or packages are impacted by CVE-2024-35226?

CVE-2024-35226 impacts the Smarty PHP template engine, particularly versions provided through Composer and Debian packages.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203