Skip to content

Commit 9b6672a

Browse files
authored
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 8a9c3c2 commit 9b6672a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/fs.md

+6
Original file line numberDiff line numberDiff line change
@@ -4772,6 +4772,12 @@ unavailable in some situations.
47724772
On Windows, no events will be emitted if the watched directory is moved or
47734773
renamed. An `EPERM` error is reported when the watched directory is deleted.
47744774
4775+
The `fs.watch` API does not provide any protection with respect
4776+
to malicious actions on the file system. For example, on Windows it is
4777+
implemented by monitoring changes in a directory versus specific files. This
4778+
allows substitution of a file and fs reporting changes on the new file
4779+
with the same filename.
4780+
47754781
##### Availability
47764782
47774783
<!--type=misc-->

0 commit comments

Comments
 (0)