Skip to content
This repository was archived by the owner on Feb 5, 2023. It is now read-only.

Commit c424f0f

Browse files
committed
fix: Ignore bad paths when extracting potentially malicious zip files
1 parent 9f878df commit c424f0f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/ExtractService.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ export class ExtractService {
5050
return this;
5151
}
5252

53-
jszip.forEach((filePath, entry) => entries.push([filePath, entry]));
53+
jszip.forEach((filePath, entry) => {
54+
if (filePath.includes('..')) {
55+
this.logger.info(`Skipping bad path "${filePath}"`);
56+
} else {
57+
entries.push([filePath, entry]);
58+
}
59+
});
5460
let lastPercent = 0;
5561

5662
await Promise.all(

0 commit comments

Comments
 (0)