fix(ghidra): validate Windows control characters explicitly

This commit is contained in:
N0zoM1z0
2026-07-17 03:05:19 +09:00
committed by N0zoM1z0
parent 8b5ae417f3
commit 4dccbecf06
3 changed files with 15 additions and 9 deletions
+7 -1
View File
@@ -221,7 +221,13 @@ export const ghidraHeadlessCommand = (options: {
};
const quoteWindowsBatchToken = (value: string): string => {
if (value.length === 0 || /[\u0000\r\n"%^!&|<>]/u.test(value))
if (
value.length === 0 ||
value.includes("\0") ||
value.includes("\r") ||
value.includes("\n") ||
/["%^!&|<>]/u.test(value)
)
throw new GhidraLaunchError(
"Windows Ghidra P0 paths cannot contain command-interpreter metacharacters",
);