What’s Vulnerable › Vulnerabilities
CVE-2024-35226: PHP Code Injection by malicious attribute in extends-tag in Smarty
- Severity: high (CVSS 7.3 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.5% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2024-05-28 · updated 2026-06-17
- Weakness: CWE-94
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
- smarty-php smarty: from 5.0.0 before 5.1.1; from 3.0.0 before 4.5.3 — fixed in 4.5.3, 5.1.1
How to fix
Upgrade to a fixed version: smarty-php smarty 4.5.3, 5.1.1. Check the vendor advisory for mitigations.
References
- https://github.com/smarty-php/smarty/commit/0be92bc8a6fb83e6e0d883946f7e7c09ba4e857a
- https://github.com/smarty-php/smarty/security/advisories/GHSA-4rmg-292m-wg3w
- https://github.com/smarty-php/smarty/commit/0be92bc8a6fb83e6e0d883946f7e7c09ba4e857a
- https://github.com/smarty-php/smarty/security/advisories/GHSA-4rmg-292m-wg3w
- https://lists.debian.org/debian-lts-announce/2024/11/msg00013.html
Get alerted when CVE-2024-35226 or the next vulnerability affects your stack