PHP file inclusion in Smarty - CVE-2018-16831

 

PHP file inclusion in Smarty - CVE-2018-16831

Published: March 28, 2022


Vulnerability identifier: #VU61663
CSH Severity: High
CVSS v4: 9.3 [CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2018-16831
CWE-ID: CWE-98
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to include and execute arbitrary PHP files on the server.

The vulnerability exists due to incorrect input validation when including PHP files. A remote non-authenticated attacker can send a specially crafted HTTP request to the affected application, bypass the trusted_dir protection mechanism via a file:./../ substring in an include statemen, include and execute arbitrary PHP code on the system with privileges of the web server.


Affected software

Smarty
Fedora
Ubuntu
smarty3 (Ubuntu package)
php-Smarty

How to mitigate CVE-2018-16831

Install updates from vendor's website.

Smarty - update to 3.1.33
smarty3 (Ubuntu package) - addressed in versions 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1, 3.1.39-2ubuntu0.21.10.1
php-Smarty - addressed in versions 3.1.33-1.el7, 3.1.33-1.fc28, 3.1.33-1.fc29

External References

Related Security Bulletins