CVE-2021-26120 PHP Code Injection by malicious function name in smarty
Attackers can execute arbitrary code by exploiting a flaw in the Smarty template engine's function name parsing.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-26120?
CVE-2021-26120 is a critical code injection vulnerability in Debian Debian Linux, published on 22 Feb 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring.
Weakness: CWE-94
Which versions are affected by CVE-2021-26120?
2 open source packages ship an affected version, including smarty/smarty. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
smarty/smarty Packagist | All versions | 3.1.39 |
smarty/smarty Packagist | All versions | 3.1.39 |
Products include Debian Debian Linux, Smarty Smarty.
How do I fix CVE-2021-26120?
Upgrade smarty/smarty to 3.1.39 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2021-26120 being exploited?
There is no known exploitation of CVE-2021-26120 in the wild and no public exploit code.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as DEBIAN-CVE-2021-26120, GHSA-3rpf-5rqv-689q, UBUNTU-CVE-2021-26120.