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

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.

— Launchpad

Smarty vulnerable to PHP Code Injection by malicious attribute in extends-tag

— Packagist

Affected Software

12 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
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.47-2+deb12u1
3.1.47-2+deb12u1
debian/smarty3<3.1.48-2
3.1.48-2
debian/smarty3<3.1.48-2
3.1.48-2
debian/smarty4<4.3.0-1+deb12u2
4.3.0-1+deb12u2
debian/smarty4<4.5.4-1
4.5.4-1
debian/smarty4<4.5.4-1
4.5.4-1
debian/smarty3
3.1.47-2+deb12u13.1.48-2
debian/smarty4
4.3.0-1+deb12u24.5.5-14.5.8-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/smarty/smarty to a version that resolves this vulnerability.

    Fixed in 4.5.3
  2. Upgrade

    Upgrade composer/smarty/smarty to a version that resolves this vulnerability.

    Fixed in 5.1.1
  3. Upgrade

    Upgrade debian/smarty3 to a version that resolves this vulnerability.

    Fixed in 3.1.47-2+deb12u1
  4. Upgrade

    Upgrade debian/smarty3 to a version that resolves this vulnerability.

    Fixed in 3.1.48-2
  5. Upgrade

    Upgrade debian/smarty4 to a version that resolves this vulnerability.

    Fixed in 4.3.0-1+deb12u2
  6. Upgrade

    Upgrade debian/smarty4 to a version that resolves this vulnerability.

    Fixed in 4.5.4-1
  7. Upgrade

    Upgrade debian/smarty3 to a version that resolves this vulnerability.

    Fixed in 3.1.47-2+deb12u1Fixed in 3.1.48-2
  8. Upgrade

    Upgrade debian/smarty4 to a version that resolves this vulnerability.

    Fixed in 4.3.0-1+deb12u2Fixed in 4.5.5-1Fixed in 4.5.8-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
Data Sourced
via OSV·09:16 PM
DescriptionSeverityAffected Software
May 29, 2024
Advisory Published
via GitHub·06:44 PM
Data Sourced
via GitHub·06:44 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via Packagist·06:44 PM
DescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

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