CVE-2024-35226
PHP Code Injection by malicious attribute in extends-tag in Smarty
Reported by github_m · Published May 28, 2024
smarty/smarty is fixed in 5.1.1 and 4.5.3 (Packagist)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| smarty/smarty | Packagist | 5.1.1, 4.5.3 |
| smarty | smarty-php | 5.1.1, 4.5.3 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| smarty-php | smarty | >= 5.0.0, < 5.1.1, >= 3.0.0, < 4.5.3 |
| smarty-php | smarty | 5.0.0, 3.0.0 |
| smarty-php | smarty | 5.0.0, 3.0.0 |
| smarty | smarty | 5.0.0, 3.0.0 |
Timeline
- May 28, 2024 CVE Published
- May 29, 2024 EPSS Score (30 in total, the first dated here)
- Oct 4, 2024 Coalition ESS Score (11 in total, the first dated here)
- Jan 10, 2026 Security Advisory (2 in total, the first dated here)
- Jun 17, 2026 CVE Updated
- Aug 10, 2026 Distribution Patch
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-35226
vulnetix vdb fixes CVE-2024-35226
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-35226/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/smarty-php/smarty/security/advisories/GHSA-4rmg-292m-wg3w x_refsource_CONFIRM
- https://github.com/smarty-php/smarty/commit/0be92bc8a6fb83e6e0d883946f7e7c09ba4e857a x_refsource_MISC
- https://lists.debian.org/debian-lts-announce/2024/11/msg00013.html url
- https://nvd.nist.gov/vuln/detail/CVE-2024-35226 advisory
- https://github.com/advisories/GHSA-4rmg-292m-wg3w advisory
- https://github.com/smarty-php/smarty url