Every CVE Search/ Get API key

CVE-2021-26119

Sandbox escape through template_object in smarty

7.5 HighFix available

Smarty before 3.1.39 allows a Sandbox Escape because $smarty.template_object can be accessed in sandbox mode.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
High
Availability
None

Exploit likelihood

8.49%Up 5.8 points since Apr 14, 2021
90%50%10%1%

What each source reports

NVD Score used 7.5

Smarty before 3.1.39 allows a Sandbox Escape because $smarty.template_object can be accessed in sandbox mode.

Record
CVE-2021-26119
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
CVSS 2.0
5.0 MediumAV:N/AC:L/Au:N/C:N/I:P/A:N
Updated
2026-11-02
CVE List No score

Smarty before 3.1.39 allows a Sandbox Escape because $smarty.template_object can be accessed in sandbox mode.

Record
CVE-2021-26119
Updated
2026-11-02
EUVDEUVD-2021-0717 No score

Smarty before 3.1.39 allows a Sandbox Escape because $smarty.template_object can be accessed in sandbox mode.

Record
EUVD-2021-0717
Updated
2026-11-03
GitHub AdvisoriesGHSA-w5hr-jm4j-9jvq 7.5

Sandbox escape through template_object in smarty

Sandbox protection could be bypassed through access to an internal Smarty object that should have been blocked. Sites that rely on Smarty Security features should upgrade as soon as possible. Please upgrade to 3.1.39 or higher.

Record
GHSA-w5hr-jm4j-9jvq
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-02
OSV 7.5

Smarty before 3.1.39 allows a Sandbox Escape because $smarty.template_object can be accessed in sandbox mode.

Record
CVE-2021-26119
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-02
OSVDEBIAN-CVE-2021-26119 7.5

Smarty before 3.1.39 allows a Sandbox Escape because $smarty.template_object can be accessed in sandbox mode.

Record
DEBIAN-CVE-2021-26119
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-02
Show 7 moreShow less
OSVGHSA-w5hr-jm4j-9jvq 7.5

Sandbox escape through template_object in smarty

Sandbox protection could be bypassed through access to an internal Smarty object that should have been blocked. Sites that rely on Smarty Security features should upgrade as soon as possible. Please upgrade to 3.1.39 or higher.

Record
GHSA-w5hr-jm4j-9jvq
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-02
OSVUBUNTU-CVE-2021-26119 7.5

Smarty before 3.1.39 allows a Sandbox Escape because $smarty.template_object can be accessed in sandbox mode.

Record
UBUNTU-CVE-2021-26119
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Updated
2026-11-02
OSVMGASA-2021-0335 No score

Updated php-smarty package fixes security vulnerabilities

Smarty before 3.1.39 allows a Sandbox Escape because $smarty.template_object can be accessed in sandbox mode (CVE-2021-26119).

