Lucene search

K
huntrKevin-mizu07755F07-A412-4911-84A4-2F8C03C8F7CE
HistoryMay 22, 2022 - 8:05 p.m.

Path Traversal

2022-05-2220:05:50
kevin-mizu
www.huntr.dev
13
path traversal
user privilege
file sanitization
proof of concept
directory traversal
file creation
security bug

EPSS

0.001

Percentile

38.2%

🔒️ Requirements

Privilege: User

📝 Description

File path isn’t properly sanitized and allow ..\.

🕵️‍♂️ Proof of Concept

Listing other user folder content

First, create a user with Read privilege and with specific home folder like /test. Then, Connect to his account and access the home page http://localhost:8080/:

PT_1.png

From this, change folder using path traversal via cd parameter:

PT_2.png

As you can see, we are able to view folder content.

Write file

First, create a user with Read and Write privileges and with specific home folder like /test. Then, Connect to his account and access the home page http://localhost:8080/. From here create a new file named ..\test.txt and then go to the root folder with another account:

PT_4.png

You will see that the file was created outside of the test user’s folder limitation.

PS: Note that the same could be done to all features in the file https://github.com/filegator/filegator/blob/642bb273334207359166d48b6c719a89e98a0676/backend/Controllers/FileController.php due to:

$this->separator

EPSS

0.001

Percentile

38.2%

Related for 07755F07-A412-4911-84A4-2F8C03C8F7CE