Vulnerability · Published Jan 10, 2022 · Assigned by GitHub_M
CVE-2021-29454Sandbox Escape by math function in smarty
High 8.1
In plain English
A high-severity injection in smarty from smarty-php. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.9% (higher than 79% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | smarty3 | 3.1.45-1 | DEBIAN-CVE-2021-29454 |
| Debian:13 | smarty3 | 3.1.45-1 | DEBIAN-CVE-2021-29454 |
| Debian:14 | smarty3 | 3.1.45-1 | DEBIAN-CVE-2021-29454 |
| Debian:12 | smarty4 | 4.1.1-1 | DEBIAN-CVE-2021-29454 |
| Debian:13 | smarty4 | 4.1.1-1 | DEBIAN-CVE-2021-29454 |
| Debian:14 | smarty4 | 4.1.1-1 | DEBIAN-CVE-2021-29454 |
| Packagist | smarty/smarty | 3.1.42 | GHSA-29gp-2c3m-3j6m |
| Packagist | smarty/smarty | 4.0.2 | GHSA-29gp-2c3m-3j6m |
| Ubuntu:22.04:LTS | smarty3 | 3.1.39-2ubuntu1 | UBUNTU-CVE-2021-29454 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| smarty-php | smarty | < 3.1.42>= 4.0.0, < 4.0.2 |
Weakness: CWE-74 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
References
- https://github.com/smarty-php/smarty/security/advisories/GHSA-29gp-2c3m-3j6m
- 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://packagist.org/packages/smarty/smarty
- https://www.smarty.net/docs/en/language.function.math.tpl
- [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