Smarty before 3.1.39 allows code injection via an unexpected function name after a {function name= substring (CVE-2021-26120).

Record
MGASA-2021-0335
Updated
2026-11-02
OSVMGASA-2022-0127 No score

Updated php-smarty packages fix security vulnerability

Updated php-smarty packages to version 4 for php 8 compatibility and to fix security vulnerabilities.

Record
MGASA-2022-0127
Updated
2026-11-02
OSVUSN-5348-1 No score

smarty3 vulnerabilities

David Gnedt and Thomas Konrad discovered that Smarty was incorrectly sanitizing the paths present in the templates. An attacker could possibly use this use to read arbitrary files when controlling the executed template. (CVE-2018-13982)

It was discovered that Smarty was incorrectly sanitizing the paths present in the templates. An attacker could possibly use this use to read arbitrary files when controlling the executed template. (CVE-2018-16831)

It was discovered that Smarty was incorrectly validating security policy data, allowing the execution of static classes even when not permitted by the security settings. An attacker could possibly use this issue to execute arbitrary code. (CVE-2021-21408)

It was discovered that Smarty was incorrectly managing access control to template objects, which allowed users to perform a sandbox escape. An attacker could possibly use this issue to send specially crafted input to applications that use Smarty and execute arbitrary code. (CVE-2021-26119)

It was discovered that Smarty was not checking for special characters when setting function names during plugin compile operations. An attacker could possibly use this issue to send specially crafted input to applications that use Smarty and execute arbitrary code. (CVE-2021-26120)

It was discovered that Smarty was incorrectly sanitizing characters in math strings processed by the math function. An attacker could possibly use this issue to send specially crafted input to applications that use Smarty and execute arbitrary code. (CVE-2021-29454)

Record
USN-5348-1
Updated
2026-11-02
OSVUSN-5348-2 No score

smarty3 vulnerabilities

USN-5348-1 fixed several vulnerabilities in Smarty. This update provides the fixes for CVE-2021-21408, CVE-2021-26119, CVE-2021-26120 and CVE-2021-29454 for Ubuntu 16.04 ESM.

Original advisory details:

David Gnedt and Thomas Konrad discovered that Smarty was incorrectly sanitizing the paths present in the templates. An attacker could possibly use this use to read arbitrary files when controlling the executed template. (CVE-2018-13982)

It was discovered that Smarty was incorrectly sanitizing the paths present in the templates. An attacker could possibly use this use to read arbitrary files when controlling the executed template. (CVE-2018-16831)

It was discovered that Smarty was incorrectly validating security policy data, allowing the execution of static classes even when not permitted by the security settings. An attacker could possibly use this issue to execute arbitrary code. (CVE-2021-21408)

It was discovered that Smarty was incorrectly managing access control to template objects, which allowed users to perform a sandbox escape. An attacker could possibly use this issue to send specially crafted input to applications that use Smarty and execute arbitrary code. (CVE-2021-26119)

It was discovered that Smarty was not checking for special characters when setting function names during plugin compile operations. An attacker could possibly use this issue to send specially crafted input to applications that use Smarty and execute arbitrary code. (CVE-2021-26120)

It was discovered that Smarty was incorrectly sanitizing characters in math strings processed by the math function. An attacker could possibly use this issue to send specially crafted input to applications that use Smarty and execute arbitrary code. (CVE-2021-29454)

Record
USN-5348-2
Updated
2026-11-02
OSVUSN-5348-3 No score

smarty3 vulnerabilities

USN-5348-1 fixed several vulnerabilities in Smarty. This update provides the fixes for CVE-2021-21408, CVE-2021-26119, CVE-2021-26120 and CVE-2021-29454 for Ubuntu 20.04 ESM.

Original advisory details:

David Gnedt and Thomas Konrad discovered that Smarty was incorrectly sanitizing the paths present in the templates. An attacker could possibly use this use to read arbitrary files when controlling the executed template. (CVE-2018-13982)

It was discovered that Smarty was incorrectly sanitizing the paths present in the templates. An attacker could possibly use this use to read arbitrary files when controlling the executed template. (CVE-2018-16831)

It was discovered that Smarty was incorrectly validating security policy data, allowing the execution of static classes even when not permitted by the security settings. An attacker could possibly use this issue to execute arbitrary code. (CVE-2021-21408)

It was discovered that Smarty was incorrectly managing access control to template objects, which allowed users to perform a sandbox escape. An attacker could possibly use this issue to send specially crafted input to applications that use Smarty and execute arbitrary code. (CVE-2021-26119)

It was discovered that Smarty was not checking for special characters when setting function names during plugin compile operations. An attacker could possibly use this issue to send specially crafted input to applications that use Smarty and execute arbitrary code. (CVE-2021-26120)

It was discovered that Smarty was incorrectly sanitizing characters in math strings processed by the math function. An attacker could possibly use this issue to send specially crafted input to applications that use Smarty and execute arbitrary code. (CVE-2021-29454)

Record
USN-5348-3
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
smarty/smarty
Packagist
before 3.1.39
3.1.39
smarty3
Debian:12
before 3.1.39-1
3.1.39-1
smarty3
Debian:13
before 3.1.39-1
3.1.39-1
smarty3
Debian:14
before 3.1.39-1
3.1.39-1
smarty3
Debian:9
From an advisory covering 4 CVEs
before 3.1.31+20161214.1.c7d42e4+selfpack1-2+deb9u2, plus listed versions
3.1.31+20161214.1.c7d42e4+selfpack1-23.1.31+20161214.1.c7d42e4+selfpack1-2+deb9u1
3.1.31+20161214.1.c7d42e4+selfpack1-2+deb9u2
smarty/smarty
Packagist
before 3.1.39, plus listed versions
v2.6.24v2.6.25v2.6.26v2.6.27v2.6.28
Show 32 moreShow less
v2.6.29v2.6.30v2.6.31v2.6.33v3.1.11v3.1.12v3.1.13v3.1.14v3.1.15v3.1.16v3.1.17v3.1.18v3.1.19v3.1.20v3.1.21v3.1.23v3.1.24v3.1.25v3.1.26v3.1.27v3.1.28v3.1.29v3.1.30v3.1.31v3.1.32v3.1.33v3.1.34v3.1.35v3.1.36v3.1.37v3.1.37.1v3.1.38
3.1.39
php-smarty
Mageia:7
From an advisory covering 2 CVEs
before 3.1.39-1.mga7
3.1.39-1.mga7
php-smarty
Mageia:8
From an advisory covering 2 CVEs
before 3.1.39-1.mga8
3.1.39-1.mga8
php-smarty
Mageia:8
From an advisory covering 6 CVEs
before 4.0.4-1.mga8
4.0.4-1.mga8
smarty3
Ubuntu:Pro:16.04:LTS
before 3.1.21-1ubuntu1+esm1, plus listed versions
3.1.21-13.1.21-1ubuntu1
3.1.21-1ubuntu1+esm1
Show 5 moreShow less
Affected packages
PackageAffectedFixed
smarty3
Ubuntu:18.04:LTS
before 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1, plus listed versions
3.1.31+20161214.1.c7d42e4+selfpack1-23.1.31+20161214.1.c7d42e4+selfpack1-3
3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1
smarty3
Ubuntu:Pro:20.04:LTS
before 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1~esm1, plus listed versions
3.1.33+20180830.1.3a78a21f+selfpack1-13.1.34+20190228.1.c9f0de05+selfpack1-1
3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1~esm1
smarty3
Ubuntu:18.04:LTS
From an advisory covering 6 CVEs
before 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1, plus listed versions
3.1.31+20161214.1.c7d42e4+selfpack1-23.1.31+20161214.1.c7d42e4+selfpack1-3
3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1
smarty3
Ubuntu:Pro:16.04:LTS
From an advisory covering 4 CVEs
before 3.1.21-1ubuntu1+esm1, plus listed versions
3.1.21-13.1.21-1ubuntu1
3.1.21-1ubuntu1+esm1
smarty3
Ubuntu:Pro:20.04:LTS
From an advisory covering 4 CVEs
before 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1~esm1, plus listed versions
3.1.33+20180830.1.3a78a21f+selfpack1-13.1.34+20190228.1.c9f0de05+selfpack1-1
3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1~esm1

History

History
RecordedChangedSources
affected, facts
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-26119 is a high vulnerability (CVSS 7.5) in Smarty, published February 22, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 8.49%, the 95th percentile. Fixed in smarty/smarty 3.1.39.

References

Show 23 moreShow less
MoveEnter Open