Skip to content

Commit

Permalink
fix: validate file path for extension file. Close #352
Browse files Browse the repository at this point in the history
  • Loading branch information
ChugunovRoman committed Dec 6, 2023
1 parent e2558d7 commit 5bc301a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/ExtensionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export default class ExtensionManager {
if (
!FILE_WHITE_LIST.includes(file.name) &&
(!FILE_EXTENSION_WHITE_LIST.includes(extname(file.name)) ||
!/^\w+(?:\.\w+)*\.\w+/.test(file.name) ||
!/^[\w/]+(?:\.\w+)*\.\w+/.test(file.name) ||
file.name !== sanitizeFileName(file.name))
) {
throw new Error(`Filename "${file.name}" not allowed`);
Expand Down

0 comments on commit 5bc301a

Please sign in to comment.