CVE-2021-26120
CRITICAL 9.8CVSS 3.1PHP Code Injection by malicious function name in smarty
Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring.
- Published
- 22 Feb 2021
- Last modified
- 17 Jun 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-94
- Also known as
- GHSA-3rpf-5rqv-689q
- Sources
- NVDJSONOSV GHSA-3rpf-5rqv-689qJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | HIGH 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | smarty | smartycpe:2.3:a:smarty:smarty:*:*:*:*:*:*:*:* |
< 3.1.39 | 3.1.39 |
| NVD | debian | debian_linuxcpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* |
= 9.0 | |
| NVD | debian | debian_linuxcpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* |
= 10.0 | |
| NVD | debian | debian_linuxcpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* |
= 11.0 | |
| OSV | Packagist | smarty/smarty | < 3.1.39 | 3.1.39 |
References
- https://github.com/smarty-php/smarty/blob/master/CHANGELOG.md · Release Notes, Third Party Advisory, WEB
- https://lists.debian.org/debian-lts-announce/2021/04/msg00004.html · Mailing List, Third Party Advisory, WEB
- https://lists.debian.org/debian-lts-announce/2021/04/msg00014.html · Mailing List, Third Party Advisory, WEB
- https://security.gentoo.org/glsa/202105-06 · Patch, Third Party Advisory, WEB
- https://www.debian.org/security/2022/dsa-5151 · Third Party Advisory, WEB
- https://github.com/smarty-php/smarty/security/advisories/GHSA-3rpf-5rqv-689q · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-26120 · ADVISORY
- https://github.com/smarty-php/smarty/commit/165f1bd4d2eec328cfeaca517a725b46001de838 · WEB
- https://github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2021-26120.yaml · WEB
- https://github.com/smarty-php/smarty · PACKAGE
- https://github.com/smarty-php/smarty/blob/master/CHANGELOG.md#3139---2021-02-17 · WEB
- https://srcincite.io/blog/2021/02/18/smarty-template-engine-multiple-sandbox-escape-vulnerabilities.html · WEB
History
- 25 Nov 2026 20:32 UTC · NVD: first stored (published 22 Feb 2021)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 26 Feb 2021)