CVE-2018-13982
Smarty Path Traversal Vulnerability
Smarty_Security::isTrustedResourceDir() in Smarty before 3.1.33 is prone to a path traversal vulnerability due to insufficient template code sanitization. This allows attackers controlling the executed template code to bypass the trusted directory security restriction and read arbitrary files.
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
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
7.5
Smarty_Security::isTrustedResourceDir() in Smarty before 3.1.33 is prone to a path traversal vulnerability due to insufficient template code sanitization. This allows attackers controlling the executed template code to bypass the trusted directory security restriction and read arbitrary files.
- Record
CVE-2018-13982- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:P/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
CVE List No score
Smarty_Security::isTrustedResourceDir() in Smarty before 3.1.33 is prone to a path traversal vulnerability due to insufficient template code sanitization. This allows attackers controlling the executed template code to bypass the trusted directory security restriction and read arbitrary files.
- Record
CVE-2018-13982- Updated
- 2026-11-02
EUVDEUVD-2022-2995 No score
Smarty_Security::isTrustedResourceDir() in Smarty before 3.1.33 is prone to a path traversal vulnerability due to insufficient template code sanitization. This allows attackers controlling the executed template code to bypass the trusted directory security restriction and read arbitrary files.
- Record
EUVD-2022-2995- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-7gfx-wxfh-7rvm
7.5
Smarty Path Traversal Vulnerability
Smarty_Security::isTrustedResourceDir() in Smarty before 3.1.33 is prone to a path traversal vulnerability due to insufficient template code sanitization. This allows attackers controlling the executed template code to bypass the trusted directory security restriction and read arbitrary files.
- Record
GHSA-7gfx-wxfh-7rvm- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
OSV
7.5
Smarty_Security::isTrustedResourceDir() in Smarty before 3.1.33 is prone to a path traversal vulnerability due to insufficient template code sanitization. This allows attackers controlling the executed template code to bypass the trusted directory security restriction and read arbitrary files.
- Record
CVE-2018-13982- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVDEBIAN-CVE-2018-13982
7.5
Smarty_Security::isTrustedResourceDir() in Smarty before 3.1.33 is prone to a path traversal vulnerability due to insufficient template code sanitization. This allows attackers controlling the executed template code to bypass the trusted directory security restriction and read arbitrary files.
- Record
DEBIAN-CVE-2018-13982- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
Show 5 moreShow less
OSVGHSA-7gfx-wxfh-7rvm
7.5
Smarty Path Traversal Vulnerability
Smarty_Security::isTrustedResourceDir() in Smarty before 3.1.33 is prone to a path traversal vulnerability due to insufficient template code sanitization. This allows attackers controlling the executed template code to bypass the trusted directory security restriction and read arbitrary files.
- Record
GHSA-7gfx-wxfh-7rvm- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-22
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2018-13982
7.5
Smarty_Security::isTrustedResourceDir() in Smarty before 3.1.33 is prone to a path traversal vulnerability due to insufficient template code sanitization. This allows attackers controlling the executed template code to bypass the trusted directory security restriction and read arbitrary files.
- Record
UBUNTU-CVE-2018-13982- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVMGASA-2018-0403 No score
Updated php-smarty packages fix security vulnerability
Smarty 3.1.32 or below is prone to a path traversal vulnerability due to insufficient template code sanitization. This allows attackers controlling the executed template code to bypass the trusted directory security restriction and read arbitrary files (CVE-2018-13982).
- Record
MGASA-2018-0403- 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:6 |
before 3.1.33-1.2.mga6 | 3.1.33-1.2.mga6 |
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-13982 is a high vulnerability (CVSS 7.5) in Smarty, published September 18, 2018. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 3.46%, the 89th percentile. Fixed in smarty/smarty 3.1.33.
References
github.com/smarty-php/smarty/commit/2e081a51b1effddb23f87952959139ac62654d50
github.com/smarty-php/smarty/commit/f9ca3c63d1250bb56b2bda609dcc9dd81f0065f8
github.com/smarty-php/smarty/commit/c9dbe1d08c081912d02bd851d1d1b6388f6133d1
github.com/smarty-php/smarty/commit/8d21f38dc35c4cd6b31c2f23fc9b8e5adbc56dfe
github.com/smarty-php/smarty/commit/bcedfd6b58bed4a7366336979ebaa5a240581531
github.com/sbaresearch/advisories/tree/public/2018/SBA-ADV-20180420-01_Smarty_Path_Traversal
Show 22 moreShow less
lists.debian.org/debian-lts-announce/2021/04/msg00004.html
lists.debian.org/debian-lts-announce/2021/04/msg00014.html
lists.debian.org/debian-lts-announce/2021/10/msg00015.html
nvd.nist.gov/vuln/detail/CVE-2018-13982
github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2018-13982.yaml
github.com/advisories/GHSA-7gfx-wxfh-7rvm
security-tracker.debian.org/tracker/CVE-2018-13982
github.com/smarty-php/smarty
advisories.mageia.org/MGASA-2018-0403.html
bugs.mageia.org/show_bug.cgi?id=23592
openwall.com/lists/oss-security/2018/09/17/4
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-13982
cve.org/CVERecord?id=CVE-2018-13982
ubuntu.com/security/CVE-2018-16831
ubuntu.com/security/CVE-2021-21408
ubuntu.com/security/CVE-2021-26119
ubuntu.com/security/CVE-2021-26120
ubuntu.com/security/CVE-2021-29454