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

Only follow symlinks within configured static file handler directory #545

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

spinscale
Copy link
Contributor

This adds an additional check to only follow symlinks that are within
the configured public directory of a static file handler.

This ensures a malicious user cannot link to any files outside of the
public directory to prevent reading arbitrary files.

This adds an additional check to only follow symlinks that are within
the configured public directory of a static file handler.

This ensures a malicious user cannot link to any files outside of the
public directory to prevent reading arbitrary files.
@straight-shoota
Copy link
Contributor

I'm not sure if this is a great enhancement. It's too restrictive.
A harmless user might link a file outside the public directory with honest intentions. This is a quite common practice, actually. I wouldn't want to disable that.

And a malicious user would need write access to the public directory in the first place, in order to link to something outside of it.

Maybe this could be an optional feature?

@spinscale
Copy link
Contributor Author

interesting. I did consider this more of a security issue, as the person running an app is not necessarily the same administering the system. Would you accept this, when this is made configurable? Then I'm happy to change.

@straight-shoota
Copy link
Contributor

Having this as an option should be fine.

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.

None yet

2 participants