Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. smarty/smarty
  4. ›
  5. CVE-2021-29454

CVE-2021-29454: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

January 10, 2022 (updated November 7, 2023)

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic. 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.

References

  • github.com/smarty-php/smarty/commit/215d81a9fa3cd63d82fb3ab56ecaf97cf1e7db71
  • github.com/smarty-php/smarty/releases/tag/v3.1.42
  • github.com/smarty-php/smarty/releases/tag/v4.0.2
  • github.com/smarty-php/smarty/security/advisories/GHSA-29gp-2c3m-3j6m
  • nvd.nist.gov/vuln/detail/CVE-2021-29454
  • packagist.org/packages/smarty/smarty
  • www.smarty.net/docs/en/language.function.math.tpl

Code Behaviors & Features

Detect and mitigate CVE-2021-29454 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 3.1.42, all versions starting from 4.0.0 before 4.0.2

Fixed versions

  • 3.1.42
  • 4.0.2

Solution

Upgrade to versions 3.1.42, 4.0.2 or above.

Impact 8.8 HIGH

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

Learn more about CVSS

Weakness

  • CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

Source file

packagist/smarty/smarty/CVE-2021-29454.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:16 +0000.