mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: Actually use fileName in examples
This commit is contained in:
@@ -5,5 +5,5 @@ fs.createReadStream('archive.zip')
|
||||
.pipe(unzip.Parse())
|
||||
.on('entry', entry => {
|
||||
const fileName = entry.path;
|
||||
entry.pipe(fs.createWriteStream(entry.path));
|
||||
entry.pipe(fs.createWriteStream(fileName));
|
||||
});
|
||||
|
||||
@@ -5,10 +5,10 @@ fs.createReadStream('archive.zip')
|
||||
.pipe(unzip.Parse())
|
||||
.on('entry', entry => {
|
||||
const fileName = entry.path;
|
||||
if (entry.path.indexOf('..') == -1) {
|
||||
entry.pipe(fs.createWriteStream(entry.path));
|
||||
if (fileName.indexOf('..') == -1) {
|
||||
entry.pipe(fs.createWriteStream(fileName));
|
||||
}
|
||||
else {
|
||||
console.log('skipping bad path', entry.path);
|
||||
console.log('skipping bad path', fileName);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,11 +3,15 @@ nodes
|
||||
| ZipSlipBad2.js:5:20:5:46 | 'output ... ry.path |
|
||||
| ZipSlipBad2.js:5:37:5:46 | entry.path |
|
||||
| ZipSlipBad2.js:6:22:6:29 | fileName |
|
||||
| ZipSlipBad.js:8:37:8:46 | entry.path |
|
||||
| ZipSlipBad.js:7:11:7:31 | fileName |
|
||||
| ZipSlipBad.js:7:22:7:31 | entry.path |
|
||||
| ZipSlipBad.js:8:37:8:44 | fileName |
|
||||
edges
|
||||
| ZipSlipBad2.js:5:9:5:46 | fileName | ZipSlipBad2.js:6:22:6:29 | fileName |
|
||||
| ZipSlipBad2.js:5:20:5:46 | 'output ... ry.path | ZipSlipBad2.js:5:9:5:46 | fileName |
|
||||
| ZipSlipBad2.js:5:37:5:46 | entry.path | ZipSlipBad2.js:5:20:5:46 | 'output ... ry.path |
|
||||
| ZipSlipBad.js:7:11:7:31 | fileName | ZipSlipBad.js:8:37:8:44 | fileName |
|
||||
| ZipSlipBad.js:7:22:7:31 | entry.path | ZipSlipBad.js:7:11:7:31 | fileName |
|
||||
#select
|
||||
| ZipSlipBad2.js:6:22:6:29 | fileName | ZipSlipBad2.js:5:37:5:46 | entry.path | ZipSlipBad2.js:6:22:6:29 | fileName | Unsanitized zip archive $@, which may contain '..', is used in a file system operation. | ZipSlipBad2.js:5:37:5:46 | entry.path | item path |
|
||||
| ZipSlipBad.js:8:37:8:46 | entry.path | ZipSlipBad.js:8:37:8:46 | entry.path | ZipSlipBad.js:8:37:8:46 | entry.path | Unsanitized zip archive $@, which may contain '..', is used in a file system operation. | ZipSlipBad.js:8:37:8:46 | entry.path | item path |
|
||||
| ZipSlipBad.js:8:37:8:44 | fileName | ZipSlipBad.js:7:22:7:31 | entry.path | ZipSlipBad.js:8:37:8:44 | fileName | Unsanitized zip archive $@, which may contain '..', is used in a file system operation. | ZipSlipBad.js:7:22:7:31 | entry.path | item path |
|
||||
|
||||
@@ -5,5 +5,5 @@ fs.createReadStream('archive.zip')
|
||||
.pipe(unzip.Parse())
|
||||
.on('entry', entry => {
|
||||
const fileName = entry.path;
|
||||
entry.pipe(fs.createWriteStream(entry.path));
|
||||
entry.pipe(fs.createWriteStream(fileName));
|
||||
});
|
||||
|
||||
@@ -5,10 +5,10 @@ fs.createReadStream('archive.zip')
|
||||
.pipe(unzip.Parse())
|
||||
.on('entry', entry => {
|
||||
const fileName = entry.path;
|
||||
if (entry.path.indexOf('..') == -1) {
|
||||
entry.pipe(fs.createWriteStream(entry.path));
|
||||
if (fileName.indexOf('..') == -1) {
|
||||
entry.pipe(fs.createWriteStream(fileName));
|
||||
}
|
||||
else {
|
||||
console.log('skipping bad path', entry.path);
|
||||
console.log('skipping bad path', fileName);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user