-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't ignore local packages when watching #96
Conversation
@@ -117,23 +117,25 @@ def index( | |||
) | |||
|
|||
path = frontend_dir / "static" / file_name | |||
if path.exists() and under_frontend_dir(frontend_dir, path): | |||
if path.exists(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure it is a good idea to remove the security check under_frontend_dir(frontend_dir, path)
?
The reason for this check is not to allow requesting files that are not under the frontend_dir
directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for merging early @hbcarlos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will always be true as path = frontend_dir / "static" / file_name
(see line above L119)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and if the file_name
is something like ../../../../../../random_file
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested (in the browser and with a CLI tool). The targeted url is resolved so you will never have dotted path in the filename (see also rfc3986 - the dot segments will be remove before forming the valid URL.
Anyway we should also switch to the StaticFiles handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thank you soo much @fcollonval!
No description provided.