Skip to content
OpenAdvisories
High · 7.3 CVE-2024-35226 EUVD-2024-1424GHSA-4rmg-292m-wg3w

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

Published May 28, 2024 · Updated Nov 3, 2025 · Assigned by GitHub_M

Description

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.

Affected products

VendorProductAffectedFixed
smarty-php smarty >= 5.0.0, < 5.1.1, >= 3.0.0, < 4.5.3 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 smarty3 3.1.48-2 —
Debian 14 smarty4 4.5.4-1 —
Debian 13 smarty3 3.1.48-2 —
Debian 13 smarty4 4.5.4-1 —
Debian 12 smarty3 3.1.47-2+deb12u1 DSA-5826-1
Debian 12 smarty4 4.3.0-1+deb12u2 DSA-5830-1
Debian 11 smarty3 3.1.39-2+deb11u2 DLA-3956-1
ReleasePackageFixed inAdvisory
Ubuntu 26.10 smarty3 No fix yet —
Ubuntu 26.04 LTS smarty3 No fix yet —
Ubuntu 25.10 smarty3 No fix yet —
Ubuntu 24.04 LTS smarty3 3.1.48-1ubuntu0.24.04.1 USN-7158-1
Ubuntu 24.04 LTS smarty4 4.3.1-1ubuntu0.24.04.1 USN-7377-1
Ubuntu 22.04 LTS smarty3 3.1.39-2ubuntu1.22.04.2 USN-7158-1
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS smarty3 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1 USN-7158-1
Ubuntu Pro 18.04 LTS smarty3 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1+esm1 USN-7158-1
Ubuntu Pro 16.04 LTS smarty3 No fix yet —

Affected packages

EcosystemPackageAffectedFixedRecord
Packagist smarty/smarty >= 5.0.0, < 5.1.1 5.1.1 GHSA-4rmg-292m-wg3w
Packagist smarty/smarty >= 3.0.0, < 4.5.3 4.5.3 GHSA-4rmg-292m-wg3w

Advisories 6

References