Path Traversal in pheditor/pheditor

Valid

Reported on

Sep 14th 2021


Description

A path traversal attack (also known as directory traversal) aims to access files and directories that are stored outside the web root folder. By manipulating variables that reference files with “dot-dot-slash (../)” sequences and its variations or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system including application source code or configuration and critical system files.

https://github.com/pheditor/pheditor is vulnerable to path traversal as shown below:

Proof of Concept

Variable: $_GET['path']
Snippet:

if (isset($_GET['path'])) {
    header('Content-Type: application/json');

    $dir = rtrim(MAIN_DIR . DS . trim($_GET['path'], '/'), '/');
    

Payload
Login to pheditor
Visit the following link in a browser:

http://localhost/pheditor-2/pheditor.php?path=../../../../etc

This will list all files on /etc/

Impact

In some cases, an attacker might be able to write to arbitrary files on the server, allowing them to modify application data or behavior, and ultimately take full control of the server.

We created a GitHub Issue asking the maintainers to create a SECURITY.md 2 years ago
Z-Old
2 years ago

Admin


Hey hitisec, I've emailed the maintainers for you.

We have contacted a member of the pheditor team and are waiting to hear back 2 years ago
pheditor/pheditor maintainer validated this vulnerability 2 years ago
hitisec has been awarded the disclosure bounty
The fix bounty is now up for grabs
pheditor/pheditor maintainer marked this as fixed with commit 69a79e 2 years ago
The fix bounty has been dropped
This vulnerability will not receive a CVE
to join this conversation