Skip to content

Commit 26f9a33

Browse files
mhdawsonRafaelGSS
authored andcommitted
doc: add additional caveat for fs.watch
Add clarification based on discussion with security researcher. Signed-off-by: Michael Dawson <[email protected]> PR-URL: #57150 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 076a99f commit 26f9a33

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/fs.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4768,6 +4768,12 @@ unavailable in some situations.
47684768
On Windows, no events will be emitted if the watched directory is moved or
47694769
renamed. An `EPERM` error is reported when the watched directory is deleted.
47704770
4771+
The `fs.watch` API does not provide any protection with respect
4772+
to malicious actions on the file system. For example, on Windows it is
4773+
implemented by monitoring changes in a directory versus specific files. This
4774+
allows substitution of a file and fs reporting changes on the new file
4775+
with the same filename.
4776+
47714777
##### Availability
47724778
47734779
<!--type=misc-->

0 commit comments

Comments
 (0)