Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ This can also be a string accepted by the

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

directory contains symlinks, they may resolve to files outside the root.

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
Copy Markdown
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.


##### start

Byte offset at which the stream starts, defaults to 0. The start is inclusive,
Expand Down