Skip to content

Commit cf7020a

Browse files
authored
docs: add security considerations to the root option
1 parent 226f2b2 commit cf7020a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ This can also be a string accepted by the
111111

112112
Serve files relative to `path`.
113113

114+
**Important:** The `root` option restricts the served path through string-level
115+
normalization only. It does not resolve symbolic links. If the served
116+
directory contains symlinks, they may resolve to files outside the root.
117+
118+
Do not serve directories where untrusted users can create files or symlinks.
119+
If your application accepts file uploads or operates in a shared/multi-tenant
120+
environment, ensure the served directory is not writable by untrusted parties.
121+
114122
##### start
115123

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

0 commit comments

Comments
 (0)