Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Security issue fix for /static-files/{path} endpoint #1003

Merged
merged 2 commits into from
Nov 15, 2021

Conversation

mihran113
Copy link
Contributor

Fix security issue when incorrect path is given to the endpoint that serves static files which can lead to a leak of files (e.g. /static-files/../../../../etc/passwd)

…serves static files which can lead to a leak of non wanted files (e.g. /static-files/../../../../etc/passwd)
@mihran113
Copy link
Contributor Author

resolves #999

@haby0
Copy link

haby0 commented Nov 13, 2021

If you use os.path.join(static_file_root, path) to join the path, the path parameter value cannot have / or \\, Otherwise, the request will definitely make the result of if judgment as True.

@mihran113
Copy link
Contributor Author

If you use os.path.join(static_file_root, path) to join the path, the path parameter value cannot have / or \\, Otherwise, the request will definitely make the result of if judgment as True.

I think you meant that if the path starts with / or \\ then os.path.join won't work as expected. Yeah, that's a valid concern, but our UI handles that. Anyways will change that with usual join to avoid any failures. Thanks for the comment.

@mihran113 mihran113 merged commit b9e53df into main Nov 15, 2021
@mihran113 mihran113 deleted the feature/fix-security-issue branch November 15, 2021 10:46
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants