CVE-2017-15363: Luracast Restler Directory Traversal Vulnerability
Summary
CVE-2017-15363: Luracast Restler directory traversal vulnerability. Affects aoe/restler versions < 1.7.1. Fixed in 1.7.1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Luracast Restler is an open-source PHP framework designed for building RESTful APIs. It simplifies the process of creating web services by providing a set of tools and conventions. However, versions prior to 3.1.0 are susceptible to a directory traversal vulnerability, which can lead to unauthorized access to sensitive files on the server.
Vulnerability Detail
The directory traversal vulnerability in Luracast Restler, specifically in the getsource.php file located in the public/examples/resources directory, allows remote attackers to manipulate the 'file' parameter. By exploiting this flaw, an attacker can read arbitrary files on the server, potentially exposing sensitive information. This vulnerability arises from improper validation of user input, which can lead to significant security risks, including data leakage and unauthorized access.
How To Fix
Minimum fixed version
1.7.1
This is the first release that contains the fix.
composer require aoe/restler:1.7.1
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can implement input validation to restrict the 'file' parameter to only allow specific, safe file paths. This can be done by sanitizing the input and checking against a whitelist of allowed files. For example, you can modify the code handling the 'file' parameter to include checks like this:
if (!in_array($file, $allowedFiles)) {
throw new Exception('Invalid file request.');
}
Conclusion
The directory traversal vulnerability in Luracast Restler poses significant risks to applications using affected versions. It is crucial to update to the latest version to protect against potential attacks. Implementing input validation can serve as a temporary measure while preparing for the update.
See every vulnerability recorded for aoe/restler →
FAQ
A directory traversal vulnerability allows an attacker to access files and directories that are stored outside the web root folder. This can lead to unauthorized access to sensitive files.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
Exploitation of this vulnerability can lead to data leakage, unauthorized access to sensitive information, and potential compromise of the entire application.
Yes, the CVSS score for this vulnerability is 7.5, indicating a high severity level.
If immediate updates are not possible, implement input validation as a temporary workaround to mitigate the risk of exploitation.