Skip to content

Commit b12e21e

Browse files
committed
add test for new zipslip sanitizer
1 parent 422ade1 commit b12e21e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

javascript/ql/test/query-tests/Security/CWE-022/ZipSlip/ZipSlipGood.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const fs = require('fs');
22
const unzip = require('unzip');
3+
const path = require('path');
34

45
fs.createReadStream('archive.zip')
56
.pipe(unzip.Parse())
@@ -11,4 +12,6 @@ fs.createReadStream('archive.zip')
1112
else {
1213
console.log('skipping bad path', fileName);
1314
}
15+
16+
fs.createWriteStream(path.join(cwd, path.join('/', fileName)));
1417
});

0 commit comments

Comments
 (0)