CVE-2021-21408
Access to restricted PHP code by dynamic static class access in smarty
Reported by github_m · Published January 10, 2022
smarty/smarty is fixed in 4.0.3 and 3.1.43 (Packagist)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| smarty/smarty | Packagist | 4.0.3, 3.1.43 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| smarty-php | smarty | < 3.1.43, >= 4.0.0, < 4.0.3 |
| smarty-php | smarty | 0, 4.0.0 |
Timeline
- Jan 10, 2022 CVE Published
- Jan 10, 2022 PoC Published
- Jan 11, 2022 EPSS Score (30 in total, the first dated here)
- Nov 21, 2024 CVE Updated
- Mar 7, 2026 Distribution Patch (4 in total, the first dated here)
- Mar 7, 2026 Security Advisory (6 in total, the first dated here)
- Aug 26, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2021-21408
vulnetix vdb fixes CVE-2021-21408
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2021-21408/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- [debian-lts-announce] 20220505 [SECURITY] [DLA 2995-1] smarty3 security update mailing-list
- DSA-5151 vendor-advisory
- GLSA-202209-09 vendor-advisory
- FEDORA-2022-52154efd61 vendor-advisory
- FEDORA-2022-d5fc9dcdd7 vendor-advisory