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

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 82.3%, higher than 99% of CVEs (2026-12-01)
- Published: 2021-02-22T01:38:15.000Z
- Modified: 2026-06-17T03:42:55.233Z
- Also known as: GHSA-3rpf-5rqv-689q
- Weaknesses: CWE-94
- Assigned by: mitre

## Description

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

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- smarty/smarty (Packagist): before 3.1.39
- smarty smarty: before 3.1.39
- debian debian_linux: 9.0; 10.0; 11.0

## Every score

- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`

## 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, vendor-advisory, web)
- <https://www.debian.org/security/2022/dsa-5151> (third-party-advisory, vendor-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)

## Sources

- CVE List: [CVE-2021-26120](https://www.cve.org/CVERecord?id=CVE-2021-26120), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-3rpf-5rqv-689q](https://github.com/advisories/GHSA-3rpf-5rqv-689q), CC-BY-4.0, modified 2024-02-16
- NVD: [CVE-2021-26120](https://nvd.nist.gov/vuln/detail/CVE-2021-26120), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-26120 · Whole record: https://cve.day/CVE-2021-26120.json · Rebuilt by cve.day 2026-11-25T22:58:00.003Z
