Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring.
Priority HIGH 83CWE-94Published · Updated
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-94.
Summary
Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring.
Why it matters now
EPSS 0.82316 99th percentileScored 2026-11-07
Fix Fixed smarty/smarty (Packagist): 3.1.39
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | — | all versions | — | No fix listed | CNA |
| — | smarty/smarty (Packagist) | before 3.1.39 | 3.1.39 | Patch available | GHSA-3rpf-5rqv-689q |
- — Vendor— Affected all versions Fixed in — No fix listed CNA
- smarty/smarty (Packagist) Vendor— Affected before 3.1.39 Fixed in 3.1.39 Patch available GHSA-3rpf-5rqv-689q
CPE configurations NVD · 4
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:smarty:smarty:*:*:*:*:*:*:*:* | before 3.1.39 | Vulnerable | smarty-php |
| cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* | 9.0 | Vulnerable | Debian |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
| cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* | 11.0 | Vulnerable | Debian |
- cpe:2.3:a:smarty:smarty:*:*:*:*:*:*:*:* Versions before 3.1.39 Vulnerable ·smarty-php
- cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* Versions 9.0 Vulnerable ·Debian
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
- cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* Versions 11.0 Vulnerable ·Debian
Remediation
- Fix · GHSA-3rpf-5rqv-689q smarty/smarty (Packagist) Fixed in 3.1.39 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2021-26120
- 2026-10-03 Alias added: GHSA-3rpf-5rqv-689q
References
Patch 1
Advisory 5
Other 6
- https://github.com/smarty-php/smarty/security/advisories/GHSA-3rpf-5rqv-689q
- https://github.com/smarty-php/smarty/commit/165f1bd4d2eec328cfeaca517a725b46001de838
- https://github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2021-26120.yaml
- https://github.com/smarty-php/smarty
- https://github.com/smarty-php/smarty/blob/master/CHANGELOG.md#3139---2021-02-17
- https://srcincite.io/blog/2021/02/18/smarty-template-engine-multiple-sandbox-escape-vulnerabilities.html
Sources
- CVE-2021-26120 · CVE Program
- CVE-2021-26120 · NVD
- FIRST EPSS
- GHSA-3rpf-5rqv-689q · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences