File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -315,17 +315,19 @@ added: v0.11.2
315315* ` path ` {string}
316316* Returns: {boolean}
317317
318- The ` path.isAbsolute() ` method determines if ` path ` is an absolute path.
318+ The ` path.isAbsolute() ` method determines if the literal ` path ` is absolute.
319+ Therefore, it’s not safe for mitigating path traversals.
319320
320321If the given ` path ` is a zero-length string, ` false ` will be returned.
321322
322323For example, on POSIX:
323324
324325``` js
325- path .isAbsolute (' /foo/bar' ); // true
326- path .isAbsolute (' /baz/..' ); // true
327- path .isAbsolute (' qux/' ); // false
328- path .isAbsolute (' .' ); // false
326+ path .isAbsolute (' /foo/bar' ); // true
327+ path .isAbsolute (' /baz/..' ); // true
328+ path .isAbsolute (' /baz/../..' ); // true
329+ path .isAbsolute (' qux/' ); // false
330+ path .isAbsolute (' .' ); // false
329331```
330332
331333On Windows:
You can’t perform that action at this time.
0 commit comments