# CVE-2021-21408: Access to restricted PHP code by dynamic static class access in smarty

- Priority: **Routine**
- Reason: Not severe (CVSS 8.8, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2022-01-10 · Modified: 2025-04-23
- Aliases: UBUNTU-CVE-2021-21408, DEBIAN-CVE-2021-21408
- Record: https://cvemate.com/vulnerability/CVE-2021-21408 · JSON: https://cvemate.com/vulnerability/CVE-2021-21408/json

## Description

```text
Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Prior to versions 3.1.43 and 4.0.3, template authors could run restricted static php methods. Users should upgrade to version 3.1.43 or 4.0.3 to receive a patch.
```

## Signals

- CVSS: 8.8 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 2.143%, percentile 82.716%, as of 2026-12-05
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- debian smarty3 (Debian): \< 3.1.45-1
- debian smarty4 (Debian): \< 4.1.1-1
- ubuntu smarty3 (Ubuntu): \< 3.1.21-1ubuntu1+esm1 \| \< 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1 \| \< 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1~esm1 \| \< 3.1.39-2ubuntu1
- debian debian\_linux: 9.0 \| 10.0 \| 11.0
- fedoraproject fedora: 36 \| 37
- smarty-php smarty: \< 3.1.43 \| ≥ 4.0.0, \< 4.0.3
- smarty smarty: \< 3.1.43 \| ≥ 4.0.0, \< 4.0.3

## References

- <https://github.com/smarty-php/smarty/security/advisories/GHSA-4h9c-v5vg-5m6m>
- <https://github.com/smarty-php/smarty/commit/19ae410bf56007a5ef24441cdc6414619cfaf664>
- <https://github.com/smarty-php/smarty/releases/tag/v3.1.43>
- <https://github.com/smarty-php/smarty/releases/tag/v4.0.3>
- <https://lists.debian.org/debian-lts-announce/2022/05/msg00005.html>
- <https://www.debian.org/security/2022/dsa-5151>
- <https://security.gentoo.org/glsa/202209-09>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/>
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/>
- <https://ubuntu.com/security/CVE-2021-21408>
- <https://ubuntu.com/security/notices/USN-5348-1>
- <https://ubuntu.com/security/notices/USN-5348-3>
- <https://ubuntu.com/security/notices/USN-5348-2>
- <https://www.cve.org/CVERecord?id=CVE-2021-21408>
- <https://security-tracker.debian.org/tracker/CVE-2021-21408>

---

Data as of 2026-12-05T14:50:48.394Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
