Skip to content
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

Merged
merged 2 commits into from
Feb 7, 2022

Conversation

fcollonval
Copy link
Member

No description provided.

@wolfv wolfv merged commit 4d942c3 into mamba-org:main Feb 7, 2022
@@ -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():
Copy link
Contributor

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.

Copy link
Member

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

Copy link
Member Author

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)

Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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!

@fcollonval fcollonval deleted the fix/main-app-watch branch February 7, 2022 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants