Skip to content

docs: add security considerations to the root option#296

Open
UlisesGascon wants to merge 1 commit intomasterfrom
docs-improvements
Open

docs: add security considerations to the root option#296
UlisesGascon wants to merge 1 commit intomasterfrom
docs-improvements

Conversation

@UlisesGascon
Copy link
Member

No description provided.

@UlisesGascon UlisesGascon marked this pull request as ready for review February 23, 2026 08:29
@UlisesGascon UlisesGascon self-assigned this Feb 23, 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".


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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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