{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-29454","id":"CVE-2021-29454","title":"Sandbox Escape by math function in smarty","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. User","descriptionLong":"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-10T00:00:00.000Z","updated":"2026-10-20T10:54:37.212015803Z","reserved":"2021-03-30T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","rating":"high","source":"GitHub_M"},"metrics":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","rating":"high","source":"GitHub_M"},{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","rating":"high","source":"github.com"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"NVD"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"OSV"},{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","rating":"high","source":"GitHub"},{"version":"2.0","score":6.5,"vector":"AV:N/AC:L/Au:S/C:P/I:P/A:P","rating":"medium","source":"NVD"}],"rating":"high","products":["smarty-php smarty"],"affectedProducts":[{"vendor":"smarty-php","product":"smarty","defaultStatus":null,"versions":[{"version":"< 3.1.42","status":"affected"},{"version":">= 4.0.0, < 4.0.2","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"Packagist","name":"smarty/smarty","purl":"pkg:composer/smarty/smarty","ranges":["<3.1.42",">=4.0.0 <4.0.2"],"fixed":["3.1.42","4.0.2"],"advisory":"GHSA-29gp-2c3m-3j6m"}],"cwes":["CWE-74"],"aliases":["GHSA-29gp-2c3m-3j6m"],"references":[{"url":"https://github.com/smarty-php/smarty/security/advisories/GHSA-29gp-2c3m-3j6m","tags":["x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/smarty-php/smarty/commit/215d81a9fa3cd63d82fb3ab56ecaf97cf1e7db71","tags":["x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v3.1.42","tags":["x_transferred","Release Notes","Third Party Advisory","advisory","web"]},{"url":"https://github.com/smarty-php/smarty/releases/tag/v4.0.2","tags":["x_transferred","Release Notes","Third Party Advisory","advisory","web"]},{"url":"https://packagist.org/packages/smarty/smarty","tags":["x_transferred","Product","Third Party Advisory","advisory","web"]},{"url":"https://www.smarty.net/docs/en/language.function.math.tpl","tags":["x_transferred","Vendor Advisory","advisory","web"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/05/msg00005.html","tags":["mailing-list","x_transferred","Mailing List","Third Party Advisory","advisory","web"]},{"url":"https://www.debian.org/security/2022/dsa-5151","tags":["vendor-advisory","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://security.gentoo.org/glsa/202209-09","tags":["vendor-advisory","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI/","tags":["vendor-advisory","x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ/","tags":["vendor-advisory","x_transferred","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29454","tags":["advisory"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2021-29454.yaml","tags":["web"]},{"url":"https://github.com/smarty-php/smarty","tags":["package"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BRAJVDRGCIY5UZ2PQHKDTT7RMKG6WJQQ","tags":["web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/L777JIBIWJV34HS7LXPIDWASG7TT4LNI","tags":["web"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total"},"epss":0.01861,"epssPercentile":0.79696,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-29454","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29454","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-29454","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-29gp-2c3m-3j6m","ok":true,"note":"GHSA-29gp-2c3m-3j6m"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-29454","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}