docs: add security considerations to the root option#296
Open
UlisesGascon wants to merge 1 commit intomasterfrom
Open
docs: add security considerations to the root option#296UlisesGascon wants to merge 1 commit intomasterfrom
root option#296UlisesGascon wants to merge 1 commit intomasterfrom
Conversation
bjohansebas
approved these changes
Feb 23, 2026
blakeembrey
reviewed
Mar 21, 2026
| Serve files relative to `path`. | ||
|
|
||
| **Important:** The `root` option restricts the served path through string-level | ||
| normalization only. It does not resolve symbolic links. If the served |
Member
There was a problem hiding this comment.
This is a little confusing because in a sense, it did "resolve" symbolic links. It doesn't validate it was within root. You used the word resolve in following sentence too.
How about a section below about "Security considerations" or "Symlinks", alongside "Caching".
blakeembrey
reviewed
Mar 21, 2026
|
|
||
| Do not serve directories where untrusted users can create files or symlinks. | ||
| If your application accepts file uploads or operates in a shared/multi-tenant | ||
| environment, ensure the served directory is not writable by untrusted parties. |
Member
There was a problem hiding this comment.
I need to think about the phrasing more, but my attempt:
Symlinks
By default, symlinks within root are followed and sent to users. Do not create symlinks within the root directory to files or directories that may be sensitive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.