Every CVE Search/ Get API key

CVE-2018-16831

Smarty Path Traversal Vulnerability

5.9 MediumFix available

Smarty before 3.1.33-dev-4 allows attackers to bypass the trusted_dir protection mechanism via a file:./../ substring in an include statement.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
None
Availability
None

Exploit likelihood

2.66%Up 2.2 points since Apr 14, 2021
90%50%10%1%

What each source reports

NVD Score used 5.9

Smarty before 3.1.33-dev-4 allows attackers to bypass the trusted_dir protection mechanism via a file:./../ substring in an include statement.

Record
CVE-2018-16831
CVSS 3.0
5.9 MediumCVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
CVSS 2.0
7.1 HighAV:N/AC:M/Au:N/C:C/I:N/A:N
Weakness
CWE-22
Updated
2026-11-02
CVE List No score

Smarty before 3.1.33-dev-4 allows attackers to bypass the trusted_dir protection mechanism via a file:./../ substring in an include statement.

Record
CVE-2018-16831
Updated
2026-11-02
EUVDEUVD-2022-2716 No score

Smarty before 3.1.33-dev-4 allows attackers to bypass the trusted_dir protection mechanism via a file:./../ substring in an include statement.

Record
EUVD-2022-2716
Updated
2026-11-03
GitHub AdvisoriesGHSA-65j5-vpm7-6xp4 5.9

Smarty Path Traversal Vulnerability

Smarty before 3.1.33-dev-4 allows attackers to bypass the trusted_dir protection mechanism via a file:./../ substring in an include statement.

Record
GHSA-65j5-vpm7-6xp4
CVSS 3.0
5.9 MediumCVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness
CWE-22
Updated
2026-11-02
OSV 5.9

Smarty before 3.1.33-dev-4 allows attackers to bypass the trusted_dir protection mechanism via a file:./../ substring in an include statement.

Record
CVE-2018-16831
CVSS 3.0
5.9 MediumCVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-02
OSVDEBIAN-CVE-2018-16831 5.9

Smarty before 3.1.33-dev-4 allows attackers to bypass the trusted_dir protection mechanism via a file:./../ substring in an include statement.

Record
DEBIAN-CVE-2018-16831
CVSS 3.0
5.9 MediumCVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-02
Show 4 moreShow less
OSVGHSA-65j5-vpm7-6xp4 5.9

Smarty Path Traversal Vulnerability

Smarty before 3.1.33-dev-4 allows attackers to bypass the trusted_dir protection mechanism via a file:./../ substring in an include statement.

Record
GHSA-65j5-vpm7-6xp4
CVSS 3.0
5.9 MediumCVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness
CWE-22
Updated
2026-11-02
OSVUBUNTU-CVE-2018-16831 5.9

Smarty before 3.1.33-dev-4 allows attackers to bypass the trusted_dir protection mechanism via a file:./../ substring in an include statement.

Record
UBUNTU-CVE-2018-16831
CVSS 3.0
5.9 MediumCVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
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

Affected products

Affected packages

Affected packages
PackageAffectedFixed
smarty/smarty
Packagist
before 3.1.33
3.1.33
smarty3
Debian:12
before 3.1.33+20180830.1.3a78a21f+selfpack1-1
3.1.33+20180830.1.3a78a21f+selfpack1-1
smarty3
Debian:13
before 3.1.33+20180830.1.3a78a21f+selfpack1-1
3.1.33+20180830.1.3a78a21f+selfpack1-1
smarty3
Debian:14
before 3.1.33+20180830.1.3a78a21f+selfpack1-1
3.1.33+20180830.1.3a78a21f+selfpack1-1
smarty3
Debian:9
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.33, plus listed versions
v2.6.24v2.6.25v2.6.26v2.6.27v2.6.28
Show 25 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.32
3.1.33
php-smarty
Mageia:8
before 4.0.4-1.mga8
4.0.4-1.mga8
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

History

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

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

In short

CVE-2018-16831 is a medium vulnerability (CVSS 5.9) in Smarty, published September 11, 2018. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.66%, the 85th percentile. Fixed in smarty/smarty 3.1.33.

References

Show 12 moreShow less
MoveEnter Open