Patchfirst
CVE-2021-26120 EPSS 82.3%

Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring.

Fix:upgrade smarty to 3.1.39 or later Details ↓

Summary

The flaw is in Smarty, the PHP template engine, prior to version 3.1.39, where the template parser mishandles a function name that follows a "{function name=" substring. An attacker can exploit this to inject code, though the available record does not specify the required network access, authentication, user interaction, or configuration.

Heading is the official description · CVE.org
Breakdown
19.9 / 100
Exploited
Not confirmed
Reports
0
Tactics
0/15

Disclosed on 22 Feb 2021. No public exploit code or confirmed exploitation is recorded.

2 related vulnerabilities in the same code over 15 months. The latest fix listed for smarty/smarty is 4.1.1.

Linked vulnerabilitiesLinked by evidence that a fix failed or the same code was patched again. Oldest first.

  1. This CVECVE-2021-26120Smarty before 3.1.39 allows code injection via an unexpected…22 Feb 2021
  2. relatedMedium

    Why these are linked:

    CVE-2022-29221PHP Code Injection by malicious block or filename in Smarty24 May 2022

Fixes in smarty/smartyPackagist package, by fixed version. Earlier and later fixes in the same package, not necessarily the same bug.

  1. 3.1.33CVE-2018-1683111 Sep 2018
  2. 3.1.33CVE-2018-1398218 Sep 2018
  3. 3.1.39CVE-2021-2611922 Feb 2021
  4. 3.1.39CVE-2021-2612022 Feb 2021
  5. 4.0.2CVE-2021-2945410 Jan 2022
  6. 4.0.3CVE-2021-2140810 Jan 2022
  7. 4.1.1CVE-2022-2922124 May 2022Latest listed

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: smarty/smarty.

Packagistsmarty/smartyGHSA-3rpf-5rqv-689q

Upgrade to 3.1.39 or later

Set the version to 3.1.39 or later in your composer.json.

The first fix for CVE-2021-26120. No other CVE tracked by Patchfirst affects this package.

Affected versions

If you runUpgrade to
All versions before 3.1.393.1.39

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

References

5 links, grouped by NVD tag
↑ ↓ chooseEnter openEsc close