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.

Severity (CVSS 3.1)8.1High
Exploit odds (30 days)1.9%top 20.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:12smarty33.1.45-1DEBIAN-CVE-2021-29454
Debian:13smarty33.1.45-1DEBIAN-CVE-2021-29454
Debian:14smarty33.1.45-1DEBIAN-CVE-2021-29454
Debian:12smarty44.1.1-1DEBIAN-CVE-2021-29454
Debian:13smarty44.1.1-1DEBIAN-CVE-2021-29454
Debian:14smarty44.1.1-1DEBIAN-CVE-2021-29454
Packagistsmarty/smarty3.1.42GHSA-29gp-2c3m-3j6m
Packagistsmarty/smarty4.0.2GHSA-29gp-2c3m-3j6m
Ubuntu:22.04:LTSsmarty33.1.39-2ubuntu1UBUNTU-CVE-2021-29454

Affected products (as reported)

VendorProductVersions
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