CVE-2021-26120Smarty Code Injection
PHP Code Injection by malicious function name in smarty
Published Feb 22, 2021 · Updated Oct 23, 2026 · Also known as DEBIAN-CVE-2021-26120, GHSA-3rpf-5rqv-689q, UBUNTU-CVE-2021-26120
Key Facts
Patch immediately- CVE-2021-26120 is a critical-severity vulnerability (CVSS 9.8 v3.1) affecting Smarty, Debian Linux, smarty/smarty (composer) and 2 more products.
- It is not listed in any known-exploited vulnerabilities catalog. No public exploit code is known.
- EPSS estimates a 82% probability of exploitation in the next 30 days.
- Fixed versions are available, including php-smarty 3.1.39-1.mga7, php-smarty 3.1.39-1.mga8, php-smarty 4.0.4-1.mga8.
- Brandefense priority: patch immediately, because it is very likely to be exploited soon.
Scores
CVSS v3.1
9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS (30-day exploit likelihood)
82%
Higher than 99.6% of all scored CVEs
Exploit maturity
None known
ATLAS score
39/100
Publication score, see How it works
Exploitation Verdict
KEV listed
Not listed
Federal due date
None
No federal due date
Ransomware use
Not reported
Attributed actors
None named
Exploit & Defence Guidance
Exploit maturity
None known
Public exploit code
0
Proof-of-concept links
In-the-wild evidence
0
Reports of active use
Advisories And Exploit References
- advisoryhttps://github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2021-26120.yaml
- advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2021-26120
- advisoryhttps://security-tracker.debian.org/tracker/CVE-2021-26120
- advisoryhttps://ubuntu.com/security/CVE-2021-26120
- advisoryhttps://www.cve.org/CVERecord?id=CVE-2021-26120
- advisoryhttps://advisories.mageia.org/MGASA-2021-0335.html
Description
Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring.
Affected Products
22 affected entries in total| Product | Affected versions | Fixed in |
|---|---|---|
| SmartySmarty | See advisory | 3.1.39 |
| Debian LinuxDebian | 10.0, 11.0, 9.0 | n/a |
| smarty/smartycomposer | See advisory | 3.1.39 |
| smarty3debian | See advisory | 3.1.39-1 |
| php-smartymageia | See advisory | 3.1.39-1.mga7 |
Patched Releases
php-smarty
3.1.39-1.mga7, 3.1.39-1.mga8, 4.0.4-1.mga8
Smarty
3.1.39
smarty/smarty
3.1.39
smarty3
3.1.21-1ubuntu1+esm1, 3.1.31+20161214.1.c7d42e4+selfpack1-2+deb9u2, 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1, 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1~esm1, 3.1.39-1
Timeline
Publicly disclosed
Feb 22, 2021
Last updated
Oct 23, 2026
Weakness Type
- CWE-94 Improper Control of Generation of Code
References
- advisorygithub.com · CVE-2021-26120
- advisorynvd.nist.gov · CVE-2021-26120
- advisorysecurity-tracker.debian.org · CVE-2021-26120
- advisoryubuntu.com · CVE-2021-26120
- advisorycve.org · CVERecord
FAQ
Common Questions.
Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring.
Affected: Smarty; Debian Linux versions 10.0, 11.0, 9.0; smarty/smarty (composer), among others. The full list is in the CVE brief.
It is not listed in any known-exploited vulnerabilities catalog.
No, it is not currently listed in the CISA Known Exploited Vulnerabilities catalog.
No public exploit code is known.
Fixed versions are available, including php-smarty 3.1.39-1.mga7, php-smarty 3.1.39-1.mga8, php-smarty 4.0.4-1.mga8.
Brandefense priority: patch immediately, because it is very likely to be exploited soon.
Is CVE-2021-26120 On Your Attack Surface?
Brandefense matches it against the products discovered on your perimeter and opens a finding the day a CVE like this is listed.
Request A Demo