stephenmcd / filebrowser-safe

File manager for Mezzanine
Other
41 stars 104 forks source link

[BUG] Relative Path traversal in file_browser #137

Closed ktg9 closed 2 years ago

ktg9 commented 2 years ago

Is there an existing issue for this?

Current Behavior

Hi there, I would like to report a path traversal in mezzanine. The request /admin/media-library/browse/?o=date&ot=desc&dir= is used to retrieved files and folder in directory inside Media Library management. However, dir is not checked for path traversal and thus allowing hackers to retrieve file all file contents under /media folder.

Expected Behavior

Mezzanine should have blocked the use of .. in path request

Steps To Reproduce

I will use your demo site as an example

  1. Access the link http://mezzanine.jupo.org/en/admin/media-library/browse/?ot=desc&o=date&dir=dgray/../../../media/ and log in using demo account
  2. See that you can see all folders/files under /media directory.

Environment

- Operating System:
- Python version:
- Django version:
- Database engine and version:
- Mezzanine version:

Anything else?

No response

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 1.1.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

ktg9 commented 2 years ago

Hi there, could you please validate the issue on huntr.dev for me? Here is the link https://huntr.dev/bounties/63138b59-6c92-4581-aac4-57f42baf1af4/

ktg9 commented 2 years ago

@jerivas could you validate this for me? https://huntr.dev/bounties/63138b59-6c92-4581-aac4-57f42baf1af4/

jerivas commented 2 years ago

I marked the report as valid, but it was created against Mezzanine and I can't report the fix since it was applied to filebrowser_safe. Could you update the report to relate it to this repo?

ktg9 commented 2 years ago

HI there @jerivas , I tried and think that there's no way we can update the report to relate to this repo. So I think we just leave like that.