CVE-2021-29454
published high CVSS 3.1 · 8.1Sandbox Escape by math function in smarty
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| smarty-php | — | smarty< 3.1.42 · >= 4.0.0, < 4.0.2 | Affected | Not stated | GitHub_M |
| Debian | bullseye | smarty3 | Advisory build | 3.1.39-2+deb11u1 | DSA-5151-1 |
| Ubuntu | bionic | smarty3 | Advisory build | 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1 | USN-5348-1 |
| Debian | buster | smarty3 | Advisory build | 3.1.33+20180830.1.3a78a21f+selfpack1-1+deb10u1 | DSA-5151-1 |
| Debian | stretch | smarty3 | Advisory build | 3.1.31+20161214.1.c7d42e4+selfpack1-2+deb9u5 | DLA-2995-1 |
| Ubuntu | focal | smarty3 | Advisory build | 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1~esm1 | USN-5348-3 |
| Ubuntu | xenial | smarty3 | Advisory build | 3.1.21-1ubuntu1+esm1 | USN-5348-2 |
Description
Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. Prior to versions 3.1.42 and 4.0.2, template authors could run arbitrary PHP code by crafting a malicious math string. If a math string was passed through as user provided data to the math function, external users could run arbitrary PHP code by crafting a malicious math string. Users should upgrade to version 3.1.42 or 4.0.2 to receive a patch.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 8.1 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| smarty-php | smarty | < 3.1.42 (affected)>= 4.0.0, < 4.0.2 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-74 CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
References
11- https://github.com/smarty-php/smarty/commit/215d81a9fa3cd63d82fb3ab56ecaf97cf1e7db71
- https://github.com/smarty-php/smarty/releases/tag/v3.1.42
- https://github.com/smarty-php/smarty/releases/tag/v4.0.2
- https://github.com/smarty-php/smarty/security/advisories/GHSA-29gp-2c3m-3j6m
- [debian-lts-announce] 20220505 [SECURITY] [DLA 2995-1] smarty3 security update https://lists.debian.org/debian-lts-announce/2022/05/msg00005.html
- FEDORA-2022-d5fc9dcdd7 https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/
- FEDORA-2022-52154efd61 https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/
- https://packagist.org/packages/smarty/smarty
- GLSA-202209-09 https://security.gentoo.org/glsa/202209-09
- DSA-5151 https://www.debian.org/security/2022/dsa-5151
- https://www.smarty.net/docs/en/language.function.math.tpl
Provider assertions
3GitHub_M · cna
Sandbox Escape by math function in smarty
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 30458aa719b431b4506c81af25297785bb9705a634a3a881807dd1930432e06f
- Ingested
- 23 Sep 2026, 07:53:55 UTC
- Source record
- Official CVE record