{"id":"CVE-2021-29454","aliases":["GHSA-29gp-2c3m-3j6m"],"url":"https://o3.security/vulnerability/CVE-2021-29454","summary":"Sandbox Escape by math function in smarty","details":"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.","published":"2022-01-10T20:15:08Z","modified":"2026-07-08T06:27:22.781671004Z","cvss":{"score":8.8,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"},"epss":{"score":0.01927,"percentile":0.78147,"asOf":"2026-08-23"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"smarty/smarty","fixedVersion":"3.1.42"},{"ecosystem":"Packagist","name":"smarty/smarty","fixedVersion":"4.0.2"}],"fix":{"url":"https://github.com/smarty-php/smarty/commit/215d81a9fa3cd63d82fb3ab56ecaf97cf1e7db71","label":"smarty-php/smarty@215d81a"},"references":[{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/"},{"type":"ADVISORY","url":"https://github.com/smarty-php/smarty/releases/tag/v3.1.42"},{"type":"ADVISORY","url":"https://github.com/smarty-php/smarty/releases/tag/v4.0.2"},{"type":"ADVISORY","url":"https://github.com/smarty-php/smarty/security/advisories/GHSA-29gp-2c3m-3j6m"},{"type":"ADVISORY","url":"https://lists.debian.org/debian-lts-announce/2022/05/msg00005.html"},{"type":"ADVISORY","url":"https://packagist.org/packages/smarty/smarty"},{"type":"ADVISORY","url":"https://security.gentoo.org/glsa/202209-09"},{"type":"ADVISORY","url":"https://www.debian.org/security/2022/dsa-5151"},{"type":"ADVISORY","url":"https://www.smarty.net/docs/en/language.function.math.tpl"},{"type":"FIX","url":"https://github.com/smarty-php/smarty/commit/215d81a9fa3cd63d82fb3ab56ecaf97cf1e7db71"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-07-08T06:27:22.781671004Z"}}