You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then when navigate in browser using following URL: http://localhost:8080/static/..%5c..%5c..%5cWindows%5cnotepad.exe, it is possible to download notepad.exe file.
When debugging, fond that above URL transates into following local resource URI: file:///C:/static/resource/html/..\\..\\..\\Windows\\notepad.exe, which is valid Windows URI and, which able to bypass DirectoryServerResource.preventUpperDirectoryAccess() check.
* Enforce directory path transversal issue. Issue #1332
* Added unit test case
* Fixed remaining issues under Windows
- Fixed detection logic for directory inclusion check
- toString for Directory now indicates the root URI
---------
Co-authored-by: Jerome Louvel <[email protected]>
Affected OS: Windows
Restlet version: 2.3.10
When use static files serving, it is possible to bypass upper directory check and download files, that are outside configured directory.
Considering following directory structure
and following code:
then when navigate in browser using following URL:
http://localhost:8080/static/..%5c..%5c..%5cWindows%5cnotepad.exe
, it is possible to download notepad.exe file.When debugging, fond that above URL transates into following local resource URI:
file:///C:/static/resource/html/..\\..\\..\\Windows\\notepad.exe
, which is valid Windows URI and, which able to bypass DirectoryServerResource.preventUpperDirectoryAccess() check.To workaround problem I use followng code:
The text was updated successfully, but these errors were encountered: