-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add an option to prevent following symlinks #147
Comments
Example from nginx: http://nginx.org/en/docs/http/ngx_http_core_module.html#disable_symlinks It is quite expensive to check, as each path component will need a stat lookup. Additionally, a safe implementation of such an option will require Given this, I vote that this feature is dropped. |
Given what you stated I agree, also the initial problem stems in user land as it is his responsability not to create a symlink in the served directory to a private file AFAICT. |
If I understand the problem well enough, can't you use |
Between 1 and 2, the filesystem can have been manipulated to include a symlink in the resolved path, causing the open to point to eg. |
The timing is highly unlikely though, I would consider it secure enough. |
It being expensive is not a reason to not implement it. It's a reason to default it to off, but it doesn't mean we shouldn't have the option. As for cross platform concerns, we support what node core supports. If node doesn't provide us an interface to support windows properly, then we note in the documentation that windows may not support the feature correctly. I agree with @Marsup that the timing situation between comparing the result of |
Currently, if a symlink is placed in the directory that inert shares files from and the user requests the symlink, the contents of the targeted file will be retrieved.
It is common practice to have an option to disable following symlinks and instead respond with a 404. We should add one.
The text was updated successfully, but these errors were encountered: