-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
It looks like you can easily attack a server written with this library via a directory traversal method.
The %2e%2e%5c character is equivalent to .. so by forging a special url, you can easily request any file on current drive (windows) or anywhere in the system (linux). There are some other equivalent characters too, I've only tested with the one above.
The is_valid_path function only tests against "..", but the list should be way longer.
You can traverse back from a folder (mount point) all the way to any folder and request files such as win.ini or /etc/passwd, expecially when you use the library from a service with elevated access.
This issue is extremely severe in my opinion, is there any way to prevent this behaviour?