VDB

CVE-2021-29454

CVE-2021-29454 PUBLISHED CVSS 8.1 HIGH

Sandbox Escape by math function in smarty

Reported by github_m · Published January 10, 2022

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
smarty3Ubuntu:18.04:LTS3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1
smartysmarty4.0.2, 3.1.42

Risk scores

CVSS 3.1
8.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

Affected products

VendorProductVersions
smarty-phpsmarty< 3.1.42, >= 4.0.0, < 4.0.2
smarty-phpsmarty0, 4.0.0
smartysmarty0, 4.0.0

Timeline

  • Jan 10, 2022 CVE 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 5, 2026 Coalition ESS Score

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2021-29454
vulnetix vdb fixes CVE-2021-29454

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-29454/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›