CVE-2021-26120
JSON

9.8critical

PHP Code Injection by malicious function name in smarty

Severity
9.8critical CVSS:3.1 by NVD
Exploit likelihood
82.3% (higher than 99% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-3rpf-5rqv-689q

Description

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

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
smarty/smarty (Packagist)before 3.1.39GitHub Advisory Database
smarty smartybefore 3.1.39NVD
debian debian_linux9.0, 10.0, 11.0NVD

All scores

GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD7.5high CVSS:2.0AV:N/AC:L/Au:N/C:P/I:P/A:P

Classification

What each source says

CVE List

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

GitHub Advisory Database

Template authors could inject php code by choosing a malicous {function} name. Sites that cannot fully trust template authors should update as soon as possible. Please upgrade to 3.1.39 or higher.

NVD (es)

Smarty versiones anteriores a 3.1.39, permite una inyección de código por medio de un nombre de función no previsto después de una subcadena {function name=

References

https://github.com/smarty-php/smarty/blob/master/CHANGELOG.mdrelease-notes, third-party-advisory, web
https://lists.debian.org/debian-lts-announce/2021/04/msg00004.htmlmailing-list, third-party-advisory, web
https://lists.debian.org/debian-lts-announce/2021/04/msg00014.htmlmailing-list, third-party-advisory, web
https://security.gentoo.org/glsa/202105-06patch, third-party-advisory, vendor-advisory, web
https://www.debian.org/security/2022/dsa-5151third-party-advisory, vendor-advisory, web
https://github.com/smarty-php/smarty/security/advisories/GHSA-3rpf-5rqv-689qweb
https://nvd.nist.gov/vuln/detail/CVE-2021-26120advisory
https://github.com/smarty-php/smarty/commit/165f1bd4d2eec328cfeaca517a725b46001de838web
https://github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2021-26120.yamlweb
https://github.com/smarty-php/smartypackage
https://github.com/smarty-php/smarty/blob/master/CHANGELOG.md#3139---2021-02-17web
https://srcincite.io/blog/2021/02/18/smarty-template-engine-multiple-sandbox-escape-vulnerabilities.htmlweb

Sources

SourceRecordLicence
CVE ListCVE-2021-26120 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-3rpf-5rqv-689q changed 2024-02-16CC-BY-4.0
NVDCVE-2021-26120 changed 2026-06-17Public domain