PHP Code Injection by malicious attribute in extends-tag in Smarty
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-94.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| smarty-php | smarty | 5.0.0 to before 5.1.1; 3.0.0 to before 4.5.3 | 5.1.1, 4.5.3 | Patch available | CNA |
| — | smarty/smarty (Packagist) | 5.0.0 to before 5.1.1 | 5.1.1 | Patch available | GHSA-4rmg-292m-wg3w |
| — | smarty/smarty (Packagist) | 3.0.0 to before 4.5.3 | 4.5.3 | Patch available | GHSA-4rmg-292m-wg3w |
- smarty Vendorsmarty-php Affected 5.0.0 to before 5.1.1; 3.0.0 to before 4.5.3 Fixed in 5.1.1, 4.5.3 Patch available CNA
- smarty/smarty (Packagist) Vendor— Affected 5.0.0 to before 5.1.1 Fixed in 5.1.1 Patch available GHSA-4rmg-292m-wg3w
- smarty/smarty (Packagist) Vendor— Affected 3.0.0 to before 4.5.3 Fixed in 4.5.3 Patch available GHSA-4rmg-292m-wg3w
CPE names CISA-ADP · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:smarty-php:smarty:*:*:*:*:*:*:*:* | — | — | — |
- cpe:2.3:a:smarty-php:smarty:*:*:*:*:*:*:*:* Versions — — ·—
Remediation
- Fix · CNA smarty (smarty-php) Fixed in 5.1.1, 4.5.3
- Fix · GHSA-4rmg-292m-wg3w smarty/smarty (Packagist) Fixed in 5.1.1 Advisory →
- Fix · GHSA-4rmg-292m-wg3w smarty/smarty (Packagist) Fixed in 4.5.3 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2024-35226
- 2026-10-03 Alias added: GHSA-4rmg-292m-wg3w
References
More smarty-php vulnerabilities
- TI-2021-08070 Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring. CVSS 3.1CRITICAL 9.8
- TI-2026-68416 Code injection in Smarty via extends: inheritance cache CVSS 4.0CRITICAL 9.2
- TI-2026-44997 Smarty Security stream restriction bypass through stream: resource CVSS 4.0MEDIUM 6.9
- TI-2009-01585 The smarty_function_math function in libs/plugins/function.math.php in Smarty 2.6.22… CVSS 2.0HIGH 10.0
- TI-2006-06846 PHP remote file inclusion vulnerability in libs/Smarty.class.php in Smarty 2.6.9 allows… CVSS 3.1CRITICAL 9.8
- TI-2022-11764 PHP Code Injection by malicious block or filename in Smarty CVSS 3.1HIGH 8.8
Sources
- CVE-2024-35226 · CVE Program
- CVE-2024-35226 · NVD
- FIRST EPSS
- GHSA-4rmg-292m-wg3w · GitHub Advisory Database · CC BY 4.0
- CVE-2024-35226 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences