[https://███] Local File Inclusion via graph.php
A local file inclusion vulnerability exists in ZendTo's graph.php due to unfiltered input in the 'm' parameter, allowing path traversal. An attacker with an account could read arbitrary local files, potentially leading to complete system compromise.
Originally disclosed on HackerOne
- Triaged in 13 hours
- Fixed in 4 months
- Disclosed after 15 months
Summary:
There exists a Local File Inclusion vulnerability on https://████ due to a known vulnerability in the ZendTo library. This was fixed in Version 5.16-6 Beta, although ██████ is still running ZendTo 5.11.
Impact
This allows path traversal in a file name that is then returned to the user. Depending on the PHP version ████ is running, this may allow escaping the appended suffix and reading arbitrary local files, which would allow complete compromise of the ██████ system.
Step-by-step Reproduction Instructions
To reproduce, this requires being an ████████ account. This could be exploited by sending a malicious link to an ████████ of ████████.
- If you have access to an █████ account on █████████, visit
https://█████/graph.php?p=7&m=../../../../../../usr/share/apache2/icons/pieas a POC. This loads an image of a pie, demonstrating the path traversal vulnerability. - Without access to an ████ account, visit my server at https://████/ and log in with username
████████and password██████. - Visit https://████/graph.php?m=dropoff_count&p=7&m=../../../../../../usr/share/apache2/icons/pie. Observe the tiny image of a pie, demonstrating path traversal.
Vulnerable Code
The following block of code (in graph.php) reads a file from the m parameter unfiltered:
if ( $period && ($metric = $_GET['m']) || ($metric = $_POST['metric']) ) {
if ( is_readable($path = RRD_DATA_DIR.$metric.$period.'.png') ) {
readfile($path);
exit(0);
}
}
Product, Version, and Configuration (If applicable)
ZendTo < 5.16-6 Beta
Suggested Mitigation/Remediation Actions
Update the ZendTo software.
Impact
.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application directly uses user input from the 'm' parameter to construct a file path without sanitising it, allowing directory traversal.
Impact
Depending on the PHP version, this may allow escaping the appended suffix and reading arbitrary local files, which would allow complete compromise of the system.
What the attacker needed
A valid account on the ZendTo instance
How it was found
- Log in to the ZendTo application with a valid account.
- Visit the URL with the 'm' parameter set to a path traversal sequence pointing to a known image file.
- Observe that the image is displayed, confirming the path traversal.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
The web application takes a file name from the user and uses it to read a file from the server without checking if it is safe. By using special characters like '../', an attacker can trick the server into reading files outside the intended folder, such as system files. This could let them see sensitive information or even take over the server.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.