CVE-2021-26120 PHP Code Injection by malicious function name in smarty

Critical 9.8 Published Updated

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.

PackageAffectedFixed in
smarty/smarty PackagistAll versions3.1.39
smarty/smarty PackagistAll versions3.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.

All Debian Debian Linux vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-26120, GHSA-3rpf-5rqv-689q, UBUNTU-CVE-2021-26120.

Is CVE-2021-26120 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free