Every CVE Search/ Get API key

CVE-2018-13982

Smarty Path Traversal Vulnerability

7.5 HighFix available

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

3.46%Up 1.8 points since Apr 14, 2021
90%50%10%1%

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 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
CVSS 2.0
5.0 MediumAV: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
CVSS 3.0
7.5 HighCVSS: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

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:6
before 3.1.33-1.2.mga6
3.1.33-1.2.mga6
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-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

Show 22 moreShow less
MoveEnter Open