2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2018-2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-11-11 22:43:05 +00:00
|
|
|
const DANGEROUS_FILE_TYPES =
|
|
|
|
/\.(ADE|ADP|APK|BAT|CAB|CHM|CMD|COM|CPL|DIAGCAB|DLL|DMG|EXE|HTA|INF|INS|ISP|JAR|JS|JSE|LIB|LNK|MDE|MHT|MSC|MSI|MSP|MST|NSH|PIF|PS1|PSC1|PSM1|PSRC|REG|SCR|SCT|SETTINGCONTENT-MS|SHB|SYS|VB|VBE|VBS|VXD|WSC|WSF|WSH)\.?$/i;
|
2018-10-04 01:12:42 +00:00
|
|
|
|
|
|
|
export function isFileDangerous(fileName: string): boolean {
|
|
|
|
return DANGEROUS_FILE_TYPES.test(fileName);
|
|
|
|
}
|