CVE-2021-21408 json
Access to restricted PHP code by dynamic static class access in smarty
published 2022-01-10 4 y ago modified 2026-07-08 4 mo ago also GHSA-4h9c-v5vg-5m6m , EUVD-2022-0443
- cvss
- 8.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.1%
- EPSS 2.1% chance of exploitation in 30 days, percentile 82%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- packagist smarty/smarty 3.1.43, 4.0.3
- smarty smarty 3.1.43, 4.0.3
- smarty3 Debian 14, Debian 13, Debian 12 3.1.45-1
- smarty4 Debian 14, Debian 13, Debian 12 4.1.1-1
debian advisories DEBIAN-CVE-2021-21408
- smarty3 Ubuntu 18.04 LTS 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1
- smarty3 Ubuntu 22.04 LTS 3.1.39-2ubuntu1
- smarty3 Ubuntu Pro 16.04 LTS 3.1.21-1ubuntu1+esm1
- smarty3 Ubuntu Pro 20.04 LTS 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1~esm1
ubuntu advisories UBUNTU-CVE-2021-21408
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-21408 updated cvss 8.8
php-Smarty: template authors could run restricted static php methods
-
Red Hat All currently supported Red Hat productsnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 18 mo ago
Exploit prediction
2.14% chance of exploitation in the next 30 days, higher than 82% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.5 | AV:N/AC:L/Au:S/C:P/I:P/A:P |
| GitHub | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| packagist | smarty/smarty | <3.1.43 >=4.0.0, <4.0.3 |
3.1.43 4.0.3 |
Affected products
- smarty-php smarty
Classification
- Weakness
-
- CWE-20 Improper Input Validation
References
-
github.com
/smarty-php/smarty/commit/19ae410bf56007a5ef24441cdc6414619cfaf664
web, patch, third-party-advisory
-
debian.org
/security/2022/dsa-5151
vendor-advisory, web, third-party-advisory
-
security.gentoo.org
/glsa/202209-09
vendor-advisory, web, third-party-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/
vendor-advisory
-
github.com
/smarty-php/smarty/security/advisories/GHSA-4h9c-v5vg-5m6m
web, third-party-advisory
-
github.com
/smarty-php/smarty/releases/tag/v3.1.43
web, release-notes, third-party-advisory
-
github.com
/smarty-php/smarty/releases/tag/v4.0.3
web, release-notes, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2022/05/msg00005.html
mailing-list, web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-21408
advisory
-
github.com
/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2021-21408.yaml
web
-
github.com
/smarty-php/smarty
package
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI
web
Sources
- CVE List CVE-2021-21408
- GitHub Advisory GHSA-4h9c-v5vg-5m6m
- NVD CVE-2021-21408
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.