tar 5.0.10 → 5.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/unpack.js +7 -7
- package/package.json +1 -1
package/lib/unpack.js
CHANGED
|
@@ -547,13 +547,13 @@ class Unpack extends Parser {
|
|
|
547
547
|
// then that means we are about to delete the directory we created
|
|
548
548
|
// previously, and it is no longer going to be a directory, and neither
|
|
549
549
|
// is any of its children.
|
|
550
|
-
// If a symbolic link is encountered
|
|
551
|
-
//
|
|
552
|
-
//
|
|
553
|
-
//
|
|
554
|
-
//
|
|
555
|
-
//
|
|
556
|
-
if (
|
|
550
|
+
// If a symbolic link is encountered, all bets are off. There is no
|
|
551
|
+
// reasonable way to sanitize the cache in such a way we will be able to
|
|
552
|
+
// avoid having filesystem collisions. If this happens with a non-symlink
|
|
553
|
+
// entry, it'll just fail to unpack, but a symlink to a directory, using an
|
|
554
|
+
// 8.3 shortname or certain unicode attacks, can evade detection and lead
|
|
555
|
+
// to arbitrary writes to anywhere on the system.
|
|
556
|
+
if (entry.type === 'SymbolicLink')
|
|
557
557
|
dropCache(this.dirCache)
|
|
558
558
|
else if (entry.type !== 'Directory')
|
|
559
559
|
pruneCache(this.dirCache, entry.absolute)
|