Skip to content
Emerging threatsCritical

CVE-2021-26120Smarty Code Injection

PHP Code Injection by malicious function name in smarty

Published Feb 22, 2021 · Updated Oct 23, 2026 · Also known as DEBIAN-CVE-2021-26120, GHSA-3rpf-5rqv-689q, UBUNTU-CVE-2021-26120

Key Facts

Patch immediately
  • CVE-2021-26120 is a critical-severity vulnerability (CVSS 9.8 v3.1) affecting Smarty, Debian Linux, smarty/smarty (composer) and 2 more products.
  • It is not listed in any known-exploited vulnerabilities catalog. No public exploit code is known.
  • EPSS estimates a 82% probability of exploitation in the next 30 days.
  • Fixed versions are available, including php-smarty 3.1.39-1.mga7, php-smarty 3.1.39-1.mga8, php-smarty 4.0.4-1.mga8.
  • Brandefense priority: patch immediately, because it is very likely to be exploited soon.

Scores

CVSS v3.1

9.8

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

EPSS (30-day exploit likelihood)

82%

Higher than 99.6% of all scored CVEs

Exploit maturity

None known

ATLAS score

39/100

Publication score, see How it works

Exploitation Verdict

KEV listed

Not listed

Federal due date

None

No federal due date

Ransomware use

Not reported

Attributed actors

None named

Exploit & Defence Guidance

Exploit maturity

None known

Public exploit code

0

Proof-of-concept links

In-the-wild evidence

0

Reports of active use

Description

Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring.

Affected Products

22 affected entries in total
ProductAffected versionsFixed in
SmartySmartySee advisory3.1.39
Debian LinuxDebian10.0, 11.0, 9.0n/a
smarty/smartycomposerSee advisory3.1.39
smarty3debianSee advisory3.1.39-1
php-smartymageiaSee advisory3.1.39-1.mga7

Patched Releases

php-smarty

3.1.39-1.mga7, 3.1.39-1.mga8, 4.0.4-1.mga8

Smarty

3.1.39

smarty/smarty

3.1.39

smarty3

3.1.21-1ubuntu1+esm1, 3.1.31+20161214.1.c7d42e4+selfpack1-2+deb9u2, 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1, 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1~esm1, 3.1.39-1

Timeline

  1. Publicly disclosed

    Feb 22, 2021

  2. Last updated

    Oct 23, 2026

Weakness Type

  • CWE-94 Improper Control of Generation of Code

References

15 more references in the full CVE brief

FAQ

Common Questions.

Is CVE-2021-26120 On Your Attack Surface?

Brandefense matches it against the products discovered on your perimeter and opens a finding the day a CVE like this is listed.

Request A Demo

Figures as of Dec 4, 2026. Compiled by Brandefense technologies from public vulnerability catalogs; scoring as described in How it works.

To report an error, contact Brandefense.