CVE-2018-16831
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.
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
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 Medium
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - CVSS 2.0
- 7.1 High
AV: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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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
| Package | Affected | Fixed |
|---|---|---|
smarty/smartyPackagist |
before 3.1.33 | 3.1.33 |
smarty3Debian:12 |
before 3.1.33+20180830.1.3a78a21f+selfpack1-1 | 3.1.33+20180830.1.3a78a21f+selfpack1-1 |
smarty3Debian:13 |
before 3.1.33+20180830.1.3a78a21f+selfpack1-1 | 3.1.33+20180830.1.3a78a21f+selfpack1-1 |
smarty3Debian:14 |
before 3.1.33+20180830.1.3a78a21f+selfpack1-1 | 3.1.33+20180830.1.3a78a21f+selfpack1-1 |
smarty3Debian: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/smartyPackagist |
before 3.1.33, plus listed versions v2.6.24v2.6.25v2.6.26v2.6.27v2.6.28 Show 25 moreShow lessv2.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-smartyMageia:8 |
before 4.0.4-1.mga8 | 4.0.4-1.mga8 |
smarty3Ubuntu: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
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE 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
github.com/smarty-php/smarty/issues/486
nvd.nist.gov/vuln/detail/CVE-2018-16831
github.com/smarty-php/smarty/commit/f9ca3c63d1250bb56b2bda609dcc9dd81f0065f8
github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2018-16831.yaml
github.com/advisories/GHSA-65j5-vpm7-6xp4
security-tracker.debian.org/tracker/CVE-2018-16831
Show 12 moreShow less
github.com/smarty-php/smarty
advisories.mageia.org/MGASA-2022-0127.html
bugs.mageia.org/show_bug.cgi?id=30214
ubuntu.com/security/notices/USN-5348-1
github.com/smarty-php/smarty/releases/tag/v4.0.4
ubuntu.com/security/CVE-2018-16831
cve.org/CVERecord?id=CVE-2018-16831
ubuntu.com/security/CVE-2018-13982
ubuntu.com/security/CVE-2021-21408
ubuntu.com/security/CVE-2021-26119
ubuntu.com/security/CVE-2021-26120
ubuntu.com/security/CVE-2021-29454