CVE-2024-35226 json
PHP Code Injection by malicious attribute in extends-tag in Smarty
published 2024-05-28 2 y ago modified 2026-06-17 4 mo ago also EUVD-2024-1424 , GHSA-4rmg-292m-wg3w
- cvss
- 7.3
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.5%
- EPSS 0.5% chance of exploitation in 30 days, percentile 43%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- packagist smarty/smarty 4.5.3, 5.1.1
- smarty-php smarty 4.5.3, 5.1.1
- smarty3 Debian 12 3.1.47-2+deb12u1
- smarty3 Debian 14, Debian 13 3.1.48-2
- smarty4 Debian 12 4.3.0-1+deb12u2
- smarty4 Debian 14, Debian 13 4.5.4-1
debian advisories DEBIAN-CVE-2024-35226
- smarty3 Ubuntu 20.04 LTS 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1
- smarty3 Ubuntu 22.04 LTS 3.1.39-2ubuntu1.22.04.2
- smarty3 Ubuntu 24.04 LTS 3.1.48-1ubuntu0.24.04.1
- smarty4 Ubuntu 24.04 LTS 4.3.1-1ubuntu0.24.04.1
- smarty3 Ubuntu Pro 18.04 LTS 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1+esm1
ubuntu advisories UBUNTU-CVE-2024-35226
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-35226 updated cvss 7.3
php-smarty: php code injection
-
Red Hat All currently supported Red Hat productsnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
0.51% chance of exploitation in the next 30 days, higher than 43% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.3 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N |
| GitHub | 3.1 | 7.3 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| packagist | smarty/smarty | >=5.0.0, <5.1.1 >=3.0.0, <4.5.3 |
5.1.1 4.5.3 |
Affected products
- smarty-php smarty
Classification
- Weakness
-
- CWE-94 Improper Control of Generation of Code
References
-
github.com
/smarty-php/smarty/commit/0be92bc8a6fb83e6e0d883946f7e7c09ba4e857a
web
-
github.com
/smarty-php/smarty/security/advisories/GHSA-4rmg-292m-wg3w
web
-
lists.debian.org
/debian-lts-announce/2024/11/msg00013.html
web
-
nvd.nist.gov
/vuln/detail/CVE-2024-35226
advisory
-
github.com
/smarty-php/smarty
package
Sources
- CVE List CVE-2024-35226
- GitHub Advisory GHSA-4rmg-292m-wg3w
- NVD CVE-2024-35226
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